systemd管理进程的例子

vi /usr/lib/systemd/system/node_exporter.service

[Unit]
Description=node_exporter

[Service]
ExecStart=/usr/local/node_exporter/node_exporter
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter

posted on 2023-05-17 07:58  荷楠仁  阅读(26)  评论(0编辑  收藏  举报

导航