I have a script that needs to be run on background, if I run the same script on foreground, the script runs good and it wont stop until we manually interrupt (ctrl^c).
I am sure that the below command runs the script in background.
sudo -u webs ./spagent_L1 &
Once the above command is executed it will give the job number and the process number.
And immediately after that if i press enter two times, the job gets stopped.
+ Stopped sudo -u webs ./spagent_L1
if I check the jobs running in background it shows that the job has been stopped.
$> jobs + Stopped sudo -u webs ./spagent_L1
Whereas if I check for process running, it shows like the above mentioned script is running.
$> ps -eo user,ppid,pid,cmd,state | grep -i spagent root 10118 9383 0 05:42 pts/1 00:00:00 sudo -u webs ./spagent_L1 T ape 10122 3983 0 05:42 pts/1 00:00:00 grep -i spagent R
Unless I kill the process 10118 the jobs command shows the output that the process is stopped. Once the process is killed, the jobs command doesn't return anything.
So, does the above output mean if the process is still running? Could anyone please help me understand what is happening up there. and how to run the script in background without getting it stopped.
Thanks in advance.