commit:     9f65807a31384fa03c6e587402139aaaba0bc20a
Author:     Daniel Kuehn <lejonet <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 26 18:59:09 2017 +0000
Commit:     Daniel Kuehn <lejonet <AT> gentoo <DOT> org>
CommitDate: Mon Jun 26 19:00:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f65807a

sys-libs/musl-nscd: Fix initscript

Fix initscript to reference PIDFILE variable from conf.d config instead
of trying to do a subshell that is grepping strings of the binary

 sys-libs/musl-nscd/files/nscd.initd | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sys-libs/musl-nscd/files/nscd.initd 
b/sys-libs/musl-nscd/files/nscd.initd
index 929d1016df7..1bf83e7808a 100644
--- a/sys-libs/musl-nscd/files/nscd.initd
+++ b/sys-libs/musl-nscd/files/nscd.initd
@@ -43,20 +43,16 @@ start() {
                ;;
                esac
                done < /etc/nsswitch.conf`
-       local pidfile="$(strings /usr/sbin/nscd | grep nscd.pid)"
-       mkdir -p "$(dirname ${pidfile})"
-       save_options pidfile "${pidfile}"
+       mkdir -p "$(dirname ${PIDFILE:-/var/run/nscd/nscd.pid})"
        start-stop-daemon --start --quiet \
-               --exec /usr/sbin/nscd --pidfile "${pidfile}" \
+               --exec /usr/sbin/nscd --pidfile 
"${PIDFILE:-/var/run/nscd/nscd.pid}" \
                -- $secure
        eend $?
 }
 
 stop() {
-       local pidfile="$(get_options pidfile)"
-       [ -n "${pidfile}" ] && pidfile="--pidfile ${pidfile}"
        ebegin "Shutting down Name Service Cache Daemon"
-       start-stop-daemon --stop --quiet --exec /usr/sbin/nscd ${pidfile}
+       start-stop-daemon --stop --quiet --exec /usr/sbin/nscd --pidfile 
"${PIDFILE:-/var/run/nscd/nscd.pid}"
        eend $?
 }
 

Reply via email to