systemd configuration
You can use systemd to manage startup, logging, etc. for Notifly.
[!note] This is only a minimal example and does not provide the most secure or “best” way to run notifly. Please adjust the configuration to suit your needs.
Installation
Section titled “Installation”For this example Notifly is installed as root into the directory named
/opt/notifly/ and the executable there is called notifly. The configuration
file will be /etc/notifly/config.yml using relative paths as in the example, and
the service will be run as root. A file named /opt/notifly/notifly.service should
be created as root containing:
[Unit]Description=NotiflyRequires=network.targetAfter=network.target
[Service]Type=simpleUser=rootWorkingDirectory=/opt/notiflyExecStart=/opt/notifly/notiflyStandardOutput=append:/var/log/notifly/notifly.logStandardError=append:/var/log/notifly/notifly-error.logRestart=alwaysRestartSec=3
[Install]WantedBy=multi-user.targetThen run the following commands to enable systemd to start Notifly at boot:
sudo mkdir /var/log/notiflysudo chmod -R go-rw /opt/notifly /etc/notifly/config.yml /var/log/notiflysudo ln -s /opt/notifly/notifly.service /etc/systemd/system/notifly.servicesudo systemctl daemon-reloadsudo systemctl enable notiflyRunning
Section titled “Running”Notifly can then be started manually with:
sudo systemctl start notiflysudo systemctl status notiflysudo tail /var/log/notifly/notifly.log