httpd服务脚本
[root@zabbix init.d]# cat httpd
#/bin/bash
# chkconfig: 2345 20 80
# description:
case $1 in
'start')
/usr/local/apache/bin/apachectl start
;;
'stop')
/usr/local/apache/bin/apachectl stop
;;
'restart')
/usr/local/apache/bin/apachectl restart
;;
*)
echo "Usage:service httpd start|stop|restart"
;;
esac
zabbix_server启动脚本
[root@zabbix init.d]# cat zabbix_server
#/bin/bash
# chkconfig: 2345 21 79
# description:
function stop(){
ps -ef|grep -Ev "grep|$0"|g