Package: sec
Version: 2.5.3-1+nmu1

When i use Sec as a daemon,

diff --git a/default/sec b/default/sec
index 4ce6955..70a8e2b 100644
--- a/default/sec
+++ b/default/sec
@@ -1,3 +1,3 @@
 #Defaults for sec
 -RUN_DAEMON="no"
 +RUN_DAEMON="yes"

Sec can be started multiple times with init.d/sec when running sec as a daemon, this because checks in the startup function in init.d/sec are wrong. This means that there multiple sec processes running and only one pid file is available.

In the documentation of start-stop-daemon --exec means `Check for processes that are instances of this executable (according to /proc/pid/exe)`. In the init.d/sec script

NAME=sec
DAEMON=/usr/bin/$NAME
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null

This should mean that /proc/pid/exe must point to /usr/bin/$NAME, /usr/bin/sec in this situation.

$ ps afux | grep sec.pid
root 783 0.0 0.7 35836 7980 ? S 16:58 0:00 /usr/bin/perl -w /usr/bin/sec -conf=/etc/sec.conf -input=/var/log/syslog -pid=/var/run/sec.pid -detach -syslog=daemon
$ ll /proc/783/exe
lrwxrwxrwx 1 root root 0 Apr 16 16:58 /proc/783/exe -> /usr/bin/perl

I've created a patch for this issue, but I'm not sure if this patch is correct.

diff --git a/init.d/sec b/init.d/sec
index ef79314..e070873 100755
--- a/init.d/sec
+++ b/init.d/sec
@@ -19,6 +19,7 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="Simple Event Correlator"
 NAME=sec
+PERL=/usr/bin/perl
 DAEMON=/usr/bin/$NAME
 #DAEMON_ARGS="--options args"
 PIDFILE=/var/run/$NAME.pid
@@ -51,9 +52,9 @@ do_start()
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PERL --startas $DAEMON --test > /dev/null \
                || return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PERL --startas $DAEMON -- \
                $DAEMON_ARGS \
                || return 2
# Add code here, if necessary, that waits for the process to be ready
@@ -71,7 +72,7 @@ do_stop()
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $PERL
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2

I am using `Linux [...] 3.2.0-2-amd64 [...] x86_64 GNU/Linux` with Wheezy.

--
Frank Baalbergen - System / Network Engineer
T +31 (0)10 2760434 | frank.baalber...@mendix.com | www.mendix.com



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to