4 # binfmt-detector: Microsoft PE executable type detector. User can run
5 # programs using Wine or Mono simply by clicking on them
8 # chkconfig: 2345 95 10
10 # description: Microsoft PE executable type detector. User can run
11 # programs using Wine or Mono simply by clicking on them
12 # or typing ./file.exe
15 # Source function library
16 . /etc/rc.d/init.d/functions
18 BINFMT_DIR='/proc/sys/fs/binfmt_misc'
21 if [ ! -f /var/lock/subsys/binfmt-detector ]; then
22 # check if binfmt_misc is not already mounted
23 if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then
24 /bin/mount none -t binfmt_misc ${BINFMT_DIR}
26 msg_starting 'binfmt-detector'/proc/sys/fs/binfmt_misc
27 echo ':windows:M::MZ::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
28 echo ':windowsPE:M::PE::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
30 touch /var/lock/subsys/binfmt-detector
32 msg_already_running 'binfmt-detector'
37 if [ -f /var/lock/subsys/binfmt-detector ]; then
38 msg_stopping 'binfmt-detector'
39 echo '-1' > ${BINFMT_DIR}/windows
40 echo '-1' > ${BINFMT_DIR}/windowsPE
41 rm -f /var/lock/subsys/binfmt-detector
44 msg_not_running 'binfmt-detector'
50 start|reload|force-reload)
63 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"