allow wrapper to work as a daemon-restarter...
This commit is contained in:
parent
f56efb0085
commit
74201e59d6
@ -47,6 +47,10 @@ def parse_args():
|
||||
'-L', '--no-lock',
|
||||
help='Allow multiple simultanious executions of this cron job',
|
||||
action='store_true')
|
||||
parser.add_argument(
|
||||
'-r', '--restart',
|
||||
help='Restart the process if not running; exit with success if previous instance is running',
|
||||
action='store_true')
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
@ -189,6 +193,8 @@ def main():
|
||||
has_lock = aquire_lock(lckfile)
|
||||
if has_lock:
|
||||
res = exec_command(args, o, e, r)
|
||||
elif args.restart:
|
||||
res = 0
|
||||
else:
|
||||
e.write("CRONWRAPPER: Unable to aquire lock, previous instance still running?\n")
|
||||
r.write("\nFalse\n")
|
||||
|
Loading…
Reference in New Issue
Block a user