Things I hate 1,134,939,999 – poorly written init scripts that don’t work and are just knock offs of other init scripts that work properly. In particular ndo2db, which is a Nagios to database broker and I am using with Centreon (fancy web front end for Nagios, gets you out of the config hell that). So the new Centreon does a restart on ndo2db, which does not work because, well, the init script is just a copy with some poorly hacked items to account for ndo2db files instead of Nagios directories / files. For Nagios, the EXACT same script works fine and you get a PID number in the nagios.lock file. For ndo2db, yeah, nope. It fails. So /etc/init.d/ndo2db status results in “there’s no pid but subsys is locked”, and /etc/init.d/ndo2db stop fails, which if you want to actually stop ndo2db, you have to issue killall -9 ndo2db, which is stupid and the suck. Get it together man, now I have to write my own ndo2db init script because you guys suck.
Also, things I hate 1,134,940,000 – Programs that require some other intermediary application that can use databases other than MySQL, like, well something awesome that doesn’t have fucking table crashes like MySQL’s MyISAM shit, you know, like PostgreSQL. Ndo2db can use PostgreSQL as a database backend, that’s awesome, but no… I no can haz. Then that application (Centreon) doesn’t offer alternative database support, and requires that you use the POS MySQL, so of course the intermediary program (ndo2db) has to use MySQL.
#LSAP (linux sys admin problems).
Gah. Annoying day at work.
### Update ####
Woot. Reason 500,000,000,000 I love Google. After some searching and reviewing I came across an init script that is a bit out of date for today’s chkconfig, but was easily updated. Thanks to http://sysengineers.wordpress.com/2010/01/19/ndo2db-startup-script-for-rh-el-oel/
#!/bin/sh
### BEGIN INIT INFO
# Provides: ndo2db
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Nagios NDO2DB Initscript
# Description: Nagios Data Out Daemon
### END INIT INFO
#
# "$Id: ndodaemon.sh,v 0.9 2010/01/19 Chris Exp $"
#
# Startup/shutdown script for the NDO2DB daemon under centreon/nagios.
#
# Linux chkconfig stuff:
#
# chkconfig: 2345 56 10
# description: Startup/shutdown script for NDO2DB Daemon \
# using Centreon / Nagios.
# Source function library.
. /etc/init.d/functions
# Set various vars
#DAEMON=ndo2db;
prog=ndo2db;
nagios_prefix="/usr/local/nagios"
NDODAEMON="${nagios_prefix}/bin/${prog}"
NDOCONFIG="${nagios_prefix}/etc/${prog}.cfg"
#Check if both the ndo daemon and config are found.
#echo -n $"Searching ndo config & binairies : "
if test -f $NDODAEMON
then
if test -f $NDOCONFIG
then
RETVAL=0;
#echo "Files found!";
else
echo "ERROR: Config file not found!";
exit 1;
fi
else
echo "ERROR: ndo2db not found!";
exit 1;
fi
start () {
if test -f "/var/lock/subsys/ndo2db"
then
echo "ndo2db is allready running...";
return 1;
fi
echo -n $"Starting $prog: "
# start daemon
daemon $NDODAEMON -c $NDOCONFIG
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/ndo2db
return $RETVAL
}
stop () {
# stop daemon
echo -n $"Stopping $prog: "
killproc $NDODAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/ndo2db
}
restart() {
stop
start
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/ndo2db ] && restart || :
;;
reload)
echo -n $"Reloading $prog: "
killproc $NDODAEMON -HUP
RETVAL=$?
echo
;;
status)
status $NDODAEMON
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}"
exit 3
esac
exit $RETVAL