New up() functions in rc scripts.

This commit is contained in:
Jorrit Herder 2005-11-28 15:39:01 +00:00
parent 7c1b2ef659
commit 2aac756e76
2 changed files with 13 additions and 14 deletions

13
etc/rc
View file

@ -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.

View file

@ -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.