9
0
27
技术1级
/etc/rc.d/rc0.d /etc/rc.d/rc1.d /etc/rc.d/rc2.d /etc/rc.d/rc3.d /etc/rc.d/rc4.d /etc/rc.d/rc5.d /etc/rc.d/rc6.d /etc/rc.d/init.d
代码: cd /etc/rc.d/init.d && ln -sf ../init.d/apache ../rc0.d/K28apache && ln -sf ../init.d/apache ../rc1.d/K28apache && ln -sf ../init.d/apache ../rc2.d/K28apache && ln -sf ../init.d/apache ../rc3.d/S32apache && ln -sf ../init.d/apache ../rc4.d/S32apache && ln -sf ../init.d/apache ../rc5.d/S32apache && ln -sf ../init.d/apache ../rc6.d/K28apache
代码: touch /etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local ln -sf /etc/rc.d/rc.local /etc/rc.d/rc1.d/S999rc.local && ln -sf /etc/rc.d/rc.local /etc/rc.d/rc2.d/S999rc.local && ln -sf /etc/rc.d/rc.local /etc/rc.d/rc3.d/S999rc.local && ln -sf /etc/rc.d/rc.local /etc/rc.d/rc4.d/S999rc.local && ln -sf /etc/rc.d/rc.local /etc/rc.d/rc5.d/S999rc.local && ln -sf /etc/rc.d/rc.local /etc/rc.d/rc6.d/S999rc.local
内容: #!/bin/bash # chkconfig: 35 95 1 # description: script to start/stop smsafe case $1 in start) sh /opt/startsms.sh ;; stop) sh /opt/stopsms.sh ;; *) echo "Usage: $0 (start|stop)" ;; esac 更改权限 # chmod 775 smsafe 加入自动启动 # chkconfig –add smsafe 查看自动启动设置 # chkconfig –list smsafe smsafe 0:off 1:off 2:off 3:on 4:off 5:on 6:off 以后可以用以下命令启动和停止脚本 # service smsafe start 启动 # service smsafe stop 停止 ======================================================================= jira 的启动主要依靠的是bin目录下的catalina.sh脚本,提供了如init脚本的start,stop等参数 #!/bin/bash # # chkconfig: 2345 85 15 # description: jira # processname: jira # source function library . /etc/init.d/functions
CATALINA_HOME="/var/www/jira" RETVAL=0 start() { echo -n $"Starting jira services: " . /var/www/jira/bin/catalina.sh start RETVAL=$? echo } stop() { echo -n $"Shutting down jira services: " . /var/www/jira/bin/catalina.sh stop RETVAL=$? echo } case "$1" in start) start ;; stop) stop ;; restart|reload) stop start ;; status) status jira RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL
使用道具 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.