diff --git a/ddclient.changes b/ddclient.changes index 4e9f36b..3acef6a 100644 --- a/ddclient.changes +++ b/ddclient.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu May 16 13:23:40 UTC 2013 - seife+obs@b1-systems.com + +- more init-script fixes: + - startproc now needs the pidfile parameter (or it woulld look + for "perl.pid". Sorry, should have run more tests. + - while I'm at it, get the pidfile from the config file in case + the user would have changed it + ------------------------------------------------------------------- Wed May 15 07:58:26 UTC 2013 - seife+obs@b1-systems.com diff --git a/rc.ddclient b/rc.ddclient index 8115ed9..a2c93d0 100644 --- a/rc.ddclient +++ b/rc.ddclient @@ -42,6 +42,10 @@ if [ `/bin/cat $DDCLIENT_CONFIG | grep -e "^use=" >/dev/null; echo $?` -eq 0 ]; else dd_use="-use=if -if ppp0" fi +# extract pid= from config, strip trailing comments and trailing whitespace... +pid_file=`sed -n '/^pid=/{s@#.*$@@;s@[[:space:]]*$@@;s@^pid=@@;p}' /etc/ddclient.conf` +# default is /var/run/ddclient.pid +[ -z "$pid_file" ] && pid_file=/var/run/ddclient.pid # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status @@ -77,14 +81,14 @@ case "$1" in echo -n "Starting ddclient daemon :" # startproc does check the name of the binary, and this is "perl" in this case, # so better start it this way or systemd will not know it is running - /sbin/startproc /usr/bin/perl "$DDCLIENT_BIN" -daemon $dd_intervall "$dd_use" $DDCLIENT_OPTIONS -pid /var/run/ddclient.pid + /sbin/startproc -p $pid_file /usr/bin/perl "$DDCLIENT_BIN" -daemon $dd_intervall "$dd_use" $DDCLIENT_OPTIONS -pid $pid_file # remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down ddclient daemon :" - /sbin/killproc -p /var/run/ddclient.pid -TERM /usr/bin/perl + /sbin/killproc -p $pid_file -TERM /usr/bin/perl # remember status and be verbose rc_status -v @@ -117,7 +121,7 @@ case "$1" in ;; status) echo -n "Checking for service ddclient :" - /sbin/checkproc -p /var/run/ddclient.pid /usr/bin/perl + /sbin/checkproc -p $pid_file /usr/bin/perl # remember status and be verbose rc_status -v