diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-03 16:37:24 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-03 16:37:24 -0700 |
| commit | 7e647c530309ec218403f0b6471da45104a6f9d0 (patch) | |
| tree | 6edbd4d8f4bb5ab04226021ca8c5fabfeab37758 | |
| parent | fe87136870968472f7b50727d726eb3c1111ca0f (diff) | |
| download | infinitytier-7e647c530309ec218403f0b6471da45104a6f9d0.tar.gz infinitytier-7e647c530309ec218403f0b6471da45104a6f9d0.zip | |
NOHUP-ify the child process on OSX auto-update.
| -rw-r--r-- | service/OneService.cpp | 4 |
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); } |
