4 # wine: Allow users to run Windows(tm) applications by just clicking
5 # on them (or typing ./file.exe)
7 # chkconfig: 2345 95 10
9 # description: Allow users to run Windows(tm) applications by just clicking \
10 # on them (or typing ./file.exe)
13 # Source function library
14 . /etc/rc.d/init.d/functions
16 BINFMT_DIR='/proc/sys/fs/binfmt_misc'
20 start|reload|force-reload)
21 if [ ! -f /var/lock/subsys/wine ]; 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 /proc/sys/fs/binfmt_misc
27 echo ':windows:M::MZ::/usr/bin/wine:' > ${BINFMT_DIR}/register
28 echo ':windowsPE:M::PE::/usr/bin/wine:' > ${BINFMT_DIR}/register
30 touch /var/lock/subsys/wine
32 msg_already_running "Wine"
36 if [ -f /var/lock/subsys/wine ]; then
38 echo "-1" > ${BINFMT_DIR}/windows
39 echo "-1" > ${BINFMT_DIR}/windowsPE
40 rm -f /var/lock/subsys/wine
43 msg_not_running "Wine"
53 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"