Mar 292013
 

Overview

This post covers building a server that will be used to update both ports and the base system on FreeBSD backend servers that don’t have access to the Internet. For ports it will use poudriere combined with the new pkgng package manager in order to build packages that will be distributed to the other servers using Nginx. Since Nginx is already there it will be used as a forward proxy, as opposed to reverse proxy as it’s usually used, to http://updates.freebsd.org and http://pkgbeta.freebsd.org. This covers freebsd-update and installing pkg on FreeBSD 9.X. For no good reason, just to do something different, there’s a cron job that runs every day and fetches auditfile.tbz from http://portaudit.freebsd.org if it’s changed, so that pkg audit can do it’s job properly. In order to remotely install the servers they are PXE booted into a net install image, mfsbsd, base install files are mirrored on the package repository and served by Nginx. With that, the environment is complete, servers can be installed and kept up to date without giving them any kind of access to the Internet.
Continue reading »

Mar 282013
 

Throwing this here mostly for myself. After repeated failures at installing FreeBSD 9.1 straight on ZFS, mostly because of typos, I decided to create a script to do it. It will probably be superfluous soon as FreeBSD 10 should be able to do it from the installer. There might be typos inside the script too.
I copied the script to an USB stick, booted from the FreeBSD cd, dropped into a shell, mounted the USB stick under /tmp/whatever (do NOT mount anywhere under /mnt), removed the exit line at the beginning and executed.
It creates partitions, installs FreeBSD, modifies loader.conf, rc.conf, periodic.conf and fstab and exits. Server should be ready for reboot at this point. Compiled from several HOW-TOs around the Internet.
Continue reading »

Mar 182013
 

Problem: setting CARP on an interface that is set by DHCP on FreeBSD leaves the carp interface locked in INIT state after reboot:

results in:

No IP on carp0, the interface isn’t working.

Solution: add synchronous_dhclient="YES":

Alternatively:

RTFM: “By default, DHCP configuration on FreeBSD runs in the background, or asynchronously. Other startup scripts continue to run while DHCP completes, speeding up system startup.”