]> git.pld-linux.org Git - packages/wine.git/commitdiff
- binfmt_misc is a filesystem (see sources...), it have to be mounted
authorfilon <filon@sokrates.mimuw.edu.pl>
Fri, 1 Mar 2002 10:28:53 +0000 (10:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- removed loading module, mount will take care of it
- use /var/lock/subsys/wine
- cosmetics

Changed files:
    wine.init -> 1.2

wine.init

index adac8f3361a482ce97c67ab71c45c90599fac93c..cdfa157f1180e9235d1796882d1ef9057aaaf8b5 100644 (file)
--- a/wine.init
+++ b/wine.init
 # Source function library
 . /etc/rc.d/init.d/functions
 
+BINFMT_DIR='/proc/sys/fs/binfmt_misc'
+
 case "$1" in
   start)
-    _modprobe single binfmt_misc
-    msg_starting "Setting Wine configuration"
-    echo ':windows:M::MZ::/usr/X11R6/bin/wine:' >/proc/sys/fs/binfmt_misc/register
-    echo ':windowsPE:M::PE::/usr/X11R6/bin/wine:' >/proc/sys/fs/binfmt_misc/register
-    deltext
-    ok
-    ;;
+       if [ -f /var/lock/subsys/wine ]; then
+               msg_already_running "Wine"
+       else
+               # check if binfmt_misc is not already mounted
+               if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then
+                       /bin/mount none -t binfmt_misc /proc/sys/fs/binfmt_misc
+               fi
+               msg_starting "Wine"
+               echo ':windows:M::MZ::/usr/X11R6/bin/wine:' > ${BINFMT_DIR}/register
+               echo ':windowsPE:M::PE::/usr/X11R6/bin/wine:' > ${BINFMT_DIR}/register
+               deltext
+               ok
+       fi
+       touch /var/lock/subsys/wine
+       ;;
   stop)
-    msg_stopping "Wine"
-    echo "-1" >/proc/sys/fs/binfmt_misc/windows
-    echo "-1" >/proc/sys/fs/binfmt_misc/windowsPE
-    ;;
+        if [ ! -f /var/lock/subsys/wine ]; then
+               msg_not_running "Wine"
+               exit 0
+       fi
+       msg_stopping "Wine"
+       echo "-1" > ${BINFMT_DIR}/windows
+       echo "-1" > ${BINFMT_DIR}/windowsPE
+       rm -f /var/lock/subsys/wine
+       deltext
+       ok
+       ;;
   *)
-    echo "Usage: $0 {start|stop}"
+       echo "Usage: $0 {start|stop}"
 esac
This page took 0.079138 seconds and 4 git commands to generate.