| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Mon Jan 22, 2007 8:31 pm Post subject: Script for automatically start |
|
|
| Someone have the script to run icecast server automatically as user after a server reboot? |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Mon Jan 22, 2007 11:41 pm Post subject: |
|
|
For helping, we need knwing on wich OS you run it. Most Linux distros with icecast already have a init script installed, you just have to activate it. Mac too has a service for icecast. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jan 23, 2007 12:43 am Post subject: |
|
|
Yes, sir excuse me if i dont tell u what os i have, i have on my server redhat enterprise server 3.
If it's possible tell me the correct steps to put it on the correct directory and get it load at starts automatically.
My thanks in advance! |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Tue Jan 23, 2007 1:01 am Post subject: |
|
|
If you installed from RPM package, init script is already installed in /etc/init.d.
Simply add icecast to the list of automatic starting scripts like:
| Code: |
chkconfig add --add icecast
|
If your /etc/init.d directory does not contain icecast starrting script, here is one which could fit your needs:
| Code: |
#!/bin/sh
#
# icecast This shell script takes care of starting and stopping
# the icecast multimedia streaming systen.
#
# chkconfig: - 85 15
# description: icecast is a multimedia streaming daemon. It is used to \
# relay and offer multimedia streaming content.
# processname: icecast
# pidfile: /var/run/icecast/icecast.pid
# config: /etc/icecast.xml
# Source function library.
. /etc/rc.d/init.d/functions
[ -x /usr/bin/icecast ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n $"Starting icecast streaming daemon: "
daemon "/usr/bin/icecast -b -c /etc/icecast.xml > /dev/null"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/icecast
;;
stop)
# Stop daemon.
echo -n $"Shutting down icecast streaming daemon: "
killproc icecast
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icecast
;;
status)
status icecast
RETVAL=$?
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n $"Reloading icecast: "
killproc icecast -HUP
RETVAL=$?
echo
;;
condrestart)
[ -f /var/lock/subsys/icecast ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload}"
RETVAL=1
;;
esac
exit $RETVAL
|
copy it in /etc/init.d directory, name it icecast. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jan 23, 2007 4:17 am Post subject: |
|
|
yeeeeees sir good job, but only one thing more, where i change the user or the path 4 the config file?
bcuz i have the icecastserver installed on
/home/user/icecastserver
/home/user/icecastserver/icecast.xml is the config file
lastly i need to in with my user and pass and load the service manually.
thanks in advance!
P.D. the program was not installed trough rpm file, is extracted by tar file. |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Tue Jan 23, 2007 7:55 am Post subject: |
|
|
| Quote: |
bcuz i have the icecastserver installed on
/home/user/icecastserver
/home/user/icecastserver/icecast.xml is the config file
|
As you installed in non standard places, you simply replace all paths in iniscript by your actual paths, eventually creation a var/log and /var/lock diretory in icecast home.
In icecast.xml, section
| Code: |
<security>
<chroot>0</chroot>
<changeowner>
<user>icecast</user>
<group>icecast</group>
</changeowner>
</security>
|
takes care of good ownership. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jan 23, 2007 3:16 pm Post subject: |
|
|
Ok, doc let me try!
by the way i think is chkconfig --add icecast instead chkconfig add --add icecast
 |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jan 23, 2007 3:43 pm Post subject: |
|
|
I've make all the changes on the script and i added it to the chkconfig
the configuration of file is this
| Code: |
#!/bin/sh
#
# icecast This shell script takes care of starting and stopping
# the icecast multimedia streaming systen.
#
# chkconfig: - 85 15
# description: icecast is a multimedia streaming daemon. It is used to \
# relay and offer multimedia streaming content.
# processname: icecast
# pidfile: /home/radiostream/icecastserver/icecast.pid
# config: /home/radiostream/icecastserver/icecast.xml
# Source function library.
. /etc/rc.d/init.d/functions
[ -x /home/radiostream/icecastserver ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n $"Starting icecast streaming daemon: "
daemon "/home/radiostream/icecastserver -b -c /home/radiostream/icecastserver/icecast.xml > /dev/null"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/icecast
;;
stop)
# Stop daemon.
echo -n $"Shutting down icecast streaming daemon: "
killproc icecast
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icecast
;;
status)
status icecast
RETVAL=$?
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n $"Reloading icecast: "
killproc icecast -HUP
RETVAL=$?
echo
;;
condrestart)
[ -f /var/lock/subsys/icecast ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload}"
RETVAL=1
;;
esac
exit $RETVAL
|
when i try 2 run the service as root show me this error
Starting icecast streaming daemon: execvp: Permission denied
[FAILED]
but if i log in the the account where the icecast is installed and run icecast it run an create a pid file... so i'll go to the root window and check the status of the icecast service it shows me that the service is running.
why i cant run as root?
P.D. Could i remove the directory of icecast that i've installed manually and install the rpm that is for fedora core 4 on redhat enterprise 3? |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Tue Jan 23, 2007 5:12 pm Post subject: |
|
|
O think you can safely remove hand installation and install either from a prebuilt rpm ou from a source rpm with rpmbuild to have an otimized rpm for your distro and arch. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jan 23, 2007 5:26 pm Post subject: |
|
|
| thanks a lot 4 your help man, so, i dont find a exactly package for my redhat distro what i can use for it? |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Wed Jan 24, 2007 9:06 am Post subject: |
|
|
If you cannot find a prebuilt package, grab a src.rpm package for defora 4 or 5 and build it using rpm-devel package. This will give a new binary package for your RHEL. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Jan 24, 2007 3:26 pm Post subject: |
|
|
Another thing, can i set up and install it from the root account?
i'm making all the installation on the root account, bcuz i need to add icecast as service.
i think that by that reason, when i try to run the service it tells me that is not possible run it as root
root@server [/icecast/ices]# ERROR: You should not run icecast2 as root
Use the changeowner directive in the config file
how could i make 4 run icecast as root |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Thu Jun 28, 2007 8:46 pm Post subject: Init.d script for SuSE Linux |
|
|
I have seen many requests and answers for RedHat Linux Init scripts. I am running SuSE 10 and created an init script for icecast and figured I would share just in case someone is looking for one.
| Code: |
#!/bin/bash
#
# Script to control Icecast in SuSE version 10
#
# Made by JP Plante (plantejr@gmail.com)
#
### BEGIN INIT INFO
# Provides: icecast
# Required-Start:
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Icecast Streaming Server
# Description: Icecast Streaming Server
### END INIT INFO
#
# Variables
#
ICE_BIN=/usr/local/bin/icecast
ICE_CONFIG=/etc/icecast.xml
ICE_USER=icecast
# Check for missing binaries
test -x $ICE_BIN || { echo "$ICE_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
test -r $ICE_CONFIG || { echo "$ICE_CONFIG not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Load the rc.status script for this service.
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting IceCast Server "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
startproc -u $ICE_USER $ICE_BIN -b -c $ICE_CONFIG
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down IceCast Server "
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
killproc -TERM $ICE_BIN
# Remember status and be verbose
rc_status -v
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
reload)
# If it supports signaling:
echo -n "Reload service bar "
killproc -HUP $ICE_BIN
#touch /var/run/icecast.pid
rc_status -v
## Otherwise if it does not support reload:
#rc_failed 3
#rc_status -v
;;
status)
echo -n "Checking for service IceCast "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
checkproc $ICE_BIN
# NOTE: rc_status knows that we called this init script with
# "status" option and adapts its messages accordingly.
rc_status -v
;;
*)
## If no parameters are given, print which are avaiable.
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
rc_exit
|
The variables you need to set are at the top of the script:
location of icecast binary, configuration file location, and username you are running icecast as. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Mon Jul 02, 2007 5:09 pm Post subject: looking to pay somewone to set up ice cast/ ogg script |
|
|
Hi, i will pay somewone to set up ogg for streaming to cell phones,
I work with Internet Radio Pros, we have ice cast and shout cast for streaming audio and video
email me tom@internetradiopros.com
Thanks |
|
| Back to top |
|
 |
|