aboutsummaryrefslogtreecommitdiffstats
path: root/main/mpd
diff options
context:
space:
mode:
authorPeter Bui <pnutzh4x0r@gmail.com>2015-03-14 12:41:38 -0500
committerNatanael Copa <ncopa@alpinelinux.org>2015-03-16 15:14:46 +0000
commitc3b5cb847de1ee5f68f4e031e09b8978d401aebf (patch)
treecc8b42efffe9c313a442d51409e04324ec342801 /main/mpd
parentbc0fb401440b07d8af23dcfadc2648e9bba7c65d (diff)
downloadaports-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')
-rw-r--r--main/mpd/APKBUILD6
-rw-r--r--main/mpd/mpd.initd7
-rw-r--r--main/mpd/mpd.pre-install3
3 files changed, 8 insertions, 8 deletions
diff --git a/main/mpd/APKBUILD b/main/mpd/APKBUILD
index 06f2023363..83860c33bf 100644
--- a/main/mpd/APKBUILD
+++ b/main/mpd/APKBUILD
@@ -76,13 +76,13 @@ package() {
}
md5sums="1a66f7b4db1fa61b87e04e666c94088d mpd-0.19.9.tar.xz
a84cce5fdb848c7d282e38698432df51 underlinking.patch
-2ccbb38edc6dff5b5740760837f3005a mpd.initd
+ce1677865f9d92d29174939f85eeaa17 mpd.initd
dbd301041953a5cf9c2b9de8f23eb6bb mpd.confd"
sha256sums="47851423053cd38cfad65be5985b41b7cd5bdbe8d0d13378e11748a28b19f26f mpd-0.19.9.tar.xz
b3a0499cbd3f759612ad94fce00588d97e5e82af0b2bcc560869eb977067a426 underlinking.patch
-5f9d066a044d6cb1a9990a59f63dd4a07e78e5179ad90b22374db09b7c62cafd mpd.initd
+b0c20c1d64c85fb8e6b6558496f07207720c340847b2e98d9f733d24bad6e964 mpd.initd
32c072f77c23c2cc2dd7c93b65b73015e0587caaf2740856132af32cee623206 mpd.confd"
sha512sums="7d74254e009008ed142ce0b69e75fe6f255ec2c814b246f570225af715ec5c3a5c75276f4720bc1ad351d48be5b20f9797843c03aae9380a6062796539507bf4 mpd-0.19.9.tar.xz
d6a98c5f60a60ddd5fa94b25864f800a6a6fb6ffe114793293d0ccc71bb5d1cdb847ca39fde4128446b55a38be85634106d5d6f2c77ee450f33631b30140781a underlinking.patch
-80ad8c2fa59c1bd52d3db50e46208f64d027fbecd753b6d688a1095627c8a8b84bd337a682a192bde0b2155edc0eafbe59ed47bae3b3c26c4b1c0a8090d77f6d mpd.initd
+f174ef1e5c58487df29816c926ef533ff4073f475c39a109f99c603a6fa0bc691818e9e952860e8f972bdde0e7e638a524c4e7263b17e2d7ab9b0d3dabf73e42 mpd.initd
41b2467f5b03f5c4dd7003cd5f56f6cfc1f67af7a9aa2538d70360f839625222bdd0c4b04c33e8cd52eeecfc354da3ca22f5aaab8aee357a5774aaf3503594e7 mpd.confd"
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 $?
}
-
diff --git a/main/mpd/mpd.pre-install b/main/mpd/mpd.pre-install
index cb1b8d39df..70bddb21da 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