Subject: bin/10220: /etc/rc.d/amd has problems when ran from the command line
To: None <>
From: None <>
List: netbsd-bugs
Date: 05/28/2000 21:45:13
>Number:         10220
>Category:       bin
>Synopsis:       /etc/rc.d/amd has problems when ran from the command line
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 28 21:46:00 PDT 2000
>Originator:     Ron Roskens
>Release:        20000527
System: NetBSD 1.4Z NetBSD 1.4Z (GENERIC) #12: Sat May 27 16:55:41 PDT 2000 root@swinger:/u1/snapshots/src/sys/arch/i386/compile/GENERIC i386

When running /etc/rc.d/amd from the command line, the script gives errors
because some of the arguments defined are not yet defined in the environment.

command_args makes use of $amd_dir and $amd_master, but neither of these
variables are defined in the script until load_rc_config() is ran.

login as root and run /etc/rc.d/amd after creating an /etc/amd/master file.
You can either escape the variables, or run load_rc_config() after defining
$name in the script. Since required_files and required_dirs also use $amd_dir
and $amd_master, load_rc_config() should be moved up after $name is defined.