Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Icecast on linux

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
LectricMan
Guest





PostPosted: Fri Jun 24, 2005 9:18 pm    Post subject: Icecast on linux Reply with quote

I am looking for help on how to get Icecast to start on a linux server without having to log in and start it. The program gives me an error about not being able to run as root if I create it as a service and have it start with the init.d configs.

Cool
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jun 24, 2005 10:15 pm    Post subject: Re: Icecast on linux Reply with quote

LectricMan wrote:
I am looking for help on how to get Icecast to start on a linux server without having to log in and start it. The program gives me an error about not being able to run as root if I create it as a service and have it start with the init.d configs.


There is a test specifically for people who mistakingly try to run as root. You can either use su to start icecast as a non-root user or you can use the changeowner tag in the xml file if you want to start it as root and then drop root privileges.

karl
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Sat Jul 02, 2005 12:54 am    Post subject: try screen Reply with quote

like karl said: thou shall not run programs as root if you dont absolutely need it

with that said, there are a few startup scripts that you could modify out there.. i modded one for shoutcast, but it is ugly...

what i use now works ok:

1. login as non-root user (ssh, or whatever)
2. use "screen" to make a detachable terminal - one that is not attached to a ssh or console session, so it will continue to run until the a. program dies, b. you kill it, c. the computer reboots

try:
Code:
$ screen -S icecast

this will open up a detachable terminal.
now run icecast:
Code:
$ /path/to/icecast -c /path/to/configfile

then use CTRL-A then CTRL-D to detach from the session (it will keep running in the background)
you can resume a screen session by typing
Code:
screen -r

if you have more than one (thats where the -S option comes in handy, cause you can "title" a session for easy reference), then use "
Code:
screen -r pid
" where pid is the process id number, or the session name (i.e., icecast)


you could alternatively use "nohup", but I prefer screen

I will dig around, i think i might have a decent startup script for redhat/fedora
Back to top
Anonymous
Guest





PostPosted: Sat Jul 02, 2005 12:59 am    Post subject: Reply with quote

--snip snip--- (hey admin, is there a way to do strikeout with BBcode, since html is disabled, and I'd rather strikeout than delete poor or "deprecated" information)??

upon further testing and inspection, su with screen in the startup script isnt very elegant and doesnt work well

instead a more elegant solution? (in /etc/rc.d/rc.local or whatever your startup script it):
Code:

su -l username -c '/path/to/icecast -c /path/to/configfile &'

ps. tested this in redhat, but should work fine on other distros

thanks jason,
i will post it as a tip


Last edited by Anonymous on Sat Jul 02, 2005 11:25 pm; edited 1 time in total
Back to top
Anonymous
Guest





PostPosted: Sat Jul 02, 2005 10:55 am    Post subject: Reply with quote

jens wrote:
to simplify that:
Code:
su username -c "screen -d -S icecast '/path/to/icecast -c /path/to/configfile'"

where username is a non-root user
note: -d option for screen auto-detaches the screen'd command

put this in /etc/rc.d/rc.local or whatever your distro uses for startup script

ps. i haven't checked this, so i cant guarantee it will work, but it should with no more than some light tweaking
Check into that, make sure it works. Provide a little more information for making it into an auto-start script, and repost it as it's own thread with a subject such as "[TIP] Automatically starting Icecast (linux)"

Smile.

Things like that would prove most useful to others down the road.

If you don't have access to / have never used Gentoo, let me know and I'll whip up and provide you the information to add in.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber