Please review pull request #77: Bug #5441 - puppet-dashboard init script is missing 'status' and 'force-reload' arguments opened by (metcalfc)
Description:
I've added a force-reload. Status was already there. While in here, I also cleaned up a bit. I fixed a return value for LSB compliance. I did a bit of refactoring to DRY things up for the force-reload.
- Opened: Sat Jan 21 20:41:51 UTC 2012
- Based on: puppetlabs:master (2a5422b68631ba61d2f4fc690817490f7807f3c3)
- Requested merge: metcalfc:5441_lsb_init_scripts (3c2cef38877bb0eff9d12c1b3b932973b609f7fe)
Diff follows:
diff --git a/ext/packaging/redhat/puppet-dashboard.init b/ext/packaging/redhat/puppet-dashboard.init
index 0e7f57e..548f4b6 100644
--- a/ext/packaging/redhat/puppet-dashboard.init
+++ b/ext/packaging/redhat/puppet-dashboard.init
@@ -76,33 +76,46 @@ stop() {
return $RETVAL
}
+restart () {
+ stop && start
+}
+
+status () {
+ echo -n 'Puppet Dashboard is '
+ pidofproc -p ${PIDFILE} ${DASHBOARD_RUBY} > /dev/null
+ RETVAL=$?
+ if [ $RETVAL = 0 ]; then
+ echo 'running'
+ else
+ echo 'stopped'
+ fi
+ return $RETVAL
+}
+
+force_reload () {
+ restart
+}
+
# See how we were called.
case "$1" in
start)
start
- exit $?
;;
stop)
stop
- exit $?
;;
restart)
- stop && start
- exit $?
+ restart
;;
status)
- echo -n 'Puppet Dashboard is '
- pidofproc -p ${PIDFILE} ${DASHBOARD_RUBY} > /dev/null
- RETVAL=$?
- if [ $RETVAL = 0 ]; then
- echo 'running'
- else
- echo 'stopped'
- fi
+ status
+ ;;
+ force-reload)
+ force_reload
;;
*)
- echo "Usage: $0 {start|stop|restart|status}"
- exit 1
+ echo "Usage: $0 {start|stop|restart|status|force-reload}"
+ exit 2
esac
-exit $RETVAL
+exit $?
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
