From 682b9599e82099dde92034413423112d54b5bc5e Mon Sep 17 00:00:00 2001 From: Simon Let Date: Wed, 4 Jan 2023 23:42:05 +0100 Subject: [PATCH] Redo resh-daemon-start.sh, get rid of nohup dependency --- scripts/resh-daemon-start.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/resh-daemon-start.sh b/scripts/resh-daemon-start.sh index bbbd7c2..f6ae71c 100755 --- a/scripts/resh-daemon-start.sh +++ b/scripts/resh-daemon-start.sh @@ -1,2 +1,12 @@ #! /usr/bin/env sh -nohup resh-daemon >/dev/null 2>/dev/null & disown \ No newline at end of file +# Run daemon in background - don't block +# Redirect stdin, stdout, and stderr to /dev/null - detach all I/O +resh-daemon /dev/null 2>/dev/null & + +# After resh-daemon-start.sh exits the resh-daemon process loses its parent +# and it gets adopted by init + +# NOTES: +# No disown - job control of this shell doesn't affect the parent shell +# No nohup - SIGHUP signals won't be sent to orphaned resh-daemon (plus the daemon ignores them) +# No setsid - SIGINT signals won't be sent to orphaned resh-daemon (plus the daemon ignores them) \ No newline at end of file