From 9d44c0d9952e67f6afad15e2940a5be6f1fe9094 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sat, 28 Feb 2015 09:55:25 +0100 Subject: [PATCH] guardian: Prevent from running multiple instances. --- config/guardian/guardian | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/guardian/guardian b/config/guardian/guardian index 9374fe295d..60fe04435e 100644 --- a/config/guardian/guardian +++ b/config/guardian/guardian @@ -114,6 +114,16 @@ if (defined($options{"h"})) { exit; } +# Check if another guardian instance is running. +if (-e "$pidfile") { + print STDERR "Guardian PID file found!\n\n"; + print STDERR "Please stop guardian or release the PID file\n"; + print STDERR "if no other guardian instance is running.\n"; + + # Exit with return code "1". + exit 1; +} + # Call function to read in the configuration file. &load_conf; -- 2.39.5