Gentoo Archives: gentoo-commits

From: "Christoph Mende (angelos)" <angelos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/mpd/files: mpd.conf.patch mpd.init
Date: Fri, 10 Sep 2010 07:55:11
Message-Id: 20100910075507.875F02003C@flycatcher.gentoo.org
1 angelos 10/09/10 07:55:07
2
3 Added: mpd.conf.patch mpd.init
4 Log:
5 Tweak default pid/log paths (bug #331723), fix init script dependencies (bug #331725), reduce init script noise (bug #331727) and convert init script to s-s-d (bug #331729)
6 (Portage version: 2.1.8.3/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 media-sound/mpd/files/mpd.conf.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/mpd/files/mpd.conf.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/mpd/files/mpd.conf.patch?rev=1.1&content-type=text/plain
13
14 Index: mpd.conf.patch
15 ===================================================================
16 diff --git a/doc/mpdconf.example b/doc/mpdconf.example
17 index 11b14bd..6b24322 100644
18 --- a/doc/mpdconf.example
19 +++ b/doc/mpdconf.example
20 @@ -10,14 +10,14 @@
21 # be disabled and audio files will only be accepted over ipc socket (using
22 # file:// protocol) or streaming files over an accepted protocol.
23 #
24 -#music_directory "~/music"
25 +music_directory "/var/lib/mpd/music"
26 #
27 # This setting sets the MPD internal playlist directory. The purpose of this
28 # directory is storage for playlists created by MPD. The server will use
29 # playlist files not created by the server but only if they are in the MPD
30 # format. This setting defaults to playlist saving being disabled.
31 #
32 -#playlist_directory "~/.mpd/playlists"
33 +playlist_directory "/var/lib/mpd/playlists"
34 #
35 # This setting sets the location of the MPD database. This file is used to
36 # load the database at server start up and store the database while the
37 @@ -25,7 +25,7 @@
38 # MPD to accept files over ipc socket (using file:// protocol) or streaming
39 # files over an accepted protocol.
40 #
41 -#db_file "~/.mpd/database"
42 +db_file "/var/lib/mpd/database"
43 #
44 # These settings are the locations for the daemon log files for the daemon.
45 # These logs are great for troubleshooting, depending on your log_level
46 @@ -34,7 +34,7 @@
47 # The special value "syslog" makes MPD use the local syslog daemon. This
48 # setting defaults to logging to syslog, otherwise logging is disabled.
49 #
50 -#log_file "~/.mpd/log"
51 +log_file "/var/log/mpd.log"
52 #
53 # This setting sets the location of the file which stores the process ID
54 # for use of mpd --kill and some init scripts. This setting is disabled by
55 @@ -47,7 +47,7 @@
56 # it was brought down. This setting is disabled by default and the server
57 # state will be reset on server start up.
58 #
59 -#state_file "~/.mpd/state"
60 +state_file "/var/lib/mpd/state"
61 #
62 ###############################################################################
63
64 @@ -59,17 +59,17 @@
65 # initialization. This setting is disabled by default and MPD is run as the
66 # current user.
67 #
68 -#user "nobody"
69 +user "mpd"
70 #
71 # This setting sets the address for the daemon to listen on. Careful attention
72 # should be paid if this is assigned to anything other then the default, any.
73 # This setting can deny access to control of the daemon.
74 #
75 # For network
76 -#bind_to_address "any"
77 +bind_to_address "localhost"
78 #
79 # And for Unix Socket
80 -#bind_to_address "~/.mpd/socket"
81 +bind_to_address "/var/lib/mpd/socket"
82 #
83 # This setting is the TCP port that is desired for the daemon to get assigned
84 # to.
85
86
87
88 1.1 media-sound/mpd/files/mpd.init
89
90 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/mpd/files/mpd.init?rev=1.1&view=markup
91 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/mpd/files/mpd.init?rev=1.1&content-type=text/plain
92
93 Index: mpd.init
94 ===================================================================
95 #!/sbin/runscript
96 # Copyright 1999-2010 Gentoo Foundation
97 # Distributed under the terms of the GNU General Public License v2
98 # $Header: /var/cvsroot/gentoo-x86/media-sound/mpd/files/mpd.init,v 1.1 2010/09/10 07:55:07 angelos Exp $
99
100 depend() {
101 need localmount
102 use net netmount nfsmount alsa esound pulseaudio
103 }
104
105 checkconfig() {
106 if ! [ -f /etc/mpd.conf ]; then
107 eerror "Configuration file /etc/mpd.conf does not exist."
108 return 1
109 fi
110
111 return 0
112 }
113
114 start() {
115 checkconfig || return 1
116
117 ebegin "Starting Music Player Daemon"
118 start-stop-daemon --start --quiet --background --exec /usr/bin/mpd --pidfile /var/run/mpd.pid --make-pidfile -- --no-daemon /etc/mpd.conf 2>/dev/null
119 eend $?
120 }
121
122 stop() {
123 ebegin "Stopping Music Player Daemon"
124 start-stop-daemon --stop --exec /usr/bin/mpd --pidfile /var/run/mpd.pid
125 eend $?
126 }