SOURCES: binfmt-detector.init - better version

arekm arekm at pld-linux.org
Thu Mar 29 18:00:04 CEST 2007


Author: arekm                        Date: Thu Mar 29 16:00:04 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- better version

---- Files affected:
SOURCES:
   binfmt-detector.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/binfmt-detector.init
diff -u SOURCES/binfmt-detector.init:1.6 SOURCES/binfmt-detector.init:1.7
--- SOURCES/binfmt-detector.init:1.6	Thu Mar 29 17:55:27 2007
+++ SOURCES/binfmt-detector.init	Thu Mar 29 17:59:59 2007
@@ -17,17 +17,23 @@
 
 BINFMT_DIR='/proc/sys/fs/binfmt_misc'
 
+[ ! -d "$BINFMT_DIR" ] && exit 0
+
 start() {
 	if [ ! -f /var/lock/subsys/binfmt-detector ]; then
 		# check if binfmt_misc is not already mounted
-		if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then
+		if ! grep -q "${BINFMT_DIR}" /proc/mounts; then
 			/bin/mount none -t binfmt_misc ${BINFMT_DIR}
 		fi
-		msg_starting 'binfmt-detector'/proc/sys/fs/binfmt_misc
-		echo ':windows:M::MZ::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
-		echo ':windowsPE:M::PE::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
-		ok
-		touch /var/lock/subsys/binfmt-detector
+		msg_starting 'binfmt-detector'
+		if [ -e "$BINFMT_DIR/register" ]; then
+			echo ':windows:M::MZ::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
+			echo ':windowsPE:M::PE::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
+			ok
+			touch /var/lock/subsys/binfmt-detector
+		else
+			fail
+		fi
 	else
 		msg_already_running 'binfmt-detector'
 	fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/binfmt-detector.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list