1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
vim /etc/init.d/jetty
#内容如下:
#!/bin/bash
# chkconfig: 35 95 1
# description: script to start/stop jetty case $1 in start)
sh /opt/startjetty.sh stop)
sh /opt/stopjetty.sh *)
echo "Usage: $0 (start|stop)" esac
#更改权限
chmod 775 jetty
# 加入自动启动
chkconfig –add jetty
#查看自动启动设置
chkconfig –list jetty
jetty 0:off 1:off 2:off 3:on 4:off 5:on 6:off
以后可以用以下命令启动和停止脚本
1
2
service jetty start #启动
service jettystop #停止
在/etc/init.d/下创建jetty文件内容:
vim /etc/init.d/jetty#内容如下:
#!/bin/bash
# chkconfig: 35 95 1
# description: script to start/stop jetty case $1 in start)
sh /opt/startjetty.sh stop)
sh /opt/stopjetty.sh *)
echo "Usage: $0 (start|stop)" esac
#更改权限
chmod 775 jetty
# 加入自动启动
chkconfig –add jetty
#查看自动启动设置
chkconfig –list jetty
jetty 0:off 1:off 2:off 3:on 4:off 5:on 6:off
以后可以用以下命令启动和停止脚本
service jetty start #启动service jettystop #停止
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)