Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133595 - [init.d] media-sound/peercast: Init script does not work
Summary: [init.d] media-sound/peercast: Init script does not work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 06:59 UTC by Tomoaki Yamasaki
Modified: 2009-05-22 00:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoaki Yamasaki 2006-05-17 06:59:55 UTC
The init script /etc/init.d/peercast does not work correctly,
because it calls the shell script wrapper /usr/sbin/peercast
which executes /usr/libexec/peercast in foreground.

I patched /etc/init.d/peercast as following.

--- peercast.orig       2006-05-17 22:32:08.000000000 +0900
+++ peercast    2006-05-17 22:28:39.000000000 +0900
@@ -12,7 +12,11 @@

        start-stop-daemon --start --chuid nobody \
                --pidfile /var/run/peercast.pid --background \
-               --exec /usr/sbin/peercast
+               --exec /usr/libexec/peercast --make-pidfile -- \
+               -P /usr/share/peercast \
+               -i /usr/share/peercast/peercast.ini \
+               -l /var/log/peercast.log
+

        eend $?
 }
@@ -20,7 +24,7 @@
 stop() {
        ebegin "Stopping peercast"

-       start-stop-daemon --stop --retry 20 --pidfile /var/run/peercast.pid
+       start-stop-daemon --stop --pidfile /var/run/peercast.pid

        eend $?
 }


Furthermore, I have to do
chmod nobody:nobody /usr/share/peercast/peercast.ini
in order to run peercast as nobody.
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2006-05-17 07:43:11 UTC
Please attach as plain text, do not inline.
Comment 2 kaouete 2006-06-02 13:24:14 UTC
Hi,

i dont know if this patch is good but isnt it better to modify the wrapper to not returns after running peercast ?
Comment 3 Pete Flaherty 2006-12-01 20:04:01 UTC
Looks like the init script executes peercast as nobody. The peercast.ini file can not be written to the /usr/shar/usr/share/peercaste/peercast directory.

Either
A) change the directory perms on /usr/share/peercast to allow nobody to write to this dir  --- or ---

B) Create peercast user and change script to use that user, also change the /usr/share/peercast dierctory to allow that user to write (peercast.ini)

C) specify ini file on peercast command line (default is $HOME/peercast) 
   - or create user and Home dir for peercast

D) Specify Peercast parameters -i <inifile> -l <logfile>
   ini file could be /etc/peercast/
   log file could be /var/log/peercast.log
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2009-05-22 00:55:45 UTC
should be fixed with -r2, thanks for reporting