From: Jorrit Herder Date: Mon, 28 Nov 2005 15:39:01 +0000 (+0000) Subject: New up() functions in rc scripts. X-Git-Tag: v3.1.2a~486 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.named.html?a=commitdiff_plain;h=2aac756e76db5a3649a036f2004ccd3c0ba20d15;p=minix.git New up() functions in rc scripts. --- diff --git a/etc/rc b/etc/rc index 9fd89f131..ac72e4478 100755 --- a/etc/rc +++ b/etc/rc @@ -15,12 +15,11 @@ usage() up() { service=$1 - args=$2 + shift # Function to dynamically start a system service echo -n " $service" - command="/sbin/$service $args" - eval service up $command + service up /sbin/$service "$@" } while getopts 'saf' opt @@ -52,11 +51,11 @@ start) # Start crucial system services. The floppy driver *must* be loaded # first, as it needs memory below 16MB in order to do ISA DMA. if [ ! "`sysenv label`" = "FLOPPY" ] - then up floppy "-dev /dev/fd0 -period 5HZ" - else up at_wini "-dev /dev/c0d0 -period 5HZ" + then up floppy -dev /dev/fd0 -period 5HZ + else up at_wini -dev /dev/c0d0 -period 5HZ fi - up is "-period 5HZ" - up cmos "-dev /dev/cmos -period 5HZ" + up is -period 5HZ + up cmos -dev /dev/cmos -period 5HZ echo . # Set timezone. diff --git a/etc/usr/rc b/etc/usr/rc index 8ce67b975..4b9a50a7a 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -55,7 +55,7 @@ daemonize() up() { service=$1 - args=$2 + shift # Function to dynamically start a system service @@ -64,8 +64,7 @@ up() # Service is not disabled. Try to bring it up. echo -n " $service" - command="/usr/sbin/$service $args" - eval service up $command + service up /usr/sbin/$service "$@" } case $action in @@ -78,7 +77,7 @@ start) # Start servers and drivers set at the boot monitor. echo -n "Starting services:" - up random "-dev /dev/random -period 3HZ" + up random -dev /dev/random -period 3HZ # load random number generator if [ -f $RANDOM_FILE ] @@ -94,11 +93,12 @@ start) if grep " $driver " /etc/inet.conf > /dev/null 2>&1 then eval arg=\$${driver}_arg - up $driver "$arg -period 5HZ" + if [ ! -z "$arg" ]; then arg="-args \"$arg\""; fi + eval up $driver $arg -period 5HZ fi done - up inet "-period 3HZ" - up printer "-dev /dev/lp -period 10HZ" + up inet + up printer -dev /dev/lp -period 10HZ echo . # Network initialization.