Viitor_upstartaddon/etc/event.d/binfmt_misc

48 lines
1.5 KiB
Plaintext
Raw Normal View History

# rc - runlevel compatibility
#
# This task guesses what the "default runlevel" should be and starts the
# appropriate script.
start on started mountfs
console logged
script
source /etc/init.d/functions
if modprobe binfmt_misc; then
if ! mount|grep binfmt_misc >/dev/null 2>&1; then
echo -n "Mounting binfmt_misc filesystem"
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
evaluate_retval
fi
if [ -f /opt/wine/bin/wine ] && [ ! -f /proc/sys/fs/binfmt_misc/mswin ]; then
echo -n "Setting up binfmt_misc for windows executables"
echo ":mswin:M:0:\\x4d\\x5a\\x90\\x00::/opt/wine/bin/wine:" >/proc/sys/fs/binfmt_misc/register
evaluate_retval
fi
if [ -f /usr/lib64/jdk/bin/java ]; then
JAVAPATH=/usr/lib64/jdk/bin
elif [ -f /usr/lib/jdk/bin/java ]; then
JAVAPATH=/usr/lib/jdk/bin
fi
if [ "$JAVAPATH" ]; then
if [ ! -f /proc/sys/fs/binfmt_misc/Java ]; then
echo -n "Setting up binfmt_misc for java executables"
echo ":Java:M::\\xca\\xfe\\xba\\xbe::$JAVAPATH/javawrapper:" >/proc/sys/fs/binfmt_misc/register
evaluate_retval
fi
if [ ! -f /proc/sys/fs/binfmt_misc/ExecutableJAR ]; then
echo -n "Setting up binfmt_misc for jar executables"
echo ":ExecutableJAR:E::jar::$JAVAPATH/jarwrapper:">/proc/sys/fs/binfmt_misc/register
evaluate_retval
fi
if [ ! -f /proc/sys/fs/binfmt_misc/Applet ]; then
echo -n "Setting up binfmt_misc for java applets"
echo ":Applet:M::<!--applet::$JAVAPATH/appletviewer:" >/proc/sys/fs/binfmt_misc/register
evaluate_retval
fi
fi
fi
end script