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
This commit is contained in:
Daniel Kuehn
2017-06-26 20:59:09 +02:00
parent 82e039bc9c
commit 9f65807a31

View 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 $?
}