Skip to content

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.

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=Notifly
Requires=network.target
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/notifly
ExecStart=/opt/notifly/notifly
StandardOutput=append:/var/log/notifly/notifly.log
StandardError=append:/var/log/notifly/notifly-error.log
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

Then run the following commands to enable systemd to start Notifly at boot:

Окно терминала
sudo mkdir /var/log/notifly
sudo chmod -R go-rw /opt/notifly /etc/notifly/config.yml /var/log/notifly
sudo ln -s /opt/notifly/notifly.service /etc/systemd/system/notifly.service
sudo systemctl daemon-reload
sudo systemctl enable notifly

Notifly can then be started manually with:

Окно терминала
sudo systemctl start notifly
sudo systemctl status notifly
sudo tail /var/log/notifly/notifly.log