Technical data
8. Documentation for Developers
8.7.2. Start And Stop Scripts
Scripts intended to be executed on system boot are located in the directories opt/etc/boot.d/
and opt/etc/rc.d/ and will also get executed in this sequence. Furthermore, scripts executed
on shutdown are to be found in opt/etc/rc0.d/.
Important: These script must not contain an “exit”, because no separate process is created
for their execution. This command would lead to a premature ending of the boot process!
Start Scripts in opt/etc/boot.d/
Scripts located in this directory are executed at first. They mount the boot volume, parse the
config file rc.cfg located on the boot medium and unpack the opt archive. Depending on the
boot type (Page 24) these scripts are more or less complex and do the following things:
• Loading of hardware drivers (optional)
• Mount the boot volume (optional)
• Read the config file rc.cfg off the boot volume and write it to the file /etc/rc.cfg
• Mount the opt volume (optional)
• Unpack the opt archive (optional)
To make the scripts aware of the fli4l configuration, the configuration file /etc/rc.cfg is
also integrated in the Rootfs archive. The configuration variables in this file are parsed by the
start scripts in opt/etc/boot.d/. After mounting the boot volume /etc/rc.cfg is replaced
by the configuration file there, so that the the current configuration of the boot volume is
available for startup scripts in opt/etc/rc.d/ (see below).
11
Start Scripts in opt/etc/rc.d/
Commands that are executed at every start of the router can be stored in the directory
opt/etc/rc.d/. The following conventions apply:
1. Name conventions:
rc<three-digit number>.<Name of the OPT>
The scripts are started in ascending order of the numbers. If multiple scripts have the
same number assigned, they will be sorted alphabetically at that point. In case that the
start of a package is dependant on another one, this is the determined by the number.
Here’s a general outline which numbers should be used for which tasks:
2. These scripts must contain all functions changing the RootFS, ie. creating of a directory
/var/log/lpd.
11
Normally, these two files are identical. Discrepancies are possible only if the configuration file on the boot
volume was edited manually, for example to modify the configuration later on without the need to rebuild
the fli4l archives.
331










