systemctl自定义服务

分类:Linux, 发布于 2021-07-28 10:27:22,浏览(147),评论(0)

一、 mqtt

[Unit]
Description=Mosquitto
After=network-online.target
Wants=network-online.target
 
[Service]
ExecStart=/usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
User=mosquitto
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target

二、python

[Unit]
Description=data_collect
After=network.target
 
[Service]
ExecStart=/home/ubuntu/data_collect/start.sh
Type=forking
 
[Install]
WantedBy=multi-user.target


评论: