Univention Bugzilla – Bug 31683
No connection to LDAP server causes image to be always mounted read-writeable
Last modified: 2014-12-10 12:09:22 CET
The initramfs script ucc mounts the image RO or RW depending on several options. To get the correct setting it calls the script get_boot_mount_option.sh. This script checks the LDAP for a value, then the local ucr config, and returns 'RW' if nothing is configured otherwise.
The script however is executed with 'bash -e'. When trying to determine the LDAP value (by calling univention-ucc-boot-option) and the LDAP server cannot be reached (Because it is down, or because the local network is down, ...), univention-ucc-boot-option exits with an error value, which causes the shellscript to terminate immediately.
get_boot_mount_option.sh should not be started with bash -e.
(In reply to Erik Damrose from comment #0)
> get_boot_mount_option.sh should not be started with bash -e.
The error could be handled and then bash -e is OK. I think we should use bash -e in these scripts, since we do a lot of stuff which can break the installation for example the partitioning or the detection if the partition should be repeated.
univention-ucc-boot-option returns the requested value if everything works fine, and an error string otherwise.
get_boot_mount_option.sh should always return something sensible, as its output is directly used for a variable value in the initramfs.
The script now catches the following errors:
- univention-ucc-boot-option aborts with an error
- the UCR variable ucc/boot/mount is not set
The errors are logged to stderr.
If both errors occur, 'rw' is returned as a last resort. This is how the script should have worked to begin with.
r49671 univention-ucc-initramfs 3.0.0-17
Works for tc (ro if ldap is available or not) and desktop image (rw if ldap is available or not).
UCC 2.0 has been released:
If this error occurs again, please use "Clone This Bug".