From: Stefan Schantl Date: Wed, 9 Dec 2015 13:49:11 +0000 (+0100) Subject: Prevent from running guardian twice. X-Git-Tag: 2.0~52 X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fguardian.git;a=commitdiff_plain;h=624876cf46b75ab7078c31d81b4cd339b499e562 Prevent from running guardian twice. Guardian now checks for an already running instance on startup and will cancel if there has been found one. Signed-off-by: Stefan Schantl --- diff --git a/guardian b/guardian index 58a0819..2a5b460 100644 --- a/guardian +++ b/guardian @@ -66,6 +66,11 @@ if (defined($cmdargs{"help"})) { exit; } +# Check if another instance of guardian is allready running. +if (&Guardian::Daemon::IsRunning()) { + die "Another instance of Guardian is allready running...\n"; +} + # Read-in the configuration file and store the settings. # Push the may be given config file argument. my %mainsettings = &Guardian::Config::UseConfig($cmdargs{"config"});