stagedir vs. jail

Dewayne dewayne.geraghty at
Tue Oct 15 15:07:19 UTC 2013

On 15/10/2013 2:41 AM, Scot Hetzel wrote:
> On Sun, Oct 13, 2013 at 9:27 AM, Dewayne
> <dewayne.geraghty at> wrote:
>> My setup is slightly different, where I do use as Matthew recommends,
>> nullfs is used without symlinks; and pkg_* and portmaster are used for
>> the build process.  We've been using jails to build ports for different
>> architectures for years, the builds are currently on a FreeBSD 9.2Stable
>> (Built from source on Oct 8) system.
>> Building all ports after a complete wipe,  using the portmaster commands
>> fails due to missing file
>> + portmaster --no-term-title --no-confirm -H -K -D -g -G -B -v -m
>> __MAKE_CONF=/etc/make_P3.conf -m -DBUILD__PRODUCTION mail/sendmail
>> tar: etc/rc.d/saslauthd: Cannot stat: No such file or directory
>> tar: Error exit delayed from previous errors.
>> pkg_create: make_dist: tar command failed with code 256
>> In fact the file does exist:
>> # ls -lh /usr/staging/usr/local/etc/rc.d/saslauthd
>> -r-xr-xr-x  1 root  wheel   940B Oct 14 00:55
>> /usr/staging/usr/local/etc/rc.d/saslauthd
>> and not in /usr/local/etc/rc.d/
>> As you can see sendmail builds saslauthd as a prerequisite.  The build
>> process also fails in the same way, missing file in etc/rc.d/... for
>> samba36, samba4, isc-dhcp42-server and cyrus-sasl2-saslauthd, but works
>> correctly for some 40 other packages.
>> The make.conf includes:
>> WRKDIRPREFIX=/var/ports
>> DISTDIR=/distfiles
>> TMPDIR=/tmp
>> PACKAGES=/packages
>> STAGEDIR=/usr/staging
>> DEFAULT_VERSIONS=perl5=5.16 python=2.7 python2=2.7 apache=22
>> DISABLE_LICENSES=yes  # Not that I want to, only that it prevented the
>> build (a PR existed for this)
>> I suspect the problem lies within the if/then block ".if
>> !target(install-rc-script)" in, but lack the know-how to
>> proceed further.
> I have sent PR 182972 regarding this issue:
> The cause of the issue is due to setting STAGEDIR in /etc/make.conf
> and Mk/ not undefining STAGEDIR when NO_STAGE is set. Which
> causes the install-rc-script to look in the STAGEDIR for the file.
> Scot
> _______________________________________________
> freebsd-ports at mailing list
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at"
Thank-you Scott, the patch provided in the PR does fix the problem :)

I use pkg_*, portmaster and the portconf to customise 127 ports of the
507 used.  Its a pretty rudimentary setup which has been used to build
packages, for different architectures inside jails for many years. 

How is it that this type of problem isn't being picked up in testing
before being deployed in the live ports system?

If I don't set STAGEDIR inside /etc/make.conf where do I define it?

Unfortunately I didn't see your reply before I created this PR for those that were
continuing to have the problem and the ugly workaround. Though I'm very
pleased that it was addressed in the right place, which you have done :)

Appreciate your help.
Kind regards, Dewayne.

More information about the freebsd-ports mailing list