Centos下设置开机自启方式如下:
Ubuntu下设置开机自启方式如下:
设置开机自启:
目前手里有一台服务器的快照,不过每次都需要打开,然后手动进去打开服务,想着把开启服务的命令加到开机自启,这样就方便了。
新建脚本为autoss.sh:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/sh ### BEGIN INIT INFO # Provides: svnd.sh # Required-start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the svnd.sh daemon # Description: starts svnd.sh using start-stop-daemon ### END INIT INFO ssserver -c /path/to/config.json -d start |
设置权限:
sudo chmod 775 autoss.sh
复制到自启目录下:
cp autoss.sh /etc/init.d
执行更新命令:
cd /etc/init.d/
sudo update-rc.d autoss.sh
重启即可。
想要取消开机自启?
cd /etc/init.d
sudo update-rc.d -f autoss.sh remove

马春杰杰




最新评论
站长您好,亚马逊云咨询推广资源,望建立联系,可邮件,谢谢。
换友情链接吗?
看你的站做的挺不错的
恭喜!!太强了,硕博连读啊
雁过留毛,人过留名。
看不懂但大受震撼
每天都在战争,希望2026和平.
ZeroTier 看过多篇帖子,目前群辉、飞牛os、win11 、安卓、ubuntu ≥18.04 顺利通过,这篇相对于简单 实用、特来感谢 🙄