SVN: rc-scripts/trunk/rc.d/init.d/functions
glen
glen at pld-linux.org
Fri Aug 19 21:42:49 CEST 2011
Author: glen
Date: Fri Aug 19 21:42:48 2011
New Revision: 12328
Modified:
rc-scripts/trunk/rc.d/init.d/functions
Log:
avoid shift() error when program called with no actions in _upstart_controlled; tabs
Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions (original)
+++ rc-scripts/trunk/rc.d/init.d/functions Fri Aug 19 21:42:48 2011
@@ -1268,7 +1268,7 @@
upstart_status() {
# get service status
# should be compliant with
- # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
+ # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
local service=$1
local status
if is_upstart_task "${service}" ; then
@@ -1291,16 +1291,16 @@
# TODO: other statuses
}
-_upstart_controlled () {
+_upstart_controlled() {
# If the service is to be handled by upstart
# execute the start/stop/etc. commands the upstart way
- if ! use_upstart ; then
+ if ! use_upstart; then
return 0
- fi
+ fi
local script=$1
shift
local command=$1
- shift
+ [ $# -gt 0 ] && shift
local name=$(basename "$script")
if [ ! -f /etc/init/${name}.conf ] ; then
return 0
@@ -1401,7 +1401,7 @@
fi
;;
*)
- msg_usage "$0 {start|stop|restart|reload|force-reload|status$extra_commands}"
+ msg_usage "$0 {start|stop|restart|reload|force-reload|status$extra_commands}"
exit 3
;;
esac
More information about the pld-cvs-commit
mailing list