New answers tagged

1

First they are not sigterm. Next you pass a signal, not an argument. To send signals we use kill. See man kill. You have to specify the process. systemd will always be run as process 1, the init process. Therefore to send SIGRTMIN+15, do sudo kill -SIGRTMIN+15 1. However it will be better to use the command shutdown --poweroff, or shutdown --reboot.


3

Use -e option: pkill -e program. pkill --help: -e, --echo display what is killed pkill -V: pkill from procps-ng 3.3.15


0

xhienne's answer does not work in non-interactive sh (dash) . use () will not create a process group, so sh -c '(sleep 6m | sleep 8m) & kill -- -$!' will not work. However, you can still use ps --no-headers --format pgid:1 $! to find the pgid of the whole pipe and kill it. sleep 6m | sleep 8m & pgid=`ps -ho $!` kill -- -$pgid Moreover, using () in ...


0

The Easiest way is to use -9 flag on kill command user@host:/path> jobs [1]+ Running /usr/home/script1.sh $i & user@host:/path> fg /usr/home/script1.sh $i ^C [1]+ Stopped /usr/home/script1.sh $i user@host:/path> kill -9 %1 [1]+ Stopped /usr/home/script1.sh $i user@host:/path> [1]+ Killed ...


Top 50 recent answers are included