##// END OF EJS Templates
serve: allow --daemon-postexec to be 'unlink:path' or 'none'...
Jun Wu -
r28195:213c8cf0 default
parent child Browse files
Show More
@@ -765,7 +765,7 b' def service(opts, parentfn=None, initfn='
765 765 try:
766 766 if not runargs:
767 767 runargs = util.hgcmd() + sys.argv[1:]
768 runargs.append('--daemon-postexec=%s' % lockpath)
768 runargs.append('--daemon-postexec=unlink:%s' % lockpath)
769 769 # Don't pass --cwd to the child process, because we've already
770 770 # changed directory.
771 771 for i in xrange(1, len(runargs)):
@@ -799,12 +799,16 b' def service(opts, parentfn=None, initfn='
799 799 writepid(util.getpid())
800 800
801 801 if opts['daemon_postexec']:
802 lockpath = opts['daemon_postexec']
802 inst = opts['daemon_postexec']
803 803 try:
804 804 os.setsid()
805 805 except AttributeError:
806 806 pass
807 if inst.startswith('unlink:'):
808 lockpath = inst[7:]
807 809 os.unlink(lockpath)
810 elif inst != 'none':
811 raise error.Abort(_('invalid value for --daemon-postexec'))
808 812 util.hidewindow()
809 813 sys.stdout.flush()
810 814 sys.stderr.flush()
General Comments 0
You need to be logged in to leave comments. Login now