Commit 309d1940 authored by nextime's avatar nextime

Fix watchdog daemonization with setsid

- Use setsid to properly daemonize main() function
- setsid bash -c 'main' & creates independent process group
- Prevents main() from being killed when parent script exits
- Fixed both wssshd and wssshc watchdogs
- Watchdog processes should now persist correctly
parent cab9eefd
...@@ -260,8 +260,8 @@ case "$1" in ...@@ -260,8 +260,8 @@ case "$1" in
fi fi
echo "Calling main() function..." echo "Calling main() function..."
# Run main() in background and don't wait for it # Properly daemonize the main() function
main & setsid bash -c 'main' &
# Give it a moment to start # Give it a moment to start
sleep 1 sleep 1
......
...@@ -255,8 +255,8 @@ case "$1" in ...@@ -255,8 +255,8 @@ case "$1" in
fi fi
echo "Calling main() function..." echo "Calling main() function..."
# Run main() in background and don't wait for it # Properly daemonize the main() function
main & setsid bash -c 'main' &
# Give it a moment to start # Give it a moment to start
sleep 1 sleep 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment