[fai4.0] How to force nfsroot to _not_ reboot after installation?

Thomas Neumann blacky+fai at fluffbunny.de
Mon Jul 9 18:50:54 CEST 2012


Hello again
 
> FAI 3.x had the FAI_FLAG 'reboot' which enabled automatic reboot after the
> installation has completed. With FAI 4.0 my nfsroot always reboots after
> 'scripts/' has run.

[...]

> Has this changed? The changelog doesn't seem to mention this.

*digging around in the code*

---------------------------------------------------------------------------
task_faiend() {
[...]
    # reboot/halt without prompting if FAI_FLAG reboot or halt is set and errors are found
    # wait for keypress if error is found and neither flag reboot nor halt is set
    if [ -s $LOGDIR/error.log -a "$flag_reboot" -eq 0 -a "$flag_halt" -eq 0 ]; then
        echo "Press <RETURN> to reboot."
        read
    else
        sleep 10
    fi
[...]
        #reboot or halt?
        if [ "$flag_halt" -gt "0" ]; then
            echo "exec halt -dfp" >> $target/tmp/rebootCD
        else
            echo "exec reboot -df" >> $target/tmp/rebootCD
        fi
[...]
---------------------------------------------------------------------------
-- /usr/lib/fai/subroutines

Hmm. So if no error occurs, then the install client will ALWAYS reboot,
even if no reboot flag is set. If it is set, then it doesn't matter. If
halt is set, then the system will shutdown instead of reboot. (If both
are set, then the client will shutdown.)

If an error occurs, then the install client will only reboot/halt if the
flag is set. If no flag is set, then it does nothing. If the flag is set
it will always perfom the reboot/halt regardless of the error state.

! This also means it is not possible to tell the install client to shut
! itself down but only if no error occured.

Hmm. Works as documented.
Doesn't work as expected.

Maybe I never had a faultless installation before? Now that I think about
it, there was this pcspeaker module load error which I simply ignored.

@Thomas:
Is it too late to request some behaviour change for 4.x?

Something along the line of:
<no flag>    - system will not reboot/shutdown
reboot       - system reboots if no error occured
halt         - system shuts down if no error occured
force-reboot - system reboots regardless of errors
force-halt   - system shuts down regardless of errors

If it is too late, then at least change FAI documentation '6.10' from

 6.10. Reboot the new installed system

 At last the system is automatically rebooted if "reboot" was added
 to $FAI_FLAGS. [...]

into something like

 6.10. Reboot the new installed system

 At last the system is automatically rebooted if no error occured
 during the installation. Optionally it is possible to shutdown the
 client instead by adding "halt" to $FAI_FLAGS.

 Please note: Adding the flags 'reboot' or 'halt' will always reboot
 or shutdown the install client regardless of any errors.

 [...]
 
tschüß
thomas


More information about the linux-fai mailing list