summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/OneService.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 96ab1ac3..1ec619d8 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -259,6 +259,10 @@ public:
fclose(bash);
long pid = (long)vfork();
if (pid == 0) {
+ setsid(); // detach from parent so that shell isn't killed when parent is killed
+ signal(SIGHUP,SIG_IGN);
+ signal(SIGTERM,SIG_IGN);
+ signal(SIGQUIT,SIG_IGN);
execl("/bin/bash","/bin/bash",bashp,(char *)0);
exit(0);
}