Chapter 6 Maintenance

To obtain the version of Tinderbox, run:

# cd ${pb}/scripts && ./tc tbversion

This command simply cats .version in ${pb}. .version is created during distfile generation. If the contents of the Tinderbox distribution are copied to another location, make sure that .version is copied as well.

To update existing Jails:

# cd ${pb}/scripts && ./tc makeJail -j 9.2

The output of the Jail build will go to stdout. The output of update (e.g cvsup) will go to ${pb}/jails/{JAIL}/update.log (where {JAIL} is the name of the Jail in question).

To update existing PortsTrees, use tc with the updatePortsTree command. For example:

# cd ${pb}/scripts && ./tc updatePortsTree -p FreeBSD

If you want to clone various aspects of an existing Build, use the tc application with the copyBuild command. For example:

# cd ${pb}/scripts && ./tc copyBuild -s 9.2-FreeBSD -d 10-FreeBSD

The source and destination Builds (i.e. 9.2-FreeBSD and 10-FreeBSD respectively in this example) must already exist. By default, copyBuild will copy the environment file, OPTIONS, and ports from the source Build to the destination Build. It can also optionally copy ccache data and packages. The options supported by copyBuild are in Table 6-1.

Table 6-1. copyBuild Options

-sSource Build name
-dDestination Build name
-c(optional) copy ccache data
-E(optional) do NOT copy environment files
-O(optional) do NOT copy OPTIONS data
-P(optional) do NOT copy ports
-p(optional) copy packages (including last build status, version, and size)

To remove a Build, use tc with the rmBuild command, followed by removal of all directories created for the build:

# cd ${pb}/scripts && ./tc rmBuild -b {BUILD}
# for dir in "" builds errors logs options packages ; \
  do rm -r ${pb}/${dir}/{BUILD}; done

After a Build has been removed, you may also wish to remove the PortsTree and Jail:

# cd ${pb}/scripts && ./tc rmPortsTree -p {PORTSTREE}
# rm -r ${pb}/portstrees/{PORTSTREE}
# cd ${pb}/scripts && ./tc rmJail -j {JAIL}
# rm -r ${pb}/jail/{JAIL}

Over time, Builds may become cluttered with old log files and packages. To cleanup old, unreferenced, files, use ${pb}/scripts/tc with the tbcleanup command:

# cd ${pb}/scripts && ./tc tbcleanup

The tbcleanup command supports a few arguments which will tell it to perform additional cleanups, described in Table 6-2.

Table 6-2. tbcleanup Options

-dCleanup unreferenced distfiles from the distfile cache
-EDo NOT remove old error logs (regular port build logs are still removed)
-pCleanup stale packages

If you want to terminate a running tinderbuild, run the command:

# cd ${pb}/scripts && ./tc tbkill -b {BUILD}

This will gracefully terminate a running tinderbuild for Build {BUILD}. If you want to force the tinderbuild to die, then specify the kill signal:

# cd ${pb}/scripts && ./tc tbkill -b BUILD -s 9

Note: It may take a few minutes after executing a graceful termination of the tinderbuild before all processes exit. This is because the processes are cleaning up the build environment. If, after five minutes, the build is still running, then you should consider killing it with signal 9.