SOURCES: rc-scripts-initng.patch - fallback to rc-script for other...

glen glen at pld-linux.org
Thu Mar 16 13:47:59 CET 2006


Author: glen                         Date: Thu Mar 16 12:47:59 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fallback to rc-script for other actions than start,stop,restart

---- Files affected:
SOURCES:
   rc-scripts-initng.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/rc-scripts-initng.patch
diff -u SOURCES/rc-scripts-initng.patch:1.1 SOURCES/rc-scripts-initng.patch:1.2
--- SOURCES/rc-scripts-initng.patch:1.1	Wed Mar 15 13:57:05 2006
+++ SOURCES/rc-scripts-initng.patch	Thu Mar 16 13:47:54 2006
@@ -1,5 +1,5 @@
 --- service	2006-02-10 21:27:45.000000000 +0200
-+++ /sbin/service	2006-03-15 14:55:49.117496239 +0200
++++ /sbin/service	2006-03-15 23:44:59.113031891 +0200
 @@ -9,11 +9,13 @@
  [ service_name [ command | --full-restart ] ]"
  
@@ -17,12 +17,16 @@
  fi
  
  if [ $# -eq 0 ]; then
-@@ -65,8 +67,33 @@
+@@ -65,6 +67,41 @@
  	esac
  done
  
--if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-+if [ -n "$INITNG" -a -f "${SERVICEDIR}/${SERVICE}.i" ]; then
++if [ -n "$INITNG" ]; then
++	if [ ! -f "${SERVICEDIR}/${SERVICE}.i" ]; then
++		echo "${SERVICE}: unrecognized service" >&2
++		exit 1
++	fi
++
 +	OPT=
 +	CMD="${OPTIONS# *}"
 +	CMD="${CMD% *}"
@@ -40,15 +44,18 @@
 +		echo "Usage: service ${SERVICE} {start|stop|restart}" >&2
 +		exit 1
 +		;;
-+	*)
-+		echo "${SERVICE}: ${CMD} unhandled by initng" >&2
-+		exit 1
 +	esac
-+	/sbin/ngc $OPT "daemon/${SERVICE}"
 +
-+elif [ -x "${SERVICEDIR}/${SERVICE}" ]; then
- 	env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
++	if [ -n "$OPT" ]; then
++		exec /sbin/ngc $OPT "daemon/${SERVICE}"
++		echo "${SERVICE}: ngc execute failed" >&2
++		exit 1
++	fi
++
++	# fallback to rc-script
++	SERVICEDIR="/etc/rc.d/init.d"
++fi
 +
+ if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
+ 	env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
  else
- 	echo "${SERVICE}: unrecognized service" >&2
- 	exit 1
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rc-scripts-initng.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list