Or the link /etc/systemd/system/multi-user.target.wants/nagios.service
I created the /usr/lib/systemd/system/nagios.service file from another server:
Code: Select all
[Unit]
Description=Nagios Core 4.4.6
Documentation=https://www.nagios.org/documentation
After=network.target local-fs.target mariadb.service
[Service]
Type=forking
ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
ExecStop=/bin/kill -s TERM ${MAINPID}
ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd
ExecReload=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecReload=/bin/kill -s HUP ${MAINPID}
[Install]
WantedBy=multi-user.target
I then recreated the link /etc/systemd/system/multi-user.target.wants/nagios.service and rebooted the server and it is now working.
Thank you both for your help.