I want to run a process in background without killing it on shell exit, according to Nohup concept the following command should work until I kill it manually:
nohup uwsgi --http :8008 --module crawled_data_center.wsgi > /dev/null &
I'm logged in with root user to shell, but after exit the shell, the process got terminated. It seems weird because I've used nohup
several times in several projects and works correctly but in this case I've sucked, what is the problem and how can I run it in background without killing it on shell exit?
Update:
I handled it with:
$ nohup uwsgi --http :8008 --module crawled_data_center.wsgi > /dev/null &
$ disown -l
$ disown -h JOBID
But my question is about how could it be possible SIGHUP
could kill nohup
and &
?
Here is the content of /etc/systemd/logind.conf
:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
Controllers=blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event net_cls net_prio
ResetControllers=
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min