Closed ospalax closed 2 years ago
Solved by PR:
To execute long-running processes in START_SCRIPT
or other context script:
nohup service nginx start &
If the process is not wrapped in nohup ... &
then it will receive SIGTERM
once START_SCRIPT
finishes.
START_SCRIPT
is started in a subshell byone-contexd
service which will block and wait for this subshell (its process child) to terminate - therefore if start script creates any long running process then it will halt the one-contexd service and OS boot.The issue manifests with obvious example like running infinite loop in the start script (
while true ; do :; done
) but unfortunately this happens also in more sinister way when a command seemingly is finished and start script reach the end - the culprit in these cases are processes which fork or daemonize.Therefore very useful commands like
rc-service nginx start
cause this too and cannot be used in the start script currently.I failed to find any trick to avoid this problem - no amount of nohups, setsid, disown and any of their combination seemed to work.
Proposed solution is to not run
START_SCRIPT
and possibly other scripts in a subshell.