安装 supervisor
apt-get install supervisor
配置守护
vi /etc/supervisor/conf.d/syncthing.conf
填入以下内容
[program:syncthing]
command = /bin/syncthing -no-browser -home="/root/.config/syncthing"
directory = /root
autorestart = True user = root environment = STNORESTART="1", HOME="/root"
重启进程
supervisorctl reload
启动
supervisorctl start syncthing
重启
supervisorctl restart syncthing
停止
supervisorctl stop syncthing