From 096ac08fe356169f82c43fbf1d02aae4c8e2a360 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 12 Feb 2008 20:15:58 +0000 Subject: [PATCH] Some BSD's init don't send an action to rc.shutdown, so assume shutdown --- etc.BSD/rc.shutdown.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc.BSD/rc.shutdown.in b/etc.BSD/rc.shutdown.in index b531f308..48abe703 100644 --- a/etc.BSD/rc.shutdown.in +++ b/etc.BSD/rc.shutdown.in @@ -13,12 +13,14 @@ export LD_LIBRARY_PATH="/lib${LD_LIBRARY_PATH:+:}${LDLIBRARY_PATH}" # This gives us a nice colour boot :) [ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="@TERM@" +action=${1:-shutdown} + # BSD's init works somewhat differently to sysvinit. # This block should 'translate' from the way init calls it to the way it would # be called by sysvinit on linux. -case "$1" in +case "${action}" in reboot) export RUNLEVEL=6;; - shutdown) export RUNLEVEL=0;; single) export RUNLEVEL=S;; + *) export RUNLEVEL=0;; esac -exec /sbin/rc "$1" +exec /sbin/rc "${action}"