I have multiple scripts that detach a process from bash using
&>/dev/null &. My question is, how do I kill the process after completely detaching it from bash. using
pidof ScriptName doesn't work.
nohup should only affect the hangup signal. So
kill should still work normally. Maybe you are using the wrong pid or process name; compare with
pstree -p or
If you still suspect
nohup, maybe you could try
$ sleep 1000 & $ jobs -p 13561 $ disown $ jobs -p $ pidof sleep 13561 $ kill 13561 $ pidof sleep $
If you used
nohup, you can't kill them. The
nohup command specifically prevents those processes from receiving the kill signals. If you simply used
&, you can kill them by sending a
kill -9 to the PID. Well, you can kill them by rebooting the machine, but that might be a bit more extreme than you really want...