New up() functions in rc scripts.
This commit is contained in:
parent
7c1b2ef659
commit
2aac756e76
13
etc/rc
13
etc/rc
@ -15,12 +15,11 @@ usage()
|
|||||||
up()
|
up()
|
||||||
{
|
{
|
||||||
service=$1
|
service=$1
|
||||||
args=$2
|
shift
|
||||||
|
|
||||||
# Function to dynamically start a system service
|
# Function to dynamically start a system service
|
||||||
echo -n " $service"
|
echo -n " $service"
|
||||||
command="/sbin/$service $args"
|
service up /sbin/$service "$@"
|
||||||
eval service up $command
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts 'saf' opt
|
while getopts 'saf' opt
|
||||||
@ -52,11 +51,11 @@ start)
|
|||||||
# Start crucial system services. The floppy driver *must* be loaded
|
# Start crucial system services. The floppy driver *must* be loaded
|
||||||
# first, as it needs memory below 16MB in order to do ISA DMA.
|
# first, as it needs memory below 16MB in order to do ISA DMA.
|
||||||
if [ ! "`sysenv label`" = "FLOPPY" ]
|
if [ ! "`sysenv label`" = "FLOPPY" ]
|
||||||
then up floppy "-dev /dev/fd0 -period 5HZ"
|
then up floppy -dev /dev/fd0 -period 5HZ
|
||||||
else up at_wini "-dev /dev/c0d0 -period 5HZ"
|
else up at_wini -dev /dev/c0d0 -period 5HZ
|
||||||
fi
|
fi
|
||||||
up is "-period 5HZ"
|
up is -period 5HZ
|
||||||
up cmos "-dev /dev/cmos -period 5HZ"
|
up cmos -dev /dev/cmos -period 5HZ
|
||||||
echo .
|
echo .
|
||||||
|
|
||||||
# Set timezone.
|
# Set timezone.
|
||||||
|
14
etc/usr/rc
14
etc/usr/rc
@ -55,7 +55,7 @@ daemonize()
|
|||||||
up()
|
up()
|
||||||
{
|
{
|
||||||
service=$1
|
service=$1
|
||||||
args=$2
|
shift
|
||||||
|
|
||||||
# Function to dynamically start a system service
|
# Function to dynamically start a system service
|
||||||
|
|
||||||
@ -64,8 +64,7 @@ up()
|
|||||||
|
|
||||||
# Service is not disabled. Try to bring it up.
|
# Service is not disabled. Try to bring it up.
|
||||||
echo -n " $service"
|
echo -n " $service"
|
||||||
command="/usr/sbin/$service $args"
|
service up /usr/sbin/$service "$@"
|
||||||
eval service up $command
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
@ -78,7 +77,7 @@ start)
|
|||||||
|
|
||||||
# Start servers and drivers set at the boot monitor.
|
# Start servers and drivers set at the boot monitor.
|
||||||
echo -n "Starting services:"
|
echo -n "Starting services:"
|
||||||
up random "-dev /dev/random -period 3HZ"
|
up random -dev /dev/random -period 3HZ
|
||||||
|
|
||||||
# load random number generator
|
# load random number generator
|
||||||
if [ -f $RANDOM_FILE ]
|
if [ -f $RANDOM_FILE ]
|
||||||
@ -94,11 +93,12 @@ start)
|
|||||||
if grep " $driver " /etc/inet.conf > /dev/null 2>&1
|
if grep " $driver " /etc/inet.conf > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
eval arg=\$${driver}_arg
|
eval arg=\$${driver}_arg
|
||||||
up $driver "$arg -period 5HZ"
|
if [ ! -z "$arg" ]; then arg="-args \"$arg\""; fi
|
||||||
|
eval up $driver $arg -period 5HZ
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
up inet "-period 3HZ"
|
up inet
|
||||||
up printer "-dev /dev/lp -period 10HZ"
|
up printer -dev /dev/lp -period 10HZ
|
||||||
echo .
|
echo .
|
||||||
|
|
||||||
# Network initialization.
|
# Network initialization.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user