~alpine/devel

main/mpd: fix pidfile, change to system user v1 PROPOSED

Peter Bui: 1
 main/mpd: fix pidfile, change to system user

 2 files changed, 5 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/devel/patches/939/mbox | git am -3
Learn more about email & git

[alpine-devel] [PATCH] main/mpd: fix pidfile, change to system user Export this patch

1. Fix handling of pidfile (parsing and creation of directory on start)

2. Make mpd a system user (similar to minidlna)
---
 main/mpd/mpd.initd       | 7 ++++---
 main/mpd/mpd.pre-install | 3 +--
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/main/mpd/mpd.initd b/main/mpd/mpd.initd
index f18708b..a026d72 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 $?
}

diff --git a/main/mpd/mpd.pre-install b/main/mpd/mpd.pre-install
index cb1b8d3..70bddb2 100644
--- a/main/mpd/mpd.pre-install
+++ b/main/mpd/mpd.pre-install
@@ -1,4 +1,3 @@
#!/bin/sh

adduser -h /var/lib/mpd -s /sbin/nologin -G audio -D mpd 2>/dev/null || true

adduser -S -h /var/lib/mpd -s /sbin/nologin -G audio -D mpd 2>/dev/null || true
-- 
2.3.2



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---