I executed a perl script in background using the following command
nohup perl myPerlSCript.pl >debug_log &
After few minutes I got the status as
[1]+ Stopped
I wasn't expecting it to stop, nor do I know what stopped it. How can I debug this and find out why it stopped? I am actually interested in knowing the unix commands to debug.
There are several ways a process running in the background can be stopped. All of them involve one of these signals:
SIGSTOP
SIGTSTP
SIGTTOU
SIGTTIN
SIGSTOP
is severe. It's unblockable, unignorable, unhandlable. It stops the process as surely as SIGKILL
would kill it. The others can be handled by the background process to prevent stopping.
kill(2)
, or by the process to itself using raise(3)
or kill(2)
tostop
is enabled (see output of stty -a
). This generates SIGTTOU
.tcsetattr(3)
or an equivalent ioctl
. (These are the same modes shown by stty
.) This generates SIGTTOU
regardless of the current state of the tostop
flag.SIGTTIN
.This list is probably very incomplete.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With