From b3c614871acff2e4eb96ad8f78747bacb556934d Mon Sep 17 00:00:00 2001 From: David Paleino Date: Wed, 8 Feb 2012 20:34:21 +0100 Subject: [PATCH] Don't start the daemon if it's already running --- wicd/wicd-daemon.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index c8bb7cf..53c154c 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1764,6 +1764,11 @@ def main(argv): # quit, this should be the only option specified sys.exit(0) + if os.path.exists(wpath.pidfile): + print 'It seems like the daemon is already running.' + print 'If it is not, please remove %s and try again.' % wpath.pidfile + sys.exit(1) + if not os.path.exists(wpath.networks): os.makedirs(wpath.networks)