#!/bin/sh
#chkconfig: 35 20 80 分别代表运行级别,启动优先权,关闭优先权,此行代码必须
#description: wgcloud agent
/bin/echo $(/bin/date +%F_%T) >> /tmp/agent.log
/usr/local/wgcloud-v3.3.3/agent/start.sh
/usr/local/wgcloud-v3.3.3/agent/start.sh
为自己的agent实际路径chmod +x startAgent.sh
./startAgent.sh
[root@localhost ~]# cd /etc/rc.d/init.d
[root@localhost ~]# chkconfig --add startAgent.sh
[root@localhost ~]# chkconfig startAgent.sh on
# 关闭开机启动
[root@localhost ~]# chkconfig startAgent.sh off
# 从chkconfig管理中删除startAgent.sh
[root@localhost ~]# chkconfig --del startAgent.sh
# 查看chkconfig管理
[root@localhost ~]# chkconfig --list startAgent.sh