nkillall(8)

NAME
nkillall - send signals to all processes; write messages to users

SYNOPSIS
nkillall -[vq] [-s secs] [-M|W mesg] [-signum] [-E prog [arg[s]]

DESCRIPTION
nkillall sends signals to all processes skipping it's own PID. It is a simple program that does not use /proc FS. It uses kill(2) and execve(2) syscalls. It is designed as a replacement of the SysVinit killall5(8) command.

USAGE
It is not allowed to use -h (signal SIGHUP) as first option! If you really want this then start: nkillall -s0 -hup ...

-v  verbose mode; -vv means more verbose

-q  quiet mode; ignores SIGINT signal; Ctrl-C does't work!

-s  secs
    sleep secs

-M  mesg
    write mesg to stdout. The message can include escape symbols: \NNN, \a, \b, \e, \c, \f, \n, \r, \t, \v, \\ like in C language. Last message can be written again with -M% or -W%. Example: nkillall -M'\n\aPlease logout! The system is going down...' \
             -W% -s2 -W% -s4 -W% -s12 \
             -M'\tSending TERM signal' -term ...

-W  mesg
    write mesg to all logged users. The syntax is the same as -M. nkillall determines logged users by looking at /var/run/utmp.
    In my opinion /var/run/utmp is unreliable! Other programs like who(1), wall(1), login(1) also use this file. If you feel that yours is insecure, better don't use the -W option.

-signum
    send all processes the singal signum. Some important signals can be encodded. For example SIGTERM can be typed with -15 or -term. Only the first letter is important! The command kill -l lists the signal numbers.

-E  /path/to/program [arg[s]]
    execve(2) the program with some arguments. This option must be last! The program will have the same PID as nkillall.

NOTE
The options are applied immediately. Their position is important. The next two examples work differently: nkillall -q -s2 -M'sending signal SIGTERM' -15 ...
nkillall -s2 -M'sending signal SIGTERM' -15 -q ... Use the options -v[v] -q after nkillall immediately.

WARNING
nkillall also kills the script in which it is included. Use it in scripts like: #!/bin/sh
before commands
exec nkillall [options] -E/path/to/prog prog_opt(s) An example of wrong usage is the following: #!/bin/sh
before commands
nkillall ...
after commands

EXAMPLES
nkillall -M'Sending all processes SIGTERM ...' -s2 -15 \
         -M'Sending all processes SIGKILL ...' -s6 -9 \
         -s1 -E /path/to/program arg1 arg2 ... nkillall -v -s1 -15 -cont -s6 -kill -s1 -E/path/to/prog arg(s) ... nkillall -vv -pause -s59 -continue -M'Hello world!'

FILES
/var/run/utmp

AUTHOR
nkillall is included in ninit package and can be downloaded from
http://riemann.frmi.uni-sofia.bg/ninit/

SEE ALSO
ninit(8), kill(1), kill(2), execve(2), utmp(5)
init(8), killall5(8)