-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
icingadb initscript for non-systemd OS #281
Comments
I have tested the following changes manually on my instance and it appears to be working ok. I'm not sure if there are better ways to be doing some of these, eg. log file.
#! /bin/sh
### BEGIN INIT INFO
# Provides: icingadb
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: icingadb - Icinga configuration and state database
# Description: icingadb - Icinga configuration and state database
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/icingadb
DAEMON_ARGS="--config /etc/icingadb/config.yml"
LOGFILE=/var/log/icingadb/icingadb.log
NAME=icingadb
DESC=icingadb
RUNDIR=/run/icingadb
PIDFILE=$RUNDIR/icingadb.pid
test -x $DAEMON || exit 0
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi
. /lib/lsb/init-functions
set -e
if [ "$(id -u)" != "0" ]
then
log_failure_msg "Must be run as root."
exit 1
fi
case "$1" in
start)
echo -n "Starting $DESC: "
mkdir -p $RUNDIR
touch $PIDFILE
chown icingadb:icingadb $RUNDIR $PIDFILE
chmod 755 $RUNDIR
if [ -n "$ULIMIT" ]
then
ulimit -n $ULIMIT || true
fi
if start-stop-daemon --start --quiet --oknodo --umask 007 --pidfile $PIDFILE --make-pidfile --background --output $LOGFILE --chuid icingadb:icingadb --exec $DAEMON -- $DAEMON_ARGS
then
echo "$NAME."
else
echo "failed"
fi
;;
stop)
echo -n "Stopping $DESC: "
if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE --remove-pidfile --exec $DAEMON
then
echo "$NAME."
else
echo "failed"
fi
rm -f $PIDFILE
sleep 1
;;
restart|force-reload)
${0} stop
${0} start
;;
status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME}
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
Also |
After consideration we've decided against adding an initscript to IcingaDB - we don't officially support any Linux distributions without systemd, and we don't have the capacity to properly maintain and test and give support for initscripts over a wide range of systems and Icinga modules. Other initscripts in Icinga projects are there for legacy reasons; |
Thanks for the information @htriem. I did look through all the website, docs, GitHub, etc. everywhere previously and I didn’t see it written anywhere that icinga has a requirement on systemd and that non-systemd is unsupported. Can you please point me to where I can find that? non-systemd init systems (sysvinit, runit, openrc, s6, etc.) are still a supported configuration in Debian. |
I have an icinga2 instance with icingaweb2 and monitoring module running on Devuan 4 (Debian 11 derivative without systemd) working successfully. I am attempting to install icingadb using the instructions at https://icinga.com/docs/icinga-db/latest/doc/02-Installation/03-Debian/ but the icingadb package only provides a systemd service file. I am using the icinga APT repository for all icinga related packages.
Can you please add a initscript /etc/init.d/icingadb for non-sytemd users? I can see that icingadb-redis-server already provides an initscript.
The text was updated successfully, but these errors were encountered: