From: Jorrit Herder Date: Thu, 4 Aug 2005 16:45:29 +0000 (+0000) Subject: Startup script now checks if network driver is mentioned in inet.conf. X-Git-Tag: v3.1.0~453 X-Git-Url: http://zhaoyanbai.com/repos/man.dnssec-checkds.html?a=commitdiff_plain;h=40e9875fd62867d56dcafa740017a56f148aebc8;p=minix.git Startup script now checks if network driver is mentioned in inet.conf. Also allowed disabling daemons (like services) with disable= parameter. --- 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"