summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6c89c1)
raw | patch | inline | side by side (parent: f6c89c1)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 5 Dec 2014 12:52:09 +0000 (13:52 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 5 Dec 2014 12:52:09 +0000 (13:52 +0100) |
This ensures the "condrestart" option will work.
contrib/redhat/init.d-collectd | patch | blob | history |
index 4c69f3c9b7e0dd88fc1ac793eca7a7e68b02bb62..829eda5fcdc4d3c553f3c38d8c7a075aa4149c9d 100644 (file)
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 || :