Re: error handling in %post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, September 2, 2006 11:27 am, Jeremy Lyon wrote:

> check
> out kickstart.py.  The Script class would probably be where this hook
> would be implemented
> It already grabs the return code, so it should be pretty easy to come up
> with
> a scheme of return codes that would allow %post scripters to utilize this
> functionality.

I'm not sure it would be as simple as that.  This could trigger some
action at the end of the script, based on the _return_ code, but the key
thing in my mind anyway, is the ability to do this (stop and provide a
shell prompt) anywhere within %pre/%post, and then be able to return to
that point in the script where you left.  Otherwise, as someone pointed
out, there wouldn't be much gained over just not rebooting at the end, and
switching to tty2.

I'd like to be able to do something like this:

%post
...
some-command
if [ $? != 0 ]; then
  debugError "some-command failed, opening interactive shell. Exit to
return to kickstart script"
fi
...more-stuff

'debugError' could be called from any interpreter.  And the message would
be displayed appropriately for text or graphical mode install, and the
interactive shell would be handled appropriately from either mode, not
sure what that would look like.  Switching to tty2 is not enough, since
you can't just 'exit' and return to the kickstart script.  It has to be a
shell spawned by debugError: exit, and debugError exits, and control
returns to %post.  Whether it should spawn a shell on a new tty (5 or 6?),
or open an xterm in graphical mode (don't know if that's feasible), I
don't know.

I appreciate your ideas and taking a look at the code.  You're probably
right that anaconda-devel is going to have to buy into this, hopefully
help with it...

-Ed


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux