##// END OF EJS Templates
cmdutil.service: move pidfile writing to the parent in daemon mode...
Siddharth Agarwal -
r19868:0532c8f8 default
parent child Browse files
Show More
@@ -497,6 +497,7 b' def service(opts, parentfn=None, initfn='
497 pid = util.rundetached(runargs, condfn)
497 pid = util.rundetached(runargs, condfn)
498 if pid < 0:
498 if pid < 0:
499 raise util.Abort(_('child process failed to start'))
499 raise util.Abort(_('child process failed to start'))
500 writepid(pid)
500 finally:
501 finally:
501 try:
502 try:
502 os.unlink(lockpath)
503 os.unlink(lockpath)
@@ -511,7 +512,8 b' def service(opts, parentfn=None, initfn='
511 if initfn:
512 if initfn:
512 initfn()
513 initfn()
513
514
514 writepid(os.getpid())
515 if not opts['daemon']:
516 writepid(os.getpid())
515
517
516 if opts['daemon_pipefds']:
518 if opts['daemon_pipefds']:
517 lockpath = opts['daemon_pipefds']
519 lockpath = opts['daemon_pipefds']
General Comments 0
You need to be logged in to leave comments. Login now