Accepting request 176259 from network

more init-script fixes, sorry, should have run more tests :-) (forwarded request 175891 from seife)

OBS-URL: https://build.opensuse.org/request/show/176259
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ddclient?expand=0&rev=34
This commit is contained in:
Stephan Kulow 2013-05-27 07:44:18 +00:00 committed by Git OBS Bridge
commit 71a5c7c038
2 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -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