summaryrefslogtreecommitdiffstats
path: root/retiolum/hosts/.scripts/tinc_multicast/retiolum.py
diff options
context:
space:
mode:
authorLassulus <Lassulus@googlemail.com>2011-05-25 06:46:52 +0200
committerLassulus <Lassulus@googlemail.com>2011-05-25 06:46:52 +0200
commit213aaea1d4b4527039d71c02472ba964c38e0577 (patch)
treeee7ba66a607215d6aee5112eadeec2ce8148f0f1 /retiolum/hosts/.scripts/tinc_multicast/retiolum.py
parentb8c29e501f2d5f49bd69eb0eb223c5b619164be8 (diff)
bugfixing
Diffstat (limited to 'retiolum/hosts/.scripts/tinc_multicast/retiolum.py')
-rwxr-xr-xretiolum/hosts/.scripts/tinc_multicast/retiolum.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/retiolum/hosts/.scripts/tinc_multicast/retiolum.py b/retiolum/hosts/.scripts/tinc_multicast/retiolum.py
index b67fcc8d..8cf57471 100755
--- a/retiolum/hosts/.scripts/tinc_multicast/retiolum.py
+++ b/retiolum/hosts/.scripts/tinc_multicast/retiolum.py
@@ -290,9 +290,9 @@ def process_restart(signum, frame):
def kill_process(signum, frame):
logging.error("got SIGINT/SIGTERM exiting now")
os.remove("/var/lock/retiolum." + netname)
- sys.exit(0)
- if option.Tinc != False:
+ if option.tinc != False:
stop_tincd = subprocess.call(["tincd -n " + netname + " -k"],shell=True)
+ sys.exit(0)
#Program starts here!
@@ -316,9 +316,13 @@ hostslist = []
hostslock = thread.allocate_lock()
#set process name
-pidfile = open("/var/lock/retiolum." + netname, "w")
-pidfile.write(str(os.getpid()))
-pidfile.close()
+if not os.path.exists("/var/lock/retiolum." + netname):
+ pidfile = open("/var/lock/retiolum." + netname, "w")
+ pidfile.write(str(os.getpid()))
+ pidfile.close()
+else:
+ logging.error("pidfile already exists")
+ sys.exit(0)
#Logging stuff
LEVELS = {'3' : logging.DEBUG,