commit:     41f25eb21b8f14a516847ab494208539fec6ec8d
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Tue Oct 27 13:45:07 2015 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Tue Oct 27 14:05:18 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41f25eb2

net-p2p/amule: update init script

- properly pass env variable to the daemon
- replace/remove deprecated start-stop-daemon options
- use portable shell

Gentoo-Bug: 420157

 net-p2p/amule/files/amuled.initd   | 11 ++++++-----
 net-p2p/amule/files/amuleweb.initd | 13 +++++++------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/net-p2p/amule/files/amuled.initd b/net-p2p/amule/files/amuled.initd
index 9b83458..082e2ff 100644
--- a/net-p2p/amule/files/amuled.initd
+++ b/net-p2p/amule/files/amuled.initd
@@ -22,12 +22,13 @@ start() {
        fi
 
        ebegin "Starting aMule Daemon"
-       env HOME="${AMULEHOME}" start-stop-daemon --start \
+       start-stop-daemon --start \
                --quiet --background \
                --make-pidfile --pidfile /var/run/amuled.pid \
-               -c ${AMULEUSER} \
-               -x /usr/bin/amuled >${LOG}
-       
+               --env HOME="${AMULEHOME}" \
+               --user ${AMULEUSER} \
+               --exec /usr/bin/amuled >${LOG}
+
        sleep 2
        if ! pgrep -u ${AMULEUSER} amuled > /dev/null; then
                eerror "aMule daemon can't be started! Check logfile: ${LOG}"
@@ -37,7 +38,7 @@ start() {
 
 stop() {
        ebegin "Stopping aMule daemon -- please wait"
-       start-stop-daemon --oknodo --stop --pidfile /var/run/amuled.pid 
&>/dev/null
+       start-stop-daemon --stop --pidfile /var/run/amuled.pid 2>&1 >/dev/null
        eend $?
 }
 

diff --git a/net-p2p/amule/files/amuleweb.initd 
b/net-p2p/amule/files/amuleweb.initd
index 0484780..05e7d9f 100644
--- a/net-p2p/amule/files/amuleweb.initd
+++ b/net-p2p/amule/files/amuleweb.initd
@@ -26,12 +26,13 @@ start() {
        OPTIONS="-h ${AMULEHOST} -p ${AMULEPORT} -P ${AMULEPWD} -A ${WEBPWD} -t 
${TEMPLATE} -q"
 
        ebegin "Starting aMule WebServer"
-       env HOME="${AMULEHOME}" start-stop-daemon --start \
-               --quiet -b \
+       start-stop-daemon --start \
+               --quiet --background \
                --make-pidfile --pidfile /var/run/amuleweb.pid \
-               -c ${AMULEUSER} \
-               -x /usr/bin/amuleweb -- ${OPTIONS} &>${LOG}
-       
+               --env HOME="${AMULEHOME}" \
+               --user ${AMULEUSER} \
+               --exec /usr/bin/amuleweb -- ${OPTIONS} 2>&1 >${LOG}
+
        sleep 1
        if ! pgrep -u ${AMULEUSER} amuleweb > /dev/null; then
                eerror "aMule daemon can't be started! Check logfile: ${LOG}"
@@ -43,7 +44,7 @@ start() {
 
 stop() {
        ebegin "Stopping aMule WebServer"
-       start-stop-daemon --oknodo --stop --pidfile /var/run/amuleweb.pid 
&>/dev/null
+       start-stop-daemon --stop --pidfile /var/run/amuleweb.pid 2>&1 >/dev/null
        eend $?
 }
 

Reply via email to