<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kb.hurricane-ridge.com &#187; FreeBSD</title>
	<atom:link href="http://kb.hurricane-ridge.com/category/os/freebsd/feed" rel="self" type="application/rss+xml" />
	<link>http://kb.hurricane-ridge.com</link>
	<description>My personal - but public - knowledge base</description>
	<lastBuildDate>Mon, 09 Jan 2012 14:49:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting SCSI Timeout Values for FreeBSD VMs on VMware/NetApp</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/setting-scsi-timeout-values-for-freebsd-vms-on-vmwarenetapp</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/setting-scsi-timeout-values-for-freebsd-vms-on-vmwarenetapp#comments</comments>
		<pubDate>Wed, 23 Jun 2010 23:07:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[fibre channel]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[NTAP]]></category>
		<category><![CDATA[scsi]]></category>
		<category><![CDATA[sysctl]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=969</guid>
		<description><![CDATA[NetApp requires setting a timeout value of 190 seconds for all VMware data stores on their filers to handle &#8220;long fabric or storage-side I/O interruptions&#8221;; this is done as follows on FreeBSD: This can be set permanently in /etc/sysctl.conf: Elsewhere, I have seen a recommendation for FreeBSD on ESX that kern.cam.da.retry_count be set to 120.]]></description>
			<content:encoded><![CDATA[<p>NetApp <a href="https://now.netapp.com/Knowledgebase/solutionarea.asp?id=kb41511">requires</a> setting a timeout value of 190 seconds for all VMware data stores on their filers to handle &#8220;long fabric or storage-side I/O interruptions&#8221;; this is done as follows on FreeBSD:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
# sysctl kern.cam.da.default_timeout=190
</pre>
<p>This can be set permanently in /etc/sysctl.conf:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
kern.cam.da.default_timeout=190
</pre>
<p>Elsewhere, I have seen a <a href="https://www.dan.me.uk/blog/2009/05/24/freebsd-with-esx/">recommendation</a> for FreeBSD on ESX that kern.cam.da.retry_count be set to 120.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/setting-scsi-timeout-values-for-freebsd-vms-on-vmwarenetapp/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Passing options to the Exim port on FreeBSD</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/passing-options-to-the-exim-port-on-freebsd</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/passing-options-to-the-exim-port-on-freebsd#comments</comments>
		<pubDate>Wed, 31 Dec 2008 20:20:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[portupgrade]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=70</guid>
		<description><![CDATA[The Exim port on FreeBSD does not have a menu-driven configuration system accessible by running make config, although it does have a plethora of options described in /usr/ports/mail/exim/options.  If using portupgrade, you can pass these options with the -m flag; for example: # portupgrade -m "WITH_CONTENT_SCAN=yes WITH_SASLAUTHD=yes WITH_DOMAINKEYS=yes" exim]]></description>
			<content:encoded><![CDATA[<p>The Exim port on FreeBSD does not have a menu-driven configuration system accessible by running <code>make config</code>, although it does have a plethora of options described in <code>/usr/ports/mail/exim/options</code>.  If using portupgrade, you can pass these options with the <code>-m</code> flag; for example:</p>
<pre><code># portupgrade -m "WITH_CONTENT_SCAN=yes WITH_SASLAUTHD=yes WITH_DOMAINKEYS=yes" exim</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/passing-options-to-the-exim-port-on-freebsd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reloading and Testing pf rulesets</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/reloading-and-testing-pf-rulesets</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/reloading-and-testing-pf-rulesets#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:31:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[pf]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=58</guid>
		<description><![CDATA[To test the ruleset in /etc/pf.conf, do the following: sudo pfctl -n -f /etc/pf.conf sudo pfctl -n -v -f /etc/pf.conf The second pfctl command displays the rules you&#8217;ve created; however, it can be easy to miss a syntax error warning in the verbosity &#8211; the first command will make it easy to spot those. You can [...]]]></description>
			<content:encoded><![CDATA[<p>To test the ruleset in <code>/etc/pf.conf</code>, do the following:</p>
<p><code>sudo pfctl -n -f /etc/pf.conf<br />
sudo pfctl -n -v -f /etc/pf.conf</code></p>
<p>The second pfctl command displays the rules you&#8217;ve created; however, it can be easy to miss a syntax error warning in the verbosity &#8211; the first command will make it easy to spot those.</p>
<p>You can test the ruleset by having a second, completely open firewall ruleset that you can revert to called <code>pf.conf-open</code> containing just:</p>
<p><code>pass all</code></p>
<p>Then do the following, as root:</p>
<p><code>pfctl -f /etc/pf.conf; sleep 90; pfctl -f /etc/pf-open.conf</code></p>
<p>When you&#8217;re ready to reload the ruleset permanently, use the FreeBSD start/stop script:</p>
<p><code>sudo /etc/rc.d/pf reload</code></p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/reloading-and-testing-pf-rulesets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD Jail Upgrade Instructions</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/freebsd-jail-upgrade-instructions</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/freebsd-jail-upgrade-instructions#comments</comments>
		<pubDate>Mon, 29 Dec 2008 19:10:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[jail]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=51</guid>
		<description><![CDATA[When upgrading via a patch, installing the patch can be done by adding a &#8220;DESTDIR&#8221; argument to make:# make install DESTDIR=/u1/jail/192.168.0.12 When upgrading from source (Adapted from Upgrading a Jail from Source):# setenv JAIL /u1/jail/192.168.0.12 # mergemaster -pd -D $JAIL # cd /usr/src &#38;&#38; make installworld DESTDIR=$JAIL # mergemaster -svd -D $JAIL]]></description>
			<content:encoded><![CDATA[<ul>
<li>When upgrading via a patch, installing the patch can be done by adding a &#8220;DESTDIR&#8221; argument to make:<code># make install DESTDIR=/u1/jail/192.168.0.12</code></li>
<li>When upgrading from source (Adapted from <a href="http://memberwebs.com/nielsen/freebsd/jails/docs/jail_upgrade.html">Upgrading a Jail from Source</a>):<code># setenv JAIL /u1/jail/192.168.0.12<br />
# mergemaster -pd -D $JAIL<br />
# cd /usr/src &amp;&amp; make installworld DESTDIR=$JAIL<br />
# mergemaster -svd -D $JAIL</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/freebsd-jail-upgrade-instructions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing rc_conf_files on FreeBSD</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/editing-rc_conf_files-on-freebsd</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/editing-rc_conf_files-on-freebsd#comments</comments>
		<pubDate>Mon, 29 Dec 2008 19:09:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=49</guid>
		<description><![CDATA[In FreeBSD&#8217;s /etc/default/rc.conf, the location of the rc.conf system configuration files is defined in the variable rc_conf_files. If you&#8217;re modularizing your rc.conf files &#8211; say, for use with Cfengine &#8211; you may be tempted to change the value of rc_conf_files in /etc/rc.conf or/etc/rc.conf.local. However, this change will not be picked up by itself &#8211; you need to call source_rc_confs after changing rc_conf_files, similar to this: rc_conf_files="/etc/rc.conf /etc/rc.conf.local /etc/rc.conf.amd" [...]]]></description>
			<content:encoded><![CDATA[<p>In FreeBSD&#8217;s <code>/etc/default/rc.conf</code>, the location of the <code>rc.conf</code> system configuration files is defined in the variable <code>rc_conf_files</code>. If you&#8217;re modularizing your <code>rc.conf</code> files &#8211; say, for use with Cfengine &#8211; you may be tempted to change the value of <code>rc_conf_files</code> in <code>/etc/rc.conf</code> or<code>/etc/rc.conf.local</code>. However, this change will not be picked up by itself &#8211; you need to call <code>source_rc_confs</code> after changing <code>rc_conf_files</code>, similar to this:</p>
<p><code>rc_conf_files="/etc/rc.conf /etc/rc.conf.local /etc/rc.conf.amd"<br />
source_rc_confs<br />
</code></p>
<p>(Tip seen on the <a href="http://lists.freebsd.org/pipermail/freebsd-ports/2004-May/012879.html">freebsd-ports</a> list.)</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/editing-rc_conf_files-on-freebsd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overriding portaudit&#8217;s known vulnerabilities check</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/overriding-portaudits-known-vulnerabilities-check</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/overriding-portaudits-known-vulnerabilities-check#comments</comments>
		<pubDate>Mon, 29 Dec 2008 19:07:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=47</guid>
		<description><![CDATA[When attempting to upgrade a port on FreeBSD, you may run into a problem like this: &#62; sudo portupgrade -rR php5 ---&#62; Upgrading 'php5-5.1.6' to 'php5-5.1.6_1' (lang/php5) ---&#62; Building '/usr/ports/lang/php5' ===&#62; Cleaning for autoconf-2.59_2 ===&#62; Cleaning for pkg-config-0.21 ===&#62; Cleaning for libxml2-2.6.26 ===&#62; Cleaning for perl-5.8.8 ===&#62; Cleaning for m4-1.4.4 ===&#62; Cleaning for help2man-1.36.4_1 ===&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>When attempting to upgrade a port on FreeBSD, you may run into a problem like this:</p>
<p><code>&gt; sudo portupgrade -rR php5<br />
---&gt; Upgrading 'php5-5.1.6' to 'php5-5.1.6_1' (lang/php5)<br />
---&gt; Building '/usr/ports/lang/php5'<br />
===&gt; Cleaning for autoconf-2.59_2<br />
===&gt; Cleaning for pkg-config-0.21<br />
===&gt; Cleaning for libxml2-2.6.26<br />
===&gt; Cleaning for perl-5.8.8<br />
===&gt; Cleaning for m4-1.4.4<br />
===&gt; Cleaning for help2man-1.36.4_1<br />
===&gt; Cleaning for gmake-3.81_1<br />
===&gt; Cleaning for libiconv-1.9.2_2<br />
===&gt; Cleaning for p5-gettext-1.05_1<br />
===&gt; Cleaning for gettext-0.14.5_2<br />
===&gt; Cleaning for libtool-1.5.22_2<br />
===&gt; Cleaning for php5-5.1.6_1<br />
===&gt; php5-5.1.6_1 has known vulnerabilities:<br />
=&gt; php -- open_basedir Race Condition Vulnerability.<br />
Reference: &lt;http://www.FreeBSD.org/ports/portaudit/edabe438-542f-11db-a5ae-00508d6a62df.html&gt;<br />
=&gt; Please update your ports tree and try again.<br />
*** Error code 1<br />
Stop in /usr/ports/lang/php5.</code></p>
<p>Portaudit has stopped your portupgrade because one of the ports you are installing has a known security vulnerability &#8211; it&#8217;s even handy enough to provide a link to more information.</p>
<p>But what if you are willing to accept or mitigate the risk of the security hole &#8211; how do you build the port without portaudit stopping you? The answer is the<code>-DDISABLE_VULNERABILITIES</code> flag:</p>
<p><code>&gt; sudo portupgrade -rR -m -DDISABLE_VULNERABILITIES php5<br />
Password:<br />
---&gt; Upgrading 'php5-5.1.6' to 'php5-5.1.6_1' (lang/php5)<br />
---&gt; Building '/usr/ports/lang/php5' with make flags: -DDISABLE_VULNERABILITIES<br />
===&gt; Cleaning for autoconf-2.59_2<br />
===&gt; Cleaning for pkg-config-0.21<br />
===&gt; Cleaning for libxml2-2.6.26<br />
===&gt; Cleaning for perl-5.8.8<br />
===&gt; Cleaning for m4-1.4.4<br />
===&gt; Cleaning for help2man-1.36.4_1<br />
===&gt; Cleaning for gmake-3.81_1<br />
===&gt; Cleaning for libiconv-1.9.2_2<br />
===&gt; Cleaning for p5-gettext-1.05_1<br />
===&gt; Cleaning for gettext-0.14.5_2<br />
===&gt; Cleaning for libtool-1.5.22_2<br />
===&gt; Cleaning for php5-5.1.6_1<br />
===&gt; Found saved configuration for php5-5.1.6_1<br />
[...]</code></p>
<p>Obviously, use the <code>-DDISABLE_VULNERABILITIES</code> flag with caution. Tip seen at <a href="http://taosecurity.blogspot.com/2004/05/disabling-vulnerability-checks-with.html">TaoSecurity</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/overriding-portaudits-known-vulnerabilities-check/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for modified files in installed FreeBSD ports or packages</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/checking-for-modified-files-in-installed-freebsd-ports-or-packages</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/checking-for-modified-files-in-installed-freebsd-ports-or-packages#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:42:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=45</guid>
		<description><![CDATA[When upgrading FreeBSD ports, you will lose any customizations that you&#8217;ve made to files within the port; this is especially problematic with configuration files. A quick and easy way to check for modifications you may have made is to use the -g flag to pkg_info. For example: &#62; pkg_info -g -x drupal Information for drupal-4.6.9: Mismatched Checksums: /usr/local/www/drupal/.htaccess [...]]]></description>
			<content:encoded><![CDATA[<p>When upgrading FreeBSD ports, you will lose any customizations that you&#8217;ve made to files within the port; this is especially problematic with configuration files. A quick and easy way to check for modifications you may have made is to use the <code>-g</code> flag to <code>pkg_info</code>. For example:</p>
<p><code>&gt; pkg_info -g -x drupal<br />
Information for drupal-4.6.9:</code></p>
<p><code>Mismatched Checksums:<br />
/usr/local/www/drupal/.htaccess fails the original MD5 checksum</code></p>
<p>In this case, you might want to preserve your <code>.htaccess</code> file to merge it back in to your drupal installation after upgrading.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/checking-for-modified-files-in-installed-freebsd-ports-or-packages/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building FreeBSD Ports as an Unprivileged User</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/building-freebsd-ports-as-an-unprivileged-user</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/building-freebsd-ports-as-an-unprivileged-user#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:40:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=41</guid>
		<description><![CDATA[Set the following in /etc/make.conf: WRKDIRPREFIX=/home/anl/ports-build DISTDIR=/home/anl/ports-dist WRKDIRPREFIX is a directory that the unprivileged user as able to write to; DISTDIR is the directory their downloads of source files are written to. If the port you are building requires another port to be installed for it to be built, you will be prompted for the root password, so this [...]]]></description>
			<content:encoded><![CDATA[<p>Set the following in <code>/etc/make.conf</code>:</p>
<p><code>WRKDIRPREFIX=/home/anl/ports-build<br />
DISTDIR=/home/anl/ports-dist</code></p>
<p><code>WRKDIRPREFIX</code> is a directory that the unprivileged user as able to write to; <code>DISTDIR</code> is the directory their downloads of source files are written to.</p>
<p>If the port you are building requires another port to be installed for it to be built, you will be prompted for the root password, so this technique is not suitable for unattended port installations.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/building-freebsd-ports-as-an-unprivileged-user/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Index of Sysctl Definitions</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/index-of-sysctl-definitions</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/index-of-sysctl-definitions#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:37:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[openbsd]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=38</guid>
		<description><![CDATA[EnderUNIX has a large glossary of user-contributed sysctl definitions.]]></description>
			<content:encoded><![CDATA[<p><a href="http://sysctl.enderunix.org/">EnderUNIX</a> has a large glossary of user-contributed sysctl definitions.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/index-of-sysctl-definitions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a chrooted BIND in a FreeBSD Jail</title>
		<link>http://kb.hurricane-ridge.com/os/freebsd/running-a-chrooted-bind-in-a-freebsd-jail</link>
		<comments>http://kb.hurricane-ridge.com/os/freebsd/running-a-chrooted-bind-in-a-freebsd-jail#comments</comments>
		<pubDate>Mon, 29 Dec 2008 05:17:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=31</guid>
		<description><![CDATA[(N.B. &#8211; This document was originally written in 2006; I have not verified that it remains applicable to FreeBSD in 2008.) Running a chrooted BIND server within a FreeBSD jail requires mounting its devfs outside of the jail; this document provides an RCng start stop script to do that. Attempting to start BIND using the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>(N.B. &#8211; This document was originally written in 2006; I have not verified that it remains applicable to FreeBSD in 2008.)</strong></p>
<p>Running a chrooted BIND server within a FreeBSD jail requires mounting its devfs outside of the jail; this document provides an RCng start stop script to do that.</p>
<p>Attempting to start BIND using the stock RCng script in a FreeBSD jail results in the following error:</p>
<p><code>&gt; sudo /etc/rc.d/named start<br />
mount_devfs: Operation not permitted<br />
/etc/rc.d/named: WARNING: devfs_domount(): Unable to mount devfs on /var/named/dev<br />
devfs rule: ioctl DEVFSIO_RAPPLY: Operation not permitted<br />
devfs rule: ioctl DEVFSIO_RAPPLY: Operation not permitted<br />
Starting named.</code></p>
<p>The reason for this is that you are unable to mount and manipulate the devfs for the chroot within the jail itself; it must be done in the parent of the jail. To do this at boot, the script below can be used.</p>
<p><code>#!/bin/sh</code></p>
<p><code># PROVIDE: jailedchrootdevfs<br />
# REQUIRE: rcconf mountcritremote<br />
# BEFORE: jail<br />
# KEYWORD: nojail</code></p>
<p><code>. /etc/rc.subr</code></p>
<p><code>name="jailed-chroot-devfs"<br />
start_cmd='start'<br />
stop_cmd=':'<br />
#rc_debug=1</code></p>
<p><code>jailed_named_chrootdir='/u1/jail/192.168.1.234/var/named'<br />
start()<br />
{<br />
umount ${jailed_named_chrootdir}/dev 2&gt;/dev/null<br />
devfs_domount ${jailed_named_chrootdir}/dev devfsrules_hide_all<br />
devfs -m ${jailed_named_chrootdir}/dev rule apply path null unhide<br />
devfs -m ${jailed_named_chrootdir}/dev rule apply path random unhide<br />
}</code></p>
<p><code>load_rc_config $name<br />
run_rc_command "$1"</code></p>
<p>Next, within the jail, edit <code>/etc/rc.d/named</code> to comment out the equivalent lines to those above, found within the <code>chroot_autoupdate()</code> function:</p>
<p><code>*** named Thu Feb 23 12:34:41 2006<br />
--- ../../../../../etc/rc.d/named Thu Nov 3 00:12:06 2005<br />
***************<br />
*** 58,67 ****</code></p>
<p><code># Mount a devfs in the chroot directory if needed<br />
#<br />
! #umount ${named_chrootdir}/dev 2&gt;/dev/null<br />
! #devfs_domount ${named_chrootdir}/dev devfsrules_hide_all<br />
! #devfs -m ${named_chrootdir}/dev rule apply path null unhide<br />
! #devfs -m ${named_chrootdir}/dev rule apply path random unhide</code></p>
<p><code># Copy local timezone information if it is not up to date.<br />
#<br />
--- 58,67 ----</code></p>
<p><code># Mount a devfs in the chroot directory if needed<br />
#<br />
! umount ${named_chrootdir}/dev 2&gt;/dev/null<br />
! devfs_domount ${named_chrootdir}/dev devfsrules_hide_all<br />
! devfs -m ${named_chrootdir}/dev rule apply path null unhide<br />
! devfs -m ${named_chrootdir}/dev rule apply path random unhide</code></p>
<p><code># Copy local timezone information if it is not up to date.<br />
#</code></p>
<p>Notes on the RCng script:</p>
<ul>
<li>Specifiying that the RCng script run BEFORE: jail ensures that the directory is mounted before the jail starts up, and starts its BIND process.</li>
<li>The devfs commands in <code>start()</code> are adapted from the <code>/etc/rc.d/named</code>script.</li>
<li><code>/etc/rc.subr</code> contains the <code>devfs_domount</code> subroutine; <code>load_rc_config $name</code> is required to load the devfs variables it needs to work.</li>
</ul>
<p>Other notes:</p>
<ul>
<li>You will need to set the <code>security.jail.allow_raw_sockets</code> sysctl to 1 to allow named to open a UDP socket.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/os/freebsd/running-a-chrooted-bind-in-a-freebsd-jail/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

