##// END OF EJS Templates
cmdutil: service: add appendpid parameter to append pids to pid file
Nicolas Dumazet -
r10012:2bfe1a23 default
parent child Browse files
Show More
@@ -558,7 +558,7 b' def copy(ui, repo, pats, opts, rename=Fa'
558 558 return errors
559 559
560 560 def service(opts, parentfn=None, initfn=None, runfn=None, logfile=None,
561 runargs=None):
561 runargs=None, appendpid=False):
562 562 '''Run a command as a service.'''
563 563
564 564 if opts['daemon'] and not opts['daemon_pipefds']:
@@ -588,7 +588,8 b' def service(opts, parentfn=None, initfn='
588 588 initfn()
589 589
590 590 if opts['pid_file']:
591 fp = open(opts['pid_file'], 'w')
591 mode = appendpid and 'a' or 'w'
592 fp = open(opts['pid_file'], mode)
592 593 fp.write(str(os.getpid()) + '\n')
593 594 fp.close()
594 595
General Comments 0
You need to be logged in to leave comments. Login now