linux centos7开机自动启动程序实现

1存放脚本位置 /etc/init.d/ServerManagerCLI.sh 该脚本是自己新建的内容参看2
增加执行权限 chmod +x /etc/rc.d/init.d/ServerManagerCLI.sh
cd /etc/init.d/
chkconfig --add ServerManagerCLI.sh
chkconfig ServerManagerCLI.sh on
chkconfig --list
2脚本内容
#!/bin/sh
#chkconfig: 2345 80 90
#descriptiong:auto ServerManagerCLI
#进入到指定目录执行
cd /goldendsp/GoldenDSP_Linux_x64_3.0.10516.0
#要实现的启动命令
./ServerManagerCLI -o
3 reboot 进行测试
ps -aux 查看是否有本次随机启动的进程
进程太多使用ps -aux|grep xxx --xxx为进程名称

猜你喜欢

转载自www.cnblogs.com/songhuan999999/p/11769480.html