ubuntu自定义服务

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

posted @ 2023-06-06 11:06  祁连山  阅读(320)  评论(0编辑  收藏  举报