summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 8cdb6e7..061f0b9 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -40,6 +40,7 @@
#
: ${rcvar_manpage:='rc.conf(5)'}
+: ${RC_PID:=$$}; export RC_PID
#
# Operating System dependent/independent variables
@@ -161,6 +162,27 @@ reverse_list()
echo $_revlist
}
+# stop_boot always
+# If booting directly to multiuser or $always is enabled,
+# send SIGTERM to the parent (/etc/rc) to abort the boot.
+# Otherwise just exit.
+#
+stop_boot()
+{
+ local always
+
+ if [ -n "$1" ] && checkyesno $1; then
+ always=true
+ else
+ always=false
+ fi
+ if [ "$autoboot" = yes -o "$always" = true ]; then
+ echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
+ kill -TERM ${RC_PID}
+ fi
+ exit 1
+}
+
#
# mount_critical_filesystems type
# Go through the list of critical filesystems as provided in
OpenPOWER on IntegriCloud