From 40e9875fd62867d56dcafa740017a56f148aebc8 Mon Sep 17 00:00:00 2001 From: Jorrit Herder Date: Thu, 4 Aug 2005 16:45:29 +0000 Subject: [PATCH] Startup script now checks if network driver is mentioned in inet.conf. Also allowed disabling daemons (like services) with disable= parameter. --- etc/usr/rc | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/etc/usr/rc b/etc/usr/rc index b90bfb21c..31daf1da7 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -10,6 +10,23 @@ case "$#:$1" in exit 1 esac +disabled() +{ + service=$1 + + ifs="$IFS"; IFS=, + for name in `sysenv disable` + do + if [ "$name" = "$service" ] + then + IFS="$ifs"; unset ifs + return 0 + fi + done + IFS="$ifs"; unset ifs + return 1 +} + daemonize() { # Function to start a daemon, if it exists. @@ -21,6 +38,10 @@ daemonize() do if [ -f "$dir/$1" ] then + + # check if this service is disabled at the boot monitor. + if disabled $name; then return; fi + echo -n " $name" "$@" & return @@ -37,14 +58,7 @@ up() # Function to dynamically start a system service # First check if this service is disabled at the boot monitor. - ifs="$IFS"; IFS=, - for name in `sysenv disable` - do - if [ "$name" = "$service" ] - then return - fi - done - IFS="$ifs"; unset ifs + if disabled $service; then return; fi # Service is not disabled. Try to bring it up. command="/usr/sbin/$service" -- 2.44.0