diff options
author | Jakob Unterwurzacher | 2015-11-09 23:21:11 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-11-09 23:33:35 +0100 |
commit | 51fcf61630905f5dc9370e18522cd0a6c086856d (patch) | |
tree | 28fb05508d5c7227b07e01d20360b98e14606473 /daemonize.go | |
parent | 273d8086aefdcdbd361d9be31d362b128a3f60f4 (diff) |
Use new arg "-notifypid" for more robust daemonization
No more string matching on the parent command line!
Diffstat (limited to 'daemonize.go')
-rw-r--r-- | daemonize.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/daemonize.go b/daemonize.go index 32255ca..4f09164 100644 --- a/daemonize.go +++ b/daemonize.go @@ -21,7 +21,8 @@ func waitForUsr1() { func daemonize() { go waitForUsr1() name := os.Args[0] - newArgs := []string{"-f"} + notifyArg := fmt.Sprintf("-notifypid=%d", os.Getpid()) + newArgs := []string{"-f", notifyArg} newArgs = append(newArgs, os.Args[1:]...) c := exec.Command(name, newArgs...) c.Stdout = os.Stdout |