红联Linux门户
Linux帮助

Ubuntu 16.04 server版本开机启动脚本不支持

发布时间:2017-02-16 14:45:13来源:linux网站作者:董小阁
Ubuntu16.04开机启动的脚本一直不支持,错误用在将开机启动脚本放到了home/usr/的目录下,应该放到/root才能正常启动。
 
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
 
将命令写入,注意要放于exit 0之前
sudo sh /xxx/xxx/restart.sh
:wq保存,再次重启服务器时nginx就自动执行restart.sh了。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/28461.html