- sudo vim /etc/rc.local
- 在exit 0 之前加入要启动的脚本文件
#!/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.
cd /home/vhd/tools/srs/trunk
bash scripts/run.sh > /home/vhd/tools/srs/trunk/log/run.log &
cd -
exit 0
- 保存退出,重启服务器