Re-add pid file
This commit is contained in:
parent
16d7649e45
commit
21e0317979
11
adsms.py
11
adsms.py
|
@ -83,4 +83,13 @@ if __name__ == "__main__":
|
|||
args = parser.parse_args()
|
||||
|
||||
config = load_config(args.config_file)
|
||||
run(config)
|
||||
|
||||
try:
|
||||
if config["pid_file"]:
|
||||
with open(config["pid_file"], "w+") as f:
|
||||
f.write(str(os.getpid()))
|
||||
|
||||
run(config)
|
||||
finally:
|
||||
if config["pid_file"]:
|
||||
os.unlink(config["pid_file"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user