cd /etc/init.d/
vi jws
按i编辑模式,粘贴下面内容
#!/bin/bash
#chkconfig: 2345 80 05
#description:jws
#
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo "Jexus Start.."
/usr/jexus/jws start
;;
stop)
echo "Jexus Stop.."
/usr/jexus/jws stop
;;
restart)
echo "Jexus Restart"
/usr/jexus/jws restart
;;
status)
/usr/jexus/jws status
;;
*)
exit 1
;;
esac
exit $RETVAL
按ESC后,输入:wq保存文件
把这个脚本作为“服务”加入
chmod 766 jws
chkconfig --add jws