Can a hook abort a FAI install?
andrew at etc.gen.nz
Wed Sep 17 02:36:47 CEST 2014
On Mon, 2014-09-15 at 10:19 +0200, Steffen Grunewald wrote:
> On Mon, Sep 15, 2014 at 10:29:04AM +1200, Andrew Ruthven wrote:
> > Hey,
> > Is it possible to make an install abort from within a hook? Looking at
> > the code it doesn't seem obvious.
> What would "abort" mean? Leave the PXE boot file in place, and just
> sit there and wait? Shut down?
Ideally sit there and wait for human intervention.
> A couple of years I had to "reboot" inside a hook when it detected
> the wrong RAID configuration (after fixing that, of course) - to get
> the hw detection read the right disk names for the install. I can't
> see a reason why a shutdown wouldn't work as well - you'd lose the
> install log though. Of course you may make the hook run into a loop
> of beeps suggesting to ssh into the machine, and check the last lines
> of fai.log ... depends on your environment (beeps are hardly audible
> if there are 100s of other machine humming next to this one).
The recommendation I've received via IRC is to call "task_error 800" or
a higher number.
> > I've added a hook for extrbase to check and make sure if a require
> > basefile is present (namely Ubuntu ones if we're building an Ubuntu
> > box), and if not present it'll spit an error. Ideally I'd just abort the
> > install.
> Doesn't extrbase do such a check itself, and throw an error code
> which can be seen on faimond's output?
I expect so, but in this case the default debootstrap tarball is
present, but it is Debian as I'm using a Wheezy NFS root to build all my
types of host (including Ubuntu). My FAI setup then attempts a
dist-upgrade to Ubuntu from Debian. This is fraught with pain and
requires tender loving care. In this scenario, if the Ubuntu basefile is
missing, I want it to just abort.
The reason this may happen is that I use FAI to build other FAI hosts
for going into clusters and there was a bug which meant the required
basefiles weren't getting deployed. I've fixed that bug, but want a belt
and braces approach.
More information about the linux-fai