sys-libs/musl-nscd: Fix initscript
authorDaniel Kuehn <lejonet@gentoo.org>
Mon, 26 Jun 2017 18:59:09 +0000 (20:59 +0200)
committerDaniel Kuehn <lejonet@gentoo.org>
Mon, 26 Jun 2017 19:00:53 +0000 (21:00 +0200)
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

index 929d1016df7953a84339096dfbbafe191c3b1889..1bf83e7808af2ad1083dcaa1d113a91949dea684 100644 (file)
@@ -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 $?
 }