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

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了,

posted @ 2017-02-16 11:30  djiankuo  阅读(812)  评论(0编辑  收藏  举报