SVN: rc-scripts/branches/upstart_native/rc.d/init.d/functions

jajcus jajcus at pld-linux.org
Mon May 10 08:40:34 CEST 2010


Author: jajcus
Date: Mon May 10 08:40:34 2010
New Revision: 11411

Modified:
   rc-scripts/branches/upstart_native/rc.d/init.d/functions
Log:
- use 'configtest' before restart/reload if available

Modified: rc-scripts/branches/upstart_native/rc.d/init.d/functions
==============================================================================
--- rc-scripts/branches/upstart_native/rc.d/init.d/functions	(original)
+++ rc-scripts/branches/upstart_native/rc.d/init.d/functions	Mon May 10 08:40:34 2010
@@ -1196,6 +1196,7 @@
 	fi
 	local commands
 	local extra_commands
+	local has_configtest
 	if [ "$1" = "--except" ] ; then
 		shift
 		commands="$*"
@@ -1206,6 +1207,10 @@
 			case "$cmd" in
 				start|stop|status|reload|restart|try-restart|force-reload)
 					;;
+				configtest)
+					has_configtest=yes
+					extra_commands="|$cmd"
+					;;
 				*)
 					extra_commands="|$cmd"
 					;;
@@ -1241,6 +1246,9 @@
 			exit $?
 			;;
 		restart)
+			if is_yes $has_configtest ; then
+				"$script" configtest || exit 1
+			fi
 			upstart_stop $name
 			upstart_start $name
 			exit $?
@@ -1249,11 +1257,17 @@
 			if ! is_upstart_running "$name" ; then
 				exit 0
 			fi
+			if is_yes $has_configtest ; then
+				"$script" configtest || exit 1
+			fi
 			upstart_stop $name
 			upstart_start $name
 			exit $?
 			;;
 		reload)
+			if is_yes $has_configtest ; then
+				"$script" configtest || exit 1
+			fi
 			if is_upstart_task "$name" ; then
 				nls "$command not implemented for $name"
 				exit 3
@@ -1263,6 +1277,9 @@
 			fi
 			;;
 		force-reload)
+			if is_yes $has_configtest ; then
+				"$script" configtest || exit 1
+			fi
 			if is_upstart_task "$name" ; then
 				upstart_stop "$name"
 				upstart_start "$name"


More information about the pld-cvs-commit mailing list