#!/bin/sh
#
# execsys-binfmt: test1
#
# chkconfig: 2345 2 98
# description: test2
#
### BEGIN INIT INFO
# Provides:          execsys-binfmt
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start scripts.mit.edu execsys system
# Description:       Decides what interpreter to use to execute files
### END INIT INFO

stop ()
{
    echo "-1" > /proc/sys/fs/binfmt_misc/status
    umount /proc/sys/fs/binfmt_misc
}

start ()
{
    mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
# START-AUTOGENERATED: DO NOT EDIT THIS SECTION, INCLUDING THIS LINE!
# This section is populated by the script upd-execsys
# END-AUTOGENERATED: DO NOT EDIT THIS SECTION, INCLUDING THIS LINE!
}

case "$1" in
start)
    stop 2>/dev/null || :
    start
    ;;
stop)
    stop
    ;;
force-reload)
    stop
    start
    ;;
restart)
    stop
    start
    ;;
*)
    echo "Usage: $0 [start|stop|restart|force-reload]" >&2
    exit 2
    ;;
esac

exit $?
