From 32d9b74be4b6c599d8074fdf4573869322543451 Mon Sep 17 00:00:00 2001 From: erg_samowzbudnik Date: Sat, 12 Jun 2021 10:19:50 +0200 Subject: fix uid --- monitor_unified.py | 8 ++++---- 1 file 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') -- cgit v1.2.3-65-gdbad