return 0
}
-
start () {
echo -n $"Starting collectd: "
check_config
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$service
fi
}
+
stop () {
echo -n $"Stopping collectd: "
killproc -p $COLLECTDMONPID -d $MAXWAIT $prog
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$service
}
+
+restart () {
+ check_config
+ rc="$?"
+ if test "$rc" -ne 0; then
+ RETVAL=6
+ echo $"not restarting due to configuration error"
+ failure $"not restarting $service due to configuration error"
+ else
+ stop
+ start
+ fi
+}
+
# See how we were called.
case "$1" in
start)
status -p $COLLECTDMONPID $prog
;;
restart|reload)
- check_config
- rc="$?"
- if test "$rc" -ne 0; then
- RETVAL=6
- echo $"not restarting due to configuration error"
- failure $"not restarting $service due to configuration error"
- else
- stop
- start
- fi
+ restart
;;
condrestart)
[ -f /var/lock/subsys/$service ] && restart || :