write syslog message if an existing psad is already running
authorMichael Rash <mbr@cipherdyne.org>
Sat, 8 Feb 2014 15:07:43 +0000 (10:07 -0500)
committerMichael Rash <mbr@cipherdyne.org>
Sat, 8 Feb 2014 15:07:43 +0000 (10:07 -0500)
psad

diff --git a/psad b/psad
index 8f8701a..1ac1274 100755 (executable)
--- a/psad
+++ b/psad
@@ -10729,8 +10729,11 @@ sub is_running() {
 ### make sure pid is unique
 sub unique_pid() {
     my $pidfile = shift;
-    die "[*] $0 process is already running! Exiting.\n"
-        if &is_running($pidfile);
+    if (&is_running($pidfile)) {
+        my $msg = "Another $0 process is already running, exiting.";
+        &sys_log($msg);
+        die "[*] $msg";
+    }
     return;
 }