Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d. This example start a
# single forking daemon capable of writing a pid
# file. To get other behavoirs, implemend
# do_start(), do_stop() or other functions to
# override the defaults in /lib/init/init-d-script.
### END INIT INFO
# Author: my name <[email protected]>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.
DESC="Nagios"
NAME=nagios
DAEMON=/usr/local/nagios/bin/$NAME
DAEMON_ARGS="-d /usr/local/nagios/etc/nagios.cfg"
PIDFILE=/usr/local/nagios/var/$NAME.lock
Can anyone please point me to the right direction in order to solve the issue?
Thanks
The issue is your init script is for systemd and using the skeleton base. When you are running through the install process of Nagios, you'll at one point run make install-init. This will create the correct init file for you.
cd /tmp
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.2.0.tar.gz
tar -zxvf nagios-4.2.0.tar.gz
cd nagios-4.2.0/
./configure --with-command-group=nagcmd --with-mail=/usr/bin/sendmail --with-httpd-conf=/etc/apache2/
make install-init
cat /etc/init.d/nagios
service nagios reload
Thanks rkennedy,
re running the make install-init solved the issue.
During the installation I followed the document that you have pointed me to and I have realized my mistake.
Since the guide does not provide Debian instructions I went with the closest one: For Ubuntu users using systemd thinking that systemd was used by default in Debian.
Therefore:
I figured that's what happened, I did the same thing brainlessly not thinking on a test machine, and sure enough walked myself backwards through it to solve this one.
Going to mark this one as resolved, and close it up!