ubuntu自定义服务,以SRT Server为例
① 创建编辑 sudo vi /etc/systemd/system/srt.service
1 [Unit] 2 Description = SRT Server Service 3 After = network.target syslog.target 4 Wants = network.target 5 6 [Service] 7 Type=simple 8 ExecStart=/home/vikin/srtdaemon/server/bin/sls -c /home/vikin/srtdaemon/server/bin/sls.conf 9 KillSignal=SIGQUIT 10 TimeoutStopSec=5 11 KillMode=process 12 PrivateTmp=true 13 StandardOutput=syslog 14 StandardError=inherit 15 16 [Install] 17 WantedBy=multi-user.target
② 刷新服务 sudo systemctl daemon-reload
③ 操作srt服务 sudo systemctl start | stop | restart | status | enable srt
标签:服务,target,自定义,sudo,srt,ubuntu From: https://www.cnblogs.com/magics/p/17459981.html