Commit 297b6aed authored by Adam Wujek's avatar Adam Wujek

[BUG: #211] rootfs/etc/init.d/snmpd: wait 60 seconds in background

Delay monit start by extra 60 seconds.

The delay of snmpd start was put into background because /etc/init.d/rcK
cannot be started before /etc/init.d/rcS is finished. Such behavior is
implemented in the init.
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent ca4839d3
......@@ -16,6 +16,22 @@ start_counter() {
echo "$START_COUNTER" > $COUNTER_FILE
}
snmpd_start() {
# Log source address (-a)
start-stop-daemon -q -p $SNMP_PID -S \
--exec /usr/sbin/snmpd -- $LOG -p $SNMP_PID -a -c $SNMP_CONF
ret=$?
if [ $ret -eq 0 ]; then
start_counter
echo "OK"
elif [ $ret -eq 1 ]; then
echo "Failed (already running?)"
else
echo "Failed"
fi
}
start() {
echo -n "Starting snmpd daemon: "
......@@ -42,22 +58,13 @@ start() {
# file doesn't exist yet so it's a boot call, delay to avoid spurious
# errors
echo "Delaying the start of snmp daemon"
sleep 60
{ sleep 60; snmpd_start; } &
return
fi
# Log source address (-a)
start-stop-daemon -q -p $SNMP_PID -S \
--exec /usr/sbin/snmpd -- $LOG -p $SNMP_PID -a -c $SNMP_CONF
# start snmpd without delay
snmpd_start
ret=$?
if [ $ret -eq 0 ]; then
start_counter
echo "OK"
elif [ $ret -eq 1 ]; then
echo "Failed (already running?)"
else
echo "Failed"
fi
}
stop() {
......
......@@ -19,8 +19,9 @@
set init
#if "set init" don't run as daemon. "set daemon" only specify interval
set daemon 10 # check services at 10 seconds intervals,
with start delay 30 # optional: delay the first check by 30 seconds (by
with start delay 90 # optional: delay the first check by 90 seconds (by
# # default Monit check immediately after Monit start)
# # Wait extra 60 seconds to give snmpd time to start
#
#
## Set syslog logging with the 'daemon' facility. If the FACILITY option is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment