freebsd-skq/etc/rc.d/abi
Doug Barton ea871df08c Clear up problems with /etc/rc.d/{abi|cleanvar|cleartmp} brought
to light by the PR.  Specifically, convert these three scripts
into good rc.d citizens, making sure that their functionality
is preserved, but the rc.d framework rules are not broken.

Add support for cleanvar as a regular rc.d script in the
default rc.conf, and document this in the man page.

Add a descriptive comment to rc.conf that regarding the
three emulation/compatibility services provided by abi
so users will not be confused by these services not having
their own startup scripts.

PR:		conf/84574
Submitted by:	Alexander Botero-Lowry
2005-12-19 10:57:00 +00:00

55 lines
821 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: abi
# REQUIRE: LOGIN
# BEFORE: securelevel
# KEYWORD: nojail
. /etc/rc.subr
name="abi"
start_precmd="${name}_prestart"
start_cmd=":"
sysv_start()
{
echo -n ' sysvipc'
kldload sysvmsg >/dev/null 2>&1
kldload sysvsem >/dev/null 2>&1
kldload sysvshm >/dev/null 2>&1
}
linux_start()
{
echo -n ' linux'
if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then
kldload linux > /dev/null 2>&1
fi
if [ -x /compat/linux/sbin/ldconfig ]; then
/compat/linux/sbin/ldconfig
fi
}
svr4_start()
{
echo -n ' svr4'
kldload svr4 > /dev/null 2>&1
}
abi_prestart()
{
echo -n 'Additional ABI support:'
checkyesno sysvipc_enable && sysv_start
checkyesno linux_enable && linux_start
checkyesno svr4_enable && svr4_start
echo '.'
}
load_rc_config $name
run_rc_command "$1"