Manual pages › System administration commands (1M)
rc.subr(1M)
shell functions for the boot scripts of the add-on packages
Package: amxbase, added for amigaux.
NAME
rc.subr - shell functions for the boot scripts of the add-on packages
SYNOPSIS
. /usr/lib/amix/rc.subr rc_enabled service [ yes | no ] || exit 0
rc_log service message ...
rc_enabled service [ yes | no ]
rc_conf service key [ default ]
rc_bg seconds service command [ argument ... ]
rc_mknod node c | b major|-
minor [ module [ mode ] ]
DESCRIPTION
/usr/lib/amix/rc.subr is read by the boot script of every service an add-on package installs in /etc/init.d. It gives each script the same way to be turned on and off, the same log and the same way to run something slow without holding up the boot. It is written for the system's own /bin/sh.
- rc_log
- appends one line to the boot log: the date and time, the service, and the message.
- rc_enabled
- succeeds when service is on: when /etc/rc.conf's line service= says yes, or, with no such line, when the default given here is yes (without one, the default is no). A script names its own default, so the package decides whether a new service starts until the administrator says otherwise.
- rc_conf
- prints the value of the line service_key= in /etc/rc.conf, or default when there is none.
- rc_bg
- runs command in the background and returns at once. The command's output is appended to /var/adm/rclog/service; the boot log gets one line when it starts and one with its exit status when it ends. If it is still running after seconds it is sent a terminate signal, and five seconds later a kill signal if it is still there; the log says so. When the command ends first, its timer is stopped with it, so nothing of rc_bg is left running once the command has ended. Only the command itself is stopped, not programs it started, so a script given to rc_bg should bound what it runs. The command starts with the hangup signal ignored, so a boot script run by hand from a login keeps its background run when the login ends; a daemon that rereads its configuration on a hangup sets its own handler, as daemons do.
- rc_mknod
- makes the device node of type c or b, with the given numbers and mode (default 0666), unless it already exists as exactly that device. When module is given and kbootset major names that module's major number in the running kernel's registry, that number is used; if it differs from major, the difference is reported on the console and in the log as a packaging error. Otherwise major is used as given; - says there is none, and then a module the registry does not know gets no node, which the log says.
FILES
- /usr/lib/amix/rc.subr
- this library.
- /etc/rc.conf
- the services' switches and settings.
- /var/adm/rc.log
- the boot log.
- /var/adm/rclog/service
- the output of a command run with rc_bg.
SEE ALSO
NOTES
The helpers need /usr mounted, so they serve scripts that start after the file systems are mounted (from S20 on in /etc/rc2.d). Every variable they set begins with _rc, so a script's own variables are left alone.
| 30 October 2026 | amix-base |