On Sat, 24. March 2007 16:03:25 Rajko M. wrote:
On Saturday 24 March 2007 09:16, riccardo35@gmail.com wrote:
whereas, I am sure there are 1000 reasons why it is not a good script,
...
kill -9
...
There is 1000 and first, not to use kill -9 as a regular procedure.
All users that render their system useless because they used too often kill -9 will tell you that Linux is as bad as any other OS, as applications are not running (lock files are not removed), failing one by one (as user applies kill -9).
What kill -9 does is to turn power switch off for the affected application. Many applications will refuse to start because they check only if there is their own lock file, and as previous run finished withoot giving program chance to remove lock file it will not run, like Firefox in first post of this thread.
The signal 9 is mighty tool if used for what it is intended. To remove processes that doesn't respond to normal request to quit, but used everywhere it is more like using hammer to center picture on your monitor
In place of kill it is imo better to use pkill / pgrep. Especially if you are working with Solaris from time to time you will be glad not to use killall (as often mentioned the in linux doc's). Killall on Solaris does what it says, it kills _all_ processes. From man pkill: PGREP(1) Linux User’s Manual PGREP(1) NAME pgrep, pkill - look up or signal processes based on name and other attributes SYNOPSIS pgrep [-flvx] [-d delimiter] [-n|-o] [-P ppid,...] [-g pgrp,...] [-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...] [-t term,...] [pattern] pkill [-signal] [-fvx] [-n|-o] [-P ppid,...] [-g pgrp,...] [-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...] [-t term,...] [pattern] DESCRIPTION pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to std‐ out. All the criteria have to match. For example, $ pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, $ pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. ... So if you are a novice Linux user don't start using kill or killall. Start using pkill / pgrep instead. regards, thomas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org