Linux添加自启动
1、新建脚本 xxxstart.sh
cd /etc/rc.d/init.d
vim xxxstart.sh
2、编写脚本 xxxstart.sh
#!/bin/sh
#chkconfig: 2345 80 90
#description:开机自动启动的脚本程序
#开启服务 项目服务路径 端口为5577
/xxx/xxx/xxx/server/server.js --port 5577 &
esc +:wq 保存退出
3、赋予脚本可执行性权限
chmod +x xxxstart.sh
4、添加脚本到开机自动启动项目中
chkconfig --add xxxstart.sh
chkconfig xxxstart.sh on
转载: https://blog.csdn.net/daidaineteasy/article/details/54864776