sci-misc/boinc: Migrated boinc.init to use start-stop-daemon
authorSven Eden <yamakuzure@gmx.net>
Wed, 13 Apr 2016 12:09:53 +0000 (14:09 +0200)
committerPatrice Clement <monsieurp@gentoo.org>
Tue, 26 Apr 2016 07:07:58 +0000 (07:07 +0000)
The boinc init script can no longer start, attach or stop the boinc
manager if openrc-0.20 and newer is used, because openrc no longer
passes $SHELL to init scripts.

To solve the issue the init script has been migrated to use
start-stop-daemon instead of using 'su' directly.

This change should have no impact for users of previous openrc
versions.

Gentoo-Bug: https://bugs.gentoo.org/574260
Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/1244

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
sci-misc/boinc/files/boinc.init

index a350e3efd7c4583bd5d6b8c0f38a6d0aeb184384..6ed90413aa009577b9cc09aaa28ffc1f15ba65a2 100644 (file)
@@ -1,4 +1,7 @@
 #!/sbin/runscript
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
 
 extra_started_commands="attach"
 
@@ -59,7 +62,7 @@ start() {
        fi
 
        ebegin "Starting ${SVCNAME}"
-       su -m ${USER} -c "nice -n ${NICELEVEL} \"${BOINCBIN}\" ${ARGS} --daemon --dir \"${RUNTIMEDIR}\" --redirectio"
+       start-stop-daemon -S -N ${NICELEVEL} -u ${USER} -q -x "${BOINCBIN}" -- ${ARGS} --daemon --dir "${RUNTIMEDIR}" --redirectio
        eend $?
 }
 
@@ -81,7 +84,7 @@ attach() {
        password=$(cat "${RUNTIMEDIR}/gui_rpc_auth.cfg")
 
        ebegin "${SVCNAME}: Attaching to project"
-       su -m ${USER} -c "boinccmd --passwd \"${password}\" --project_attach ${url} ${key}"
+       start-stop-daemon -u ${USER} -q -x boinccmd -- --passwd "${password}" --project_attach ${url} ${key}
        eend $?
 
        unset password url key
@@ -96,7 +99,7 @@ stop() {
        password=$(cat "${RUNTIMEDIR}/gui_rpc_auth.cfg")
 
        ebegin "Stopping ${SVCNAME}"
-       su -m ${USER} -c "boinccmd --passwd \"${password}\" --quit"
+       start-stop-daemon -u ${USER} -q -x boinccmd -- --passwd "${password}" --quit
        eend $?
 
        unset password