Aborting and Resuming

LFScript 4 has been designed to make it easy to pause (abort) a build and resume it later. To resume a build, you only need to execute LFScript with the same options as before, and make sure that the  switch is set.

How to abort
You can abort the execution of LFScript at any time by pressing. LFScript will not stop immediately, but will perform some clean up first, which might take a couple of seconds.

The cleanup
LFScript has been designed to make various environmental changes invisible, but actually runs most of the time in a carefully set up chroot environment with bindings to important system data on your machine.

When aborting, LFScript will restore the environment and removes any temporary files and settings that were created during execution. So, it is very important you do not abort again while LFScript is restoring the system.

If you do so anyway, there will be unwanted traces of LFScript lurking around. Also, subsequent sessions of LFScript will spit out error messages indicating that temporary files or temporary usernames already exist.

Performing a manual clean-up
If you accidentally aborted the automatic clean-up process, or your system crashed while LFScript was executing, you need to restore your system by hand.

Reboot your system
First, reboot your system. This is the simplest way to remove the bindings that link the chroot environment with your system.

Remove (as root) the builddir.#.tmp folder
This completely removes the temporary system used by the aborted LFScript session, possibly freeing several gigabytes of space. Be sure to check the subfolder 'sources/buildmgr/packages' for any completed packages you want to save, and copy them to the appropriate 'packages' folder in LFScript's working directory, before you remove this folder.

If you were running LFScript from a live cd, you now have restored your system and can ignore the next sections.

Remove temporary symlinks in the root filesystem
Remove the  symlink on your system, then inspect the buildbase.lfs script for your base system to find out additional   and delete them. These should only be symlinks, and in most cases (LFS) will be only.

Delete the build user
Inspect the buildbase.lfs script for your base system to find out the name of the. Then issue (as root):

userdel -r

After this, you have restored your system and should be able to run LFScript again.