From 71a23a703db0e4f33b0b42664b0fbc6a0e6f9c1d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 18 Oct 2013 17:40:11 +0200 Subject: disable running mpd as non-root, we now use a data directory which is automatically remounted rw when database is written. it is not possible to remount a filesystem as user read-write, without any sudo or sbit hacks. --- package/mpd/Makefile | 4 ++-- package/mpd/files/mpd.conf | 6 +++--- package/mpd/files/mpd.init | 14 -------------- package/mpd/files/mpd.postinst | 3 --- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/package/mpd/Makefile b/package/mpd/Makefile index 2d97f9f0b..5b211bb30 100644 --- a/package/mpd/Makefile +++ b/package/mpd/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= mpd PKG_VERSION:= 0.17.6 -PKG_RELEASE:= 2 +PKG_RELEASE:= 3 PKG_MD5SUM:= d0da6a6a1d9cf1e8710b6082f6ef7849 PKG_DESCR:= A music player daemon PKG_SECTION:= multimedia @@ -208,7 +208,7 @@ CONFIGURE_ARGS+= --disable-lsr endif mpd-install: - ${INSTALL_DIR} ${IDIR_MPD}/usr/bin ${IDIR_MPD}/etc + ${INSTALL_DIR} ${IDIR_MPD}/usr/bin ${IDIR_MPD}/etc/mpd/playlists ${INSTALL_BIN} ${WRKINST}/usr/bin/mpd ${IDIR_MPD}/usr/bin ${INSTALL_DATA} ./files/mpd.conf ${IDIR_MPD}/etc/mpd.conf diff --git a/package/mpd/files/mpd.conf b/package/mpd/files/mpd.conf index cb5bc4c90..d022a3069 100644 --- a/package/mpd/files/mpd.conf +++ b/package/mpd/files/mpd.conf @@ -1,11 +1,11 @@ # An example configuration file for MPD -user "mpd" +user "root" auto_update "no" music_directory "/music" playlist_directory "/etc/mpd/playlists" state_file "/etc/mpd/state" -db_file "/etc/mpd/database" -pid_file "/var/run/mpd/mpd.pid" +db_file "/data/mpd/database" +pid_file "/var/run/mpd.pid" log_file "syslog" filesystem_charset "UTF-8" id3v1_encoding "UTF-8" diff --git a/package/mpd/files/mpd.init b/package/mpd/files/mpd.init index 5c474eb13..2e39cf82e 100644 --- a/package/mpd/files/mpd.init +++ b/package/mpd/files/mpd.init @@ -11,20 +11,6 @@ autostart) exec sh $0 start ;; start) - # check group membership - id mpd | grep audio >/dev/null 2>&1 - if [ $? -ne 0 ];then - echo "mpd user must be in group audio." - exit 1 - fi - if [ ! -d /etc/mpd/playlists ];then - mkdir -p /etc/mpd/playlists - chown -R mpd:mpd /etc/mpd - fi - if [ ! -d /var/run/mpd ];then - mkdir -p /var/run/mpd - chown -R mpd:mpd /var/run/mpd - fi mpd ;; stop) diff --git a/package/mpd/files/mpd.postinst b/package/mpd/files/mpd.postinst index a635ccae7..9eb855abe 100644 --- a/package/mpd/files/mpd.postinst +++ b/package/mpd/files/mpd.postinst @@ -1,6 +1,3 @@ #!/bin/sh . $IPKG_INSTROOT/etc/functions.sh -gid=$(get_next_gid) -add_group mpd $gid -add_user mpd $(get_next_uid) $gid /music add_rcconf mpd -- cgit v1.2.3