Re: [SLE] Auto starting programs in X
Hi David, Apropos the autostart, I played around somewhat and came up with the following (which I will also send also by private email). There are bound to be better ways of doing it, but it might at least serve a proof of concept. You might be able to substitute it for the line that presently autostarts Netscape in YAST2. Regards, Geoff #!/bin/bash ########################################################################### # This script checks if Netscape or Firestarter is running. If either is not # running, then it is started. If it is running, then do nothing vis a vis # that program. # The assumption is that the script is run by root. The Firestarter part # would need tweaking if it is not. ########################################################################### # grep the process tree for running instances of the programs. # Redirect the output to files, which will be of zero # length if the no running instance is found. There is probably a nicer # way to do this, but it appears to work. ps auxc | grep netscape > netscape_running ps auxc | grep firestarter > firestarter_running # If the netscape file is of zero length then start netscape as a background job if ! test -s netscape_running; then netscape & fi # Ditto for firestarter if ! test -s firestarter_running; then firestarter & fi _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Hi Geoff Well done, looks like a bit of lateral thinking. Basically it runs out of the box, but needs some tinkering because of something I did not realise. Firestarter seems only to run the once, so when it is found running it needs to be shut down and loaded again. Been trying to work out how to terminate from the command line but can't. Tried kill firestarter - no go. Found the PID and killed it but of course that is different everytime. So if you know how to kill from a terminal let me know. Can't find anything in the manuals. The line in Yast is in the modem set up where it can call a command. I assume there must be a config for it somewhere. Regards, David On Sun, 9 Dec 2001 17:35:25 +0000, Geoff wrote:
Hi David,
Apropos the autostart, I played around somewhat and came up with the following (which I will also send also by private email). There are bound to be better ways of doing it, but it might at least serve a proof of concept. You might be able to substitute it for the line that presently autostarts Netscape in YAST2.
Regards,
Geoff
Try this: kill `pidof firestarter` Note the backquotes (under the tilde on the keyboard). The pidof command is in /sbin so it has to be run as root unless you make other arrangements. Keith
So if you know how to kill from a terminal let me know. Can't find anything in the manuals.
===== LPIC-1 N+ MCSE The difference between Linux and Microsoft is the difference between trust and anti-trust. __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com
Thanks - yes that works Regards, David On Sun, 9 Dec 2001 18:05:36 -0800 (PST), Keith Winston wrote:
Try this:
kill `pidof firestarter`
Note the backquotes (under the tilde on the keyboard). The pidof command is in /sbin so it has to be run as root unless you make other arrangements.
Keith
So if you know how to kill from a terminal let me know. Can't find anything in the manuals.
===== LPIC-1 N+ MCSE
The difference between Linux and Microsoft is the difference between trust and anti-trust.
__________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com
On Sun, 9 Dec 2001 22:43:19 +0000
David
Basically it runs out of the box, but needs some tinkering because of something I did not realise. Firestarter seems only to run the once, so when it is found running it needs to be shut down and loaded again. Been trying to work out how to terminate from the command line but can't. Tried kill firestarter - no go. Found the PID and killed it but of course that is different everytime.
So far as the console-kill is concerned, try <killall firestarter> - see man killall. I have also produced a revised script, firestarter_rev, which is below and by email to you. I am not, however, at all sure that it is what you need (am suffering from Monday-morning-brain-itis just now). We can always revise it further. Regards, Geoff #!/bin/bash ########################################################################### # This script begins by killing any running instance of Firestarter. It will # generate a harmless and invisible error if no instance is, in fact, running. # It then checks to see if Netscape is running, and starts it if it is not. # It then restarts Firestarter. ########################################################################### # Destroy all running instances of firestarter killall firestarter # grep the process tree for running instances of netscape # Redirect the output to a files, which will be of zero # length if no running instance is found. There is probably a nicer # way to do this, but it appears to work. ps auxc | grep netscape > netscape_running # If the netscape file is of zero length then start netscape as a background job if ! test -s netscape_running; then netscape & fi # Now re-start firestarter /usr/local/bin/firestarter & _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Hi Geoff Thanks for that - it works ! I know you don't think it is very elegant, but it seems to do the job. I can't get the Suse firewall2 to allow my win box to connect, so now I have Firestarter auto loading which saves me the problem of having to work that out. At last after xx years I have moved forward a pace. Now the next......... Thanks for all your help. On Mon, 10 Dec 2001 12:43:50 +0000, Geoff wrote:
So far as the console-kill is concerned, try <killall firestarter> - see man killall.
I thought that killed everything so didn't use it Regards, David
On Mon, 10 Dec 2001 23:34:11 +0000
David
Hi Geoff Thanks for that - it works !
:-) You are welcome. Come back to me if you eventually need to modify it when you stop doing all as root.
I know you don't think it is very elegant, but it seems to do the job.
As my sadly-missed cockney carpenter father-in-law used to say, as he stood back to admire a rushed job, "Crude ..... but effective" Regards, Geoff _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
On Tue, 11 Dec 2001 08:40:18 +0000, Geoff wrote:
On Mon, 10 Dec 2001 23:34:11 +0000 David
wrote: Hi Geoff Thanks for that - it works !
:-) You are welcome. Come back to me if you eventually need to modify it when you stop doing all as root.
Forgot about that - doesn't work under user - firewall doesn't protect either. Oh dear back to the drawing board. Regards, David
On Tue, 11 Dec 2001 22:07:29 +0000
David
On Tue, 11 Dec 2001 08:40:18 +0000, Geoff wrote:
On Mon, 10 Dec 2001 23:34:11 +0000 David
wrote: Hi Geoff Thanks for that - it works !
:-) You are welcome. Come back to me if you eventually need to modify it
when
you stop doing all as root.
Forgot about that - doesn't work under user - firewall doesn't protect either.
Oh dear back to the drawing board.
This is fixable, though it may involve the use of sudo (man sudo and man visudo - but not unless you have an hour or so to spare). Just to confirm before planning the modification, - the script presently runs from that YAST2 command line - not within ip-up.local? If (as I think), it is not in ip-up.local, did you perchance ever experiment with putting it there? Thanks, Geoff _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
On Tue, 11 Dec 2001 22:45:04 +0000, Geoff wrote:
Forgot about that - doesn't work under user - firewall doesn't protect either.
Oh dear back to the drawing board.
This is fixable, though it may involve the use of sudo (man sudo and man visudo - but not unless you have an hour or so to spare). Just to confirm before planning the modification, - the script presently runs from that YAST2 command line - not within ip-up.local? If (as I think), it is not in ip -up.local, did you perchance ever experiment with putting it there?
I just tried that. It will kill F/s but won't load it or Netscape. Don't understand that. Must be something that blocks it at that moment. If you run ip-up.local as a command then it works. Regards, David
On Wed, 12 Dec 2001 00:17:05 +0000
David
Just to confirm before planning the modification, - the script presently runs from that YAST2 command line - not within ip-up.local? If (as I think), it is not in ip -up.local, did you perchance ever experiment with putting it there?
I just tried that. It will kill F/s but won't load it or Netscape. Don't understand that. Must be something that blocks it at that moment. If you run ip-up.local as a command then it works.
OK .. I have made some modifications to firetest_rev which I think will do the trick and should allow you to continue to run from the YAST2 line. Because the way in which the script works may have security implications for your system I am going to test it a little further here, then send it, with some instructions, by private email. Geoff _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
participants (3)
-
David
-
Geoff
-
Keith Winston