diff options
author | erg_samowzbudnik <uinarf@autistici.org> | 2021-06-12 10:19:50 +0200 |
---|---|---|
committer | erg_samowzbudnik <uinarf@autistici.org> | 2021-06-12 10:19:50 +0200 |
commit | 32d9b74be4b6c599d8074fdf4573869322543451 (patch) | |
tree | 9158599cb7c4322e93ea98466c3a3f6476876888 | |
parent | cc45e524b57007b5e05dfb809f1a084d8c80cd28 (diff) | |
download | RPGH-32d9b74be4b6c599d8074fdf4573869322543451.tar.gz RPGH-32d9b74be4b6c599d8074fdf4573869322543451.tar.bz2 RPGH-32d9b74be4b6c599d8074fdf4573869322543451.zip |
fix uid
-rw-r--r-- | monitor_unified.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor_unified.py b/monitor_unified.py index f00c710..5279022 100644 --- a/monitor_unified.py +++ b/monitor_unified.py @@ -494,13 +494,13 @@ class Rain(Sensor): def clean_exit(sig,frame): #do some other cleanup if you want - os.remove('/var/run/user/[your uid]/RPGH_starter.pid') + os.remove('/var/run/user/1000RPGH_starter.pid') os.exit(0) def start(): signal.signal(signal.SIGTERM, clean_exit)#from start-stop-daemon signal.signal(signal.SIGINT, clean_exit)#from ctrl-c - with open('/var/run/user/[your uid]/RPGH_starter.pid', 'x') as pid_file: + with open('/var/run/user/1000/RPGH_starter.pid', 'x') as pid_file: pid_file.write(str(os.getpid())) do_main_loop() @@ -513,7 +513,7 @@ def main(): if os.fork():sys.exit(0) start() elif action=='stop': - with open('/var/run/user/[your uid]/RPGH_starter.pid', r') as pid_file: + with open('/var/run/user/1000/RPGH_starter.pid', r') as pid_file: pid=int(pid_file.read()) os.kill(pid,signal.SIGTERM) @@ -526,7 +526,7 @@ def main(): child.wait(timeout=10) except psutil.TimeoutExpired:#we didn't exit/clean up in time child.kill() - os.remove('/var/run/user/[your uid]/RPGH_starter.pid') + os.remove('/var/run/user/1000/RPGH_starter.pid') if __name__ == '__main__': fq = cfg.getint('hardware_settings', 'read_frequency') |