Issue
I am trying to run a program as a background process in a server (AWS EC2 instance). I have used boto.manage.cmdshell to obtain an ssh connection to the server. However, I am having trouble running this command:
"nohup daemon-program param 2>&1 > ./logs/out.log &"
It runs fine if I manually ssh into the machine and run this command. My console hangs after ssh-ing into the machine and running this command via python script. If I remove nohup, the program starts and quits when the ssh session ends. I would like it to run as a bg process even after I quit.
I tried reading about pty and nohup manual, but I seem to have missed something here. Kindly point me to a (better?) instruction manual or explain why this fails while manual execution succeeds. TIA!
Solution
If anyone is stuck, ran the command inside byobu and it worked.
Answered By - krish7919