Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 165331 - [init.d] media-sound/shoutcast-server-bin: Fix to display better
Summary: [init.d] media-sound/shoutcast-server-bin: Fix to display better
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-04 20:34 UTC by Jordan W.
Modified: 2009-07-22 15:38 UTC (History)
1 user (show)

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 Jordan W. 2007-02-04 20:34:38 UTC
Without the fix, when you start the server from a command line, you do not get a prompt back until you press enter.  Also, you do not get a [ ok ] notification.  This small one-line patch will fix both of these issues.  Standard diff (-Naru) is included in the Additional Information.


Reproducible: Always

Steps to Reproduce:
1. open a shell that can control the start/stop status of shoutcast
2. /etc/init.d/shoutcast stop #if it is running
3. /etc/init.d/shoutcast start

Actual Results:  
Does not display [ ok ] and does not return back to the prompt.

root /etc # /etc/init.d/shoutcast start
 * Starting Shoutcast Server ...
*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2004 Nullsoft, Inc.  All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************       [ 


Expected Results:  
Should display [ ok ] and return back to the prompt.

root /etc # /etc/init.d/shoutcast start
 * Starting Shoutcast Server ...
*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2004 Nullsoft, Inc.  All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************       [ ok ]
root /etc/init.d # echo yay


--- old/shoutcast       2007-02-04 13:31:39.000000000 -0700
+++ shoutcast   2007-02-04 13:30:03.000000000 -0700
@@ -21,6 +21,7 @@

         ebegin "Starting Shoutcast Server"
         start-stop-daemon --start --quiet --exec /opt/shoutcast/sc_serv /etc/shoutcast/sc_serv.conf &
+        sleep 0.1
         eend $?
 }
Comment 1 boris64 2007-09-14 22:42:11 UTC
There is imho another (serious?) issue.
Why the heck is sc_trans_linux+sc_serv running as user root?
Is there any good reason, why a closed source program 
should run that way on my server?
Comment 2 boris64 2007-09-14 23:03:26 UTC
Well, you can easily help yourself.

Just add --chuid ${you_favorite_user_here} to that start() function in 
/etc/init.d/shoutcast*, after you created that unix user, of course.
Don't forget to chmod your shoutcast/shoutcast_trans config file(s).

--------- snip here -----------
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

shoucast_user=${your_favorite_user_here}
...

start() {
        checkconfig || return 1

        ebegin "Starting Shoutcast Trans"
        start-stop-daemon --start --quiet \
            --chuid ${shoutcast_user} -m --pidfile /var/run/shoutcast_trans.pid \
            --exec /opt/shoutcast/sc_trans_linux /etc/shoutcast/sc_trans.conf >/dev/null &
        sleep 0.1
        eend $?
}
...
--------- snip here -----------

I hope someone could change this in future ebuilds, again,
it's no good to run a (networking!) daemon as root per default.
Comment 3 boris64 2007-09-14 23:05:01 UTC
Hm, It should be "shoutcast_user", of course.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2009-07-21 23:02:40 UTC
(In reply to comment #1)
> There is imho another (serious?) issue.
> Why the heck is sc_trans_linux+sc_serv running as user root?
> Is there any good reason, why a closed source program 
> should run that way on my server?
> 

Indeed. I'll try to get this fixed tomorrow, can't have binary junk running as root...
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2009-07-22 15:38:33 UTC
+  22 Jul 2009; Samuli Suominen <ssuominen@gentoo.org>
+  +files/1.9.8-sc_serv.conf.patch, +shoutcast-server-bin-1.9.8-r1.ebuild,
+  +files/shoutcast.2:
+  Don't run as root wrt #165331.

Should also fix the minor "Display" bug this bug was original for; please try.