View previous topic :: View next topic |
Author |
Message |
LectricMan Guest
|
Posted: Fri Jun 24, 2005 9:18 pm Post subject: Icecast on linux |
|
|
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.
|
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Jun 24, 2005 10:15 pm Post subject: Re: Icecast on linux |
|
|
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 |
|
|
Anonymous Guest
|
Posted: Sat Jul 02, 2005 12:54 am Post subject: try screen |
|
|
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
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 "
" 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
|
Posted: Sat Jul 02, 2005 12:59 am Post subject: |
|
|
--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
|
Posted: Sat Jul 02, 2005 10:55 am Post subject: |
|
|
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)"
.
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 |
|
|
|
|
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
|