diff options
author | Peter Bui <pnutzh4x0r@gmail.com> | 2015-03-14 12:41:38 -0500 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-03-16 15:14:46 +0000 |
commit | c3b5cb847de1ee5f68f4e031e09b8978d401aebf (patch) | |
tree | cc8b42efffe9c313a442d51409e04324ec342801 /main/mpd/mpd.initd | |
parent | bc0fb401440b07d8af23dcfadc2648e9bba7c65d (diff) | |
download | aports-c3b5cb847de1ee5f68f4e031e09b8978d401aebf.tar.bz2 aports-c3b5cb847de1ee5f68f4e031e09b8978d401aebf.tar.xz |
main/mpd: fix pidfile, change to system user
1. Fix handling of pidfile (parsing and creation of directory on start)
2. Make mpd a system user (similar to minidlna)
Diffstat (limited to 'main/mpd/mpd.initd')
-rw-r--r-- | main/mpd/mpd.initd | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/mpd/mpd.initd b/main/mpd/mpd.initd index f18708baba..a026d72ec8 100644 --- a/main/mpd/mpd.initd +++ b/main/mpd/mpd.initd @@ -19,16 +19,18 @@ checkconfig() { } get_pidfile() { - pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF") + pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF" | sed 's/"//') pidfile=${pidfile:-/var/run/mpd/$NAME.pid} } start() { checkconfig || return 1 get_pidfile + checkpath --owner ${M_USER:-mpd}:${M_GROUP:-audio} \ + --directory ${pidfile%/*} + ebegin "Starting ${NAME}" start-stop-daemon --start --quiet \ - --pidfile $pidfile\ --exec ${DAEMON} -- ${MPD_OPTS} eend $? } @@ -39,4 +41,3 @@ stop() { mpd --kill eend $? } - |