In addition to my previous post, I've created a daemon script, so Aware can start on boot
conditions: tested on Linux CentOS 6.2 - Aware IM installed on /usr/aware - change this path were needed below
1. create a new file /etc/init.d/aware with
#!/bin/sh
#chkconfig: 2345 20 80
#description: Starts and stops the Aware IM daemon (includes Aware IM server, JBoss and Tomcat)
#processname: aware
aware=/usr/aware
startup=$aware/bin/startAwareIMNoGUI.sh
shutdown=$aware/bin/stopAwareIMNoGUI.sh
start() {
echo -n $"Starting Aware IM service: "/bin/su - -s /bin/sh root -c "cd /usr/aware/bin; $startup"
echo $?
}
stop() {
echo -n $"Stopping Aware IM service: "/bin/su - -s /bin/sh root -c "cd /usr/aware/bin; $shutdown"
echo $?
}
restart() {
stop
start
}
status() {
ps aux | egrep "com.bas.basserver.bsmanager.NonGUIServerMonitorCallback|org.jboss.Main|org.apache.catalina.startup.Bootstrap" | grep -v "com.bas.basserver.bsmanager.NonGUIServerMonitorCallback|org.jboss.Main|org.apache.catalina.startup.Bootstrap"
}
# Handle the different input options
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
2. Set this aware daemon script as executable
chmod +x /etc/init.d/aware
3. Testing the aware daemon script
./aware start
./aware stop
./aware status
4. Add aware as service for all runlevels
chkconfig --add aware
chkconfig aware on
5. From now on Aware will start up on booting and you can use these commands
service aware start
service aware status
service aware stop