- Create new file with extension
.service
inside directory/lib/systemd/system/
, in this example, i haverainsensor.service
- Copy below structure, and do some changes as you wish
[Unit]
Description=rainsensor
[Service]
Group=akhmad
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=/home/akhmad/rainsensor/
ExecStart=/home/akhmad/raindrop-server
PermissionsStartOnly=true
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sleepservice
[Install]
WantedBy=multi-user.target