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'
20 [ ! -e "$BINFMT_DIR/register" ] && exit 0
23 if [ ! -f /var/lock/subsys/binfmt-detector ]; then
24 # check if binfmt_misc is not already mounted
25 if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then
26 /bin/mount none -t binfmt_misc ${BINFMT_DIR}
28 msg_starting 'binfmt-detector'
29 echo ':windows:M::MZ::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
30 echo ':windowsPE:M::PE::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
32 touch /var/lock/subsys/binfmt-detector
34 msg_already_running 'binfmt-detector'
39 if [ -f /var/lock/subsys/binfmt-detector ]; then
40 msg_stopping 'binfmt-detector'
41 echo '-1' > ${BINFMT_DIR}/windows
42 echo '-1' > ${BINFMT_DIR}/windowsPE
43 rm -f /var/lock/subsys/binfmt-detector
46 msg_not_running 'binfmt-detector'
52 start|reload|force-reload)
65 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"