Create a template to allow a user app running as a daemon.
[Unit]
Description=Health Monitor
[Service]
Type=simple
ExecStart=/usr/bin/healthmon
ExecStop=/bin/kill -s QUIT $MAINPID
StandardError=file:/var/log/healthmon.log
StandardError=file:/var/log/healthmon.log
[Install]
WantedBy=multi-user.target
Use systemctl
to start and stop.
文章评论