aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-08 18:17:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-08 18:17:02 +0000
commit8b3bc70a2b2d3889f9163e5e5a24747cea6417e6 (patch)
tree2e63749a150ac8c5117fdb901b2d10c1731778de /libexec
parent668ee1016865dcde796cc57b1c1e7c35b85f41d1 (diff)
parent1e80e4f26cfc0d2881f062c406358c5b6cb251ee (diff)
downloadsrc-8b3bc70a2b2d3889f9163e5e5a24747cea6417e6.tar.gz
src-8b3bc70a2b2d3889f9163e5e5a24747cea6417e6.zip
Merge ^/head r352764 through r353315.
Notes
Notes: svn path=/projects/clang900-import/; revision=353316
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rc/rc.conf6
-rw-r--r--libexec/rc/rc.d/Makefile3
-rwxr-xr-xlibexec/rc/rc.d/SERVERS2
-rwxr-xr-xlibexec/rc/rc.d/jail2
-rwxr-xr-xlibexec/rc/rc.d/linux (renamed from libexec/rc/rc.d/abi)32
-rwxr-xr-xlibexec/rc/rc.d/localpkg2
-rwxr-xr-xlibexec/rc/rc.d/sysvipc26
-rwxr-xr-xlibexec/rc/rc.d/watchdogd50
-rw-r--r--libexec/rc/rc.shutdown2
9 files changed, 89 insertions, 36 deletions
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index 79bc1f3436e5..e60ddda369cd 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -638,8 +638,6 @@ accounting_enable="NO" # Turn on process accounting (or NO).
firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if
# this file exists. Should be on a R/W filesystem so
# the file can be deleted after the boot completes.
-
-# Emulation/compatibility services provided by /etc/rc.d/abi
sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO).
linux_enable="NO" # Linux binary compatibility loaded at startup (or NO).
clear_tmp_enable="NO" # Clear /tmp at startup.
@@ -681,6 +679,10 @@ harvest_mask="511" # Entropy device harvests all but the very invasive sources.
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
watchdogd_enable="NO" # Start the software watchdog daemon
watchdogd_flags="" # Flags to watchdogd (if enabled)
+watchdogd_timeout="" # watchdogd timeout, overrides -t in watchdogd_flags
+watchdogd_shutdown_timeout="" # Timeout to use after watchdogd is stopped.
+ # Has effect only for system shutdown.
+ # Overrides -x in watchdogd_flags.
devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing
# devfs(8) rules.
devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev
diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile
index 06b365abb100..69f1f84fcaff 100644
--- a/libexec/rc/rc.d/Makefile
+++ b/libexec/rc/rc.d/Makefile
@@ -11,7 +11,6 @@ CONFS= DAEMON \
LOGIN \
NETWORKING \
SERVERS \
- abi \
addswap \
adjkerntz \
archdep \
@@ -51,6 +50,7 @@ CONFS= DAEMON \
kldxref \
${_kpasswdd} \
ldconfig \
+ linux \
local \
localpkg \
lockd \
@@ -107,6 +107,7 @@ CONFS= DAEMON \
swaplate \
sysctl \
syslogd \
+ sysvipc \
tmp \
ugidfw \
${_utx} \
diff --git a/libexec/rc/rc.d/SERVERS b/libexec/rc/rc.d/SERVERS
index 1cf019a056dd..04468ef0fe64 100755
--- a/libexec/rc/rc.d/SERVERS
+++ b/libexec/rc/rc.d/SERVERS
@@ -4,7 +4,7 @@
#
# PROVIDE: SERVERS
-# REQUIRE: mountcritremote abi ldconfig savecore watchdogd
+# REQUIRE: mountcritremote sysvipc linux ldconfig savecore watchdogd
# This is a dummy dependency, for early-start servers relying on
# some basic configuration.
diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail
index 4a5213e309d4..1a3b551c9a4c 100755
--- a/libexec/rc/rc.d/jail
+++ b/libexec/rc/rc.d/jail
@@ -168,7 +168,7 @@ parse_options()
if [ -z "${_exec_start}" ]; then
_exec_start="/bin/sh /etc/rc"
if [ -z "${_exec_stop}" ]; then
- _exec_stop="/bin/sh /etc/rc.shutdown"
+ _exec_stop="/bin/sh /etc/rc.shutdown jail"
fi
fi
fi
diff --git a/libexec/rc/rc.d/abi b/libexec/rc/rc.d/linux
index bf582219a1f7..dab2f8d461d6 100755
--- a/libexec/rc/rc.d/abi
+++ b/libexec/rc/rc.d/linux
@@ -3,30 +3,22 @@
# $FreeBSD$
#
-# PROVIDE: abi
+# PROVIDE: linux
# REQUIRE: archdep
# KEYWORD: nojail
. /etc/rc.subr
-name="abi"
-desc="Enable foreign ABIs"
+name="linux"
+desc="Enable Linux ABI"
+rcvar="linux_enable"
start_cmd="${name}_start"
stop_cmd=":"
-sysv_start()
-{
- echo -n ' sysvipc'
- load_kld sysvmsg
- load_kld sysvsem
- load_kld sysvshm
-}
-
linux_start()
{
local _tmpdir
- echo -n ' linux'
load_kld -e 'linux(aout|elf)' linux
case `sysctl -n hw.machine_arch` in
amd64)
@@ -43,21 +35,5 @@ linux_start()
fi
}
-abi_start()
-{
- local _echostop
-
- _echostop=
- if checkyesno sysvipc_enable || checkyesno linux_enable; then
- echo -n 'Additional ABI support:'
- _echostop=yes
- fi
-
- checkyesno sysvipc_enable && sysv_start
- checkyesno linux_enable && linux_start
-
- [ -n "${_echostop}" ] && echo '.'
-}
-
load_rc_config $name
run_rc_command "$1"
diff --git a/libexec/rc/rc.d/localpkg b/libexec/rc/rc.d/localpkg
index 1214a263ccac..97e0c17ec4bc 100755
--- a/libexec/rc/rc.d/localpkg
+++ b/libexec/rc/rc.d/localpkg
@@ -4,7 +4,7 @@
#
# PROVIDE: localpkg
-# REQUIRE: abi
+# REQUIRE: sysvipc linux
# BEFORE: securelevel
# KEYWORD: shutdown
diff --git a/libexec/rc/rc.d/sysvipc b/libexec/rc/rc.d/sysvipc
new file mode 100755
index 000000000000..0effbe7e22ca
--- /dev/null
+++ b/libexec/rc/rc.d/sysvipc
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: sysvipc
+# REQUIRE: archdep
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="sysvipc"
+desc="Load SysV IPC modules"
+rcvar="sysvipc_enable"
+start_cmd="${name}_start"
+stop_cmd=":"
+
+sysvipc_start()
+{
+ load_kld sysvmsg
+ load_kld sysvsem
+ load_kld sysvshm
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/libexec/rc/rc.d/watchdogd b/libexec/rc/rc.d/watchdogd
index 1de2d9319280..b48696cc8504 100755
--- a/libexec/rc/rc.d/watchdogd
+++ b/libexec/rc/rc.d/watchdogd
@@ -38,9 +38,55 @@ desc="Watchdog daemon"
rcvar="watchdogd_enable"
command="/usr/sbin/${name}"
pidfile="/var/run/${name}.pid"
+start_precmd="watchdogd_prestart"
+stop_precmd="watchdogd_prestop"
+stop_postcmd="watchdogd_poststop"
+watchdog_command="/usr/sbin/watchdog"
-load_rc_config $name
+watchdogd_prestart()
+{
+ if [ -n "${watchdogd_timeout}" ] ; then
+ rc_flags="${rc_flags} -t ${watchdogd_timeout}"
+ fi
+ if [ -n "$watchdogd_shutdown_timeout" ] ; then
+ rc_flags="${rc_flags} -x ${watchdogd_shutdown_timeout}"
+ fi
+ return 0
+}
+
+watchdogd_prestop()
+{
+ sig_stop="${watchdogd_sig_stop:-TERM}"
+}
-sig_stop="${watchdogd_sig_stop:-TERM}"
+watchdogd_poststop()
+{
+ if [ ${watchdogd_shutdown_timeout:-0} -gt 0 ] ; then
+ case "${rc_shutdown}" in
+ "reboot")
+ info "watchdog timer is set to" \
+ ${watchdogd_shutdown_timeout} "before shutdown"
+ return 0
+ ;;
+ "single")
+ info "watchdog timer is disabled before going to" \
+ "single user mode"
+ ${watchdog_command} -t 0
+ ;;
+ "")
+ info "watchdog timer is disabled after administrative" \
+ "${name} stop"
+ ${watchdog_command} -t 0
+ ;;
+ *)
+ warn "unknown shutdown mode '${rc_shutdown}'"
+ warn "watchdog timer is set to ${watchdogd_shutdown_timeout}"
+ return 0
+ ;;
+ esac
+ fi
+ return 0
+}
+load_rc_config $name
run_rc_command "$1"
diff --git a/libexec/rc/rc.shutdown b/libexec/rc/rc.shutdown
index 15779c784091..0f60ffbad9cc 100644
--- a/libexec/rc/rc.shutdown
+++ b/libexec/rc/rc.shutdown
@@ -43,6 +43,8 @@ HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
export HOME PATH
+rc_shutdown=${1:-"unspecified"}
+
. /etc/rc.subr
load_rc_config