Technical data

8. Documentation for Developers
the first argument of the begin_script-call (Page 319)). If no suitable medium should exist
(which may well be), /var/lib/persistent is a directory in the RAM disk.
Please note that the path returned by map2persistent is not created automatically The
caller has to do that by himself (ie. by calling mkdir -p <path>).
The file /var/run/persistent.conf allows for checking if persistent data storage is possible.
Example:
. /var/run/persistent.conf
case $SAVETYPE in
persistent)
echo "persistent data storage is possible!"
;;
transient)
echo "persistent data storage is NOT possible!"
;;
esac
8.4.4. Debugging
For startup scripts it is often useful to run them in debug mode in a shell when you are in
need to determine where they fail. For this purpose, insert the following at the beginning and
at the end:
begin_script <OPT-Name> "start message"
<script code>
end_script
At the start and at the end of the script the specified text will now appear, preceded by
“finished”.
If you want to debug the scripts, you must do two things:
1. You have to set DEBUG_STARTUP (Page 30) to “yes”.
2. You have to activate debugging for the OPT. This is usually done by the entry
<OPT-Name>_DO_DEBUG='yes'
in the config file.
7
What happens during runtime is now displayed in detail on screen.
Further Variables helpful for Debugging
DEBUG_ENABLE_CORE This variable allows the creation of “Core-Dumps”. If a program
crashes due to an error an image of the current state in the file system is stored which can
be used to analyse the problem. The core dumps are stored under /var/log/dumps/.
DEBUG_IP Activating this variable will log all calls of the program ip.
DEBUG_IPUP Setting this variable to “yes” will log all executed instructions of the ip-up-
and ip-down-scripts to syslog.
7
Sometimes multiple start-scripts are used, which then have different names for their debug-variables. Have a
quick look at the scripts for clarification.
319