Package Building Procedures
Prev |  | Next

# 6 Interrupting a Build

Interrupting a build is a bit messy. First you need to identify the tty in which it's running (either record the output of tty(1) when you start the build, or use `ps x` to identify it. You need to make sure that nothing else important is running in this tty, e.g. `ps -t p1` or whatever. If there is not, you can just kill off the whole term easily with `pkill -t pts/1`; otherwise issue a `kill -HUP` in there by, for example, `ps -t pts/1 -o pid= | xargs kill -HUP`. Replace `p1` by whatever the tty is, of course.

The package builds dispatched by `make` to the client machines will clean themselves up after a few minutes (check with `ps x` until they all go away).

If you do not kill make(1), then it will spawn more jobs. If you do not kill `dopackages`, then it will restart the entire build. If you do not kill the `pdispatch` processes, they'll keep going (or respawn) until they've built their package.

To free up resources, you will need to clean up client machines by running `build cleanup` command. For example:

    % /var/portbuild/scripts/build cleanup i386 8-exp 20080714120411 -full

If you forget to do this, then the old build `chroot`s will not be cleaned up for 24 hours, and no new jobs will be dispatched in their place since `pointyhat` thinks the job slot is still occupied.

To check, `cat ~/loads/*` to display the status of client machines; the first column is the number of jobs it thinks is running, and this should be roughly concordant with the load average. `loads` is refreshed every 2 minutes. If you do `ps x | grep pdispatch` and it's less than the number of jobs that `loads` thinks are in use, you're in trouble.

You may have problem with the `umount` commands hanging. If so, you are going to have to use the `allgohans` script to run an ssh(1) command across all clients for that buildenv. For example:

    ssh -l root gohan24 df

will get you a df, and

    allgohans "umount -f pointyhat.freebsd.org:/var/portbuild/i386/8-exp/ports"
    allgohans "umount -f pointyhat.freebsd.org:/var/portbuild/i386/8-exp/src"

are supposed to get rid of the hanging mounts. You will have to keep doing them since there can be multiple mounts.

> Note: Ignore the following:

>     umount: pointyhat.freebsd.org:/var/portbuild/i386/8-exp/ports: statfs: No such file or directory
>     umount: pointyhat.freebsd.org:/var/portbuild/i386/8-exp/ports: unknown file system
>     umount: Cleanup of /x/tmp/8-exp/chroot/53837/compat/linux/proc failed!
>     /x/tmp/8-exp/chroot/53837/compat/linux/proc: not a file system root directory

> The former 2 mean that that client did not have those mounted; the latter 2 are a bug.

> You may also see messages about `procfs`.

After you have done all the above, remove the ``${arch}`/lock` file before trying to restart the build. If you do not, `dopackages` will simply exit.

If you have to do a ports tree update before restarting, you may have to rebuild either `duds`, `INDEX`, or both. If you are doing the latter manually, you will also have to rebuild `packages/All/Makefile` via the `makeparallel` script.

Prev | Home | Next
Anatomy of a Build |  | Monitoring the Build

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.