]> git.ipfire.org Git - people/stevee/guardian.git/commitdiff
Prevent from running guardian twice.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 9 Dec 2015 13:49:11 +0000 (14:49 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 9 Dec 2015 13:49:11 +0000 (14:49 +0100)
Guardian now checks for an already running instance on startup and will
cancel if there has been found one.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
guardian

index 58a08195038eaf771b747b12b8e9cd8b4f603d60..2a5b460da4d37137e43211570007da01d28b155d 100644 (file)
--- a/guardian
+++ b/guardian
@@ -66,6 +66,11 @@ if (defined($cmdargs{"help"})) {
        exit;
 }
 
        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"});
 # Read-in the configuration file and store the settings.
 # Push the may be given config file argument.
 my %mainsettings = &Guardian::Config::UseConfig($cmdargs{"config"});