Why doesn't this work? kill `/var/lock/LCK..ttyS0` The lock file has the PID number of wvdial and I am trying to use this method to kill the wvdial session from a script. I get a message saying permission is denied. This happens even when I am working as root. Rod -- 100% MS FREE Absolutely no M$ components were used in the generation or posting of this e-mail -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Why doesn't this work?
kill `/var/lock/LCK..ttyS0`
Backquotes cause the shell to execute the command within the backquotes, and replace the backquoted content with the output from the command. So, you're trying to execute /var/lock/LCK..ttyS0. What you want is kill `cat /var/lock/LCK..ttyS0` -- Ron Oliver (mailto:roliver-suse@quantum-networks.com) -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Try kill `cat /var/lock/LCK..ttyS0` If you put something in back ticks (`) it tries and execute it. If the file only holds the PID number, then it does not have anything in it; you can't execute a number, bash will give you an error, and it probably doesn't have the execution permission set for that file. But you can `cat` all the information out of it (ie the PID) which is then passed to the kill command. Also you can do a `killall program_name` `killall wget` This kills ALL programs running that match that name, if you have more than one session active, or you execute it while root (with other users logged on) it can have adverse effects. It might kill more processes then you meant it to. If you system doesn't have the command `killall` you can use this: ps aux | grep -w [p]rogram_name | kill `awk '{print $2}'`
This happens even when I am working as root.
Any program you start under your UID;you should be able to `kill` when logged in as your UID. You don't need to log in as root to kill your own programs. If you start `elm` as user 'joe', at anytime 'joe' is logged in, he should be able to `kill` the `elm` process that he started. Root is not need for this, also root can kill any users process at any time for any reason, which is dangerous to test the `kill` command out with. Jack ----- Original Message ----- From: rjohns <rjohns@otenet.gr> To: <suse-linux-e@suse.com> Sent: Wednesday, January 05, 2000 9:18 AM Subject: [SLE] It just won't die
Why doesn't this work?
kill `/var/lock/LCK..ttyS0`
The lock file has the PID number of wvdial and I am trying to use this method to kill the wvdial session from a script. I get a message saying permission is denied. This happens even when I am working as root.
Rod -- 100% MS FREE
Absolutely no M$ components were used in the generation or posting of this e-mail
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (3)
-
jbarnett@axil.netmate.com
-
rjohns@otenet.gr
-
roliver-suse@quantum-networks.com