Site moved permanently to http://www.noisewaterphd.com
Go there now, update your bookmarks. Thanks for reading!
Go there now, update your bookmarks. Thanks for reading!
software engineering blog
#!/bin/sh
#
# Dr. Kenneth Noisewater 05/07/2010
#
# I wrote this for CentOS, but it should work fine in RedHat and related distros
#
# chkconfig: 2345 85 85
# description: Red5 Media Server
# processname: red5
# We need to initialize a few things
PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Make sure the sucka using this actually has permission, not that we would be able to open some essential ports if the weren't anyway
#[ "`id -u`" = 0 ] || exit 1
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
# And here is where the magic happens...
start() {
echo -n "Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
}
stop() {
echo -n "Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[$RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
}
restart() {
stop
sleep 10 # give it a few moments to shut down
start
}
# Check to see what the user is telling us to do, and if we know how to do it
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
restart)
restart
;;
*)
echo "Usage $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
cd /usr/src svn checkout http://red5.googlecode.com/svn/java/server/tags/0_9rc1/ red5 mv red5 /usr/local/ cd /usr/local/red5 ant prepare ant dist
Once the compile is finished you should see:
cp -r dist/conf . ./red5.sh
STEP 3
vi /etc/init.d/red5
Copy this text in:
#!/bin/sh
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5
PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
case “$1″ in
start)
echo -n $”Starting $PROG: ”
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $”$PROG startup” || failure $”$PROG startup”
echo
;;
stop)
echo -n $”Shutting down $PROG: ”
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $”Usage: $0 {start|stop|restart|status}”
RETVAL=1
esac
exit $RETVALNow start the service
/etc/init.d/red5 start (or, my preference) service red5 start
/etc/init.d/red5 status (or, my preference) service red5 status
red5 (pid XXXXX) is running…
STEP 4
cd /usr/src wget http://mirror.cc.columbia.edu/pub/software/apache//ant/binaries/apache-ant-1.8.1-bin.tar.gz tar -zxvf apache-ant-1.8.1-bin.tar.gz
mv apache-ant-1.8.1 /usr/local/ant
export ANT_HOME=/usr/local/ant
export PATH=$PATH:/usr/local/ant/bin
You should do the same thing in /etc/bashrc so that you don't have to keep exporting everything everytime you login:
echo ‘export ANT_HOME=/usr/local/ant’ >> /etc/bashrc echo ‘export PATH=$PATH:/usr/local/ant/bin’ >> /etc/bashrcThat should be all...
$ gcc -m32 -o output32 yourfile.c$ gcc -m64 -o output64 yourfile.c