Browse Source

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.

Waldemar Brodkorb 11 years ago
parent
commit
71a23a703d
4 changed files with 5 additions and 22 deletions
  1. 2 2
      package/mpd/Makefile
  2. 3 3
      package/mpd/files/mpd.conf
  3. 0 14
      package/mpd/files/mpd.init
  4. 0 3
      package/mpd/files/mpd.postinst

+ 2 - 2
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
 

+ 3 - 3
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"

+ 0 - 14
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)

+ 0 - 3
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