将脚本、程序加入系统服务
示例:
cat /etc/systemd/system/mysqld_exporter.service
[Unit]
Description=mysqld_exporter
[Service]
User=root
ExecStart=/my/mysqld_exporter --config.my-cnf=/my/m.cnf
Restart=on-failure
[Install]
WantedBy=multi-user.targe
cat /etc/systemd/system/mysqld_exporter.service
[Unit]
Description=mysqld_exporter
[Service]
User=root
ExecStart=/my/mysqld_exporter --config.my-cnf=/my/m.cnf
Restart=on-failure
[Install]
WantedBy=multi-user.targe