1.部署的命令文件内容 (用来完成部署工作):
cd /root/ansiblewebtest/
nohup dotnet WebApiUseAnsible.dll --urls="http://*:5002" >> /root/ansiblewebtest/log/output.log 2>&1 &
2.自启动设置:
1)、赋予脚本可执行权限(/mnt/shell/autostart.sh是你的脚本路径)
chmod +x /mnt/shell/autostart.sh
2)、打开/etc/rc.d/rc/local文件,在末尾增加如下内容
/mnt/shell/autostart.sh
3)、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限
chmod +x /etc/rc.d/rc.local