<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>funcptr - operations</title>
    <subtitle>An engineer&#x27;s technical notebook</subtitle>
    <link rel="self" type="application/atom+xml" href="https://funcptr.net/category/operations/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://funcptr.net/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2015-10-02T01:23:45+00:00</updated>
    <id>https://funcptr.net/category/operations/atom.xml</id>
    <entry xml:lang="en">
        <title>Mac OS X El Capitan Installer Removes Custom Group ID and Membership</title>
        <published>2015-10-02T01:23:45+00:00</published>
        <updated>2015-10-02T01:23:45+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2015/mac-os-x-el-capitan-removes-custom-group-id-and-membership/"/>
        <id>https://funcptr.net/2015/mac-os-x-el-capitan-removes-custom-group-id-and-membership/</id>
        
        <content type="html" xml:base="https://funcptr.net/2015/mac-os-x-el-capitan-removes-custom-group-id-and-membership/">&lt;p&gt;As always, after Apple releases their new operating system, my systems are
upgraded. This time the upgrade was less of a surprise in terms of what it
brings because I&#x27;d been beta testing the new release for the past couple of
weeks, however I was still caught off guard.&lt;&#x2F;p&gt;
&lt;p&gt;On OS X, by default all user accounts start at ID 501 and count up, so if you
have two accounts, you will have user ID 501 and 502 in use. For most people
they will most likely never change this, and all is well. The default group ID
for all new user accounts is &lt;code&gt;staff&lt;&#x2F;code&gt; which has a group ID of 20. So if you have
a single account named for example &lt;code&gt;janedoe&lt;&#x2F;code&gt; her user ID would be 501 and her
group ID would be 20 (&lt;code&gt;staff&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;Coming from a FreeBSD world and running a lot of FreeBSD systems, user accounts
start at 1001, and count up. When you create a new user account on FreeBSD, by
default that user is also added to a group with the same name as the username,
with the same ID. So you end up with an account with ID 1001 and default group
ID 1001. Using the same example, a user named &lt;code&gt;janedoe&lt;&#x2F;code&gt; would have a user ID of
1001, and a group ID of 1001 (&lt;code&gt;janedoe&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;When I first installed OS X, and almost every single new installation since, I
have followed these steps to change my user ID and group ID to match those on
my FreeBSD systems:&lt;&#x2F;p&gt;
&lt;ol start=&quot;0&quot;&gt;
&lt;li&gt;Assumption is that you have a separate user account other than the one you
are about to modify that you can temporarily use that has administrator
privileges on the local Mac; I create an &quot;Administrator&quot; account for that
reason.&lt;&#x2F;li&gt;
&lt;li&gt;System Preferences&lt;&#x2F;li&gt;
&lt;li&gt;Users and Groups&lt;&#x2F;li&gt;
&lt;li&gt;Click the &lt;code&gt;+&lt;&#x2F;code&gt; (You may need to click the lock in the bottom left first)&lt;&#x2F;li&gt;
&lt;li&gt;Change the dropdown to &lt;code&gt;group&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Enter Full Name: &lt;code&gt;janedoe&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Create group&lt;&#x2F;li&gt;
&lt;li&gt;Right click on group (&lt;code&gt;janedoe&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Advanced Options...&lt;&#x2F;li&gt;
&lt;li&gt;Change the Group ID to 1001&lt;&#x2F;li&gt;
&lt;li&gt;Okay&lt;&#x2F;li&gt;
&lt;li&gt;Right click on user (&lt;code&gt;janedoe&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Advanced Options...&lt;&#x2F;li&gt;
&lt;li&gt;Change User ID from &lt;code&gt;501&lt;&#x2F;code&gt; to &lt;code&gt;1001&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Change Group from &lt;code&gt;staff&lt;&#x2F;code&gt; to &lt;code&gt;janedoe&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Okay&lt;&#x2F;li&gt;
&lt;li&gt;Close System Preferences&lt;&#x2F;li&gt;
&lt;li&gt;Open Terminal, become root user (sudo su)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;cd &#x2F;Users&#x2F;janedoe&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;find . -uid 501 -print0 | xargs -0 chown 1001:1001&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This allows me to have the same user ID and group ID on both my Mac OS X and on
FreeBSD, thereby making it easier to use tools like rsync that keeps ownership
and permissions, as well as using NFS. Other ways to do something similar is
using LDAP&#x2F;Kerberos with shared directory service, but that is a little heavy
handed for a home network.&lt;&#x2F;p&gt;
&lt;p&gt;This has worked for me without issues since OS X 10.8, even upgrading from 10.8 to
10.9 and then 10.10 did not change anything. However as soon as I did the
upgrade to El Capitan (10.11) I noticed that all of my &lt;code&gt;ls -lah&lt;&#x2F;code&gt; output looked
like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;drwxr-xr-x+  13 xistence  1001   442B Oct  1 16:58 Desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;drwx------+  28 xistence  1001   952B Aug 31 12:17 Documents&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;drwx------+  89 xistence  1001   3.0K Oct  1 15:56 Downloads&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;drwx------@  72 xistence  1001   2.4K Oct  2 00:16 Library&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and &lt;code&gt;id&lt;&#x2F;code&gt; provided this valuable output:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid=1001(xistence) gid=20(xistence) groups=20(xistence),12(everyone),61(localaccounts),399(com.apple.access_ssh),402(com.apple.sharepoint.group.2),401(com.apple.sharepoint.group.1),100(_lpoperator)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wait, what happened to the &lt;code&gt;staff&lt;&#x2F;code&gt; group that I am supposed to be a member of,
and why is my &lt;code&gt;xistence&lt;&#x2F;code&gt; group ID now stating it is 20 and not 1001 as I was
expecting.&lt;&#x2F;p&gt;
&lt;p&gt;I wondered if the upgrade had messed up my group somehow, and it was
confirmed when I checked with &lt;code&gt;dscl&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ dscl . -read &#x2F;Groups&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password: *&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PrimaryGroupID: 20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RealName: xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordName: xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordType: dsRecTypeStandard:Groups&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Do note that the group &lt;code&gt;xistence&lt;&#x2F;code&gt; does not show up in &lt;em&gt;System Preferences&lt;&#x2F;em&gt; -&amp;gt;
&lt;em&gt;Users and Groups&lt;&#x2F;em&gt;, so we&#x27;ll have to do some command line magic.&lt;&#x2F;p&gt;
&lt;p&gt;Well, that&#x27;s worrisome, why is this matching a built-in group&#x27;s ID? Specifically
let&#x27;s check the &lt;code&gt;staff&lt;&#x2F;code&gt; group and make sure it still has the appropriate group
ID.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ dscl . -read &#x2F;Groups&#x2F;staff&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GroupMembership: root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password: *&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PrimaryGroupID: 20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RealName: Staff&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordName: staff BUILTIN\Users&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordType: dsRecTypeStandard:Groups&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next I had to check to see what my user account was set to as the default group
ID:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ dscl . -read &#x2F;Users&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NFSHomeDirectory: &#x2F;Users&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password: ********&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PrimaryGroupID: 20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RealName:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Delta Regeer&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordName: xistence delta@regeer.org com.apple.idms.appleid.prd.53696d524c62372b48344a53755864634e4f374b32513d3d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RecordType: dsRecTypeStandard:Users&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UniqueID: 1001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UserShell: &#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Well, that is not entirely what I was expecting either, at last it didn&#x27;t touch
my user ID. Time to fix things.&lt;&#x2F;p&gt;
&lt;p&gt;First let&#x27;s change the &lt;code&gt;xistence&lt;&#x2F;code&gt; group&#x27;s group ID to 1001, and then change the
Primary Group ID for the user &lt;code&gt;xistence&lt;&#x2F;code&gt; to group ID 1001.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;dscl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -change&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;Groups&#x2F;xistence PrimaryGroupID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 20 1001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;dscl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -change&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;Users&#x2F;xistence PrimaryGroupID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 20 1001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After that &lt;code&gt;id&lt;&#x2F;code&gt; looked a little bit more sane:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid=1001(xistence) gid=1001(xistence) groups=1001(xistence),12(everyone),61(localaccounts),399(com.apple.access_ssh),402(com.apple.sharepoint.group.2),401(com.apple.sharepoint.group.1),100(_lpoperator)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;However now the group &lt;code&gt;staff&lt;&#x2F;code&gt; is missing from the list of groups that the user
&lt;code&gt;xistence&lt;&#x2F;code&gt; is a member of, which I don&#x27;t think will hurt anything, but we still
want to be able to read&#x2F;write any folders that are designated as &lt;code&gt;staff&lt;&#x2F;code&gt;
elsewhere in the OS, and any other privileges that entails. So let&#x27;s add the
user &lt;code&gt;xistence&lt;&#x2F;code&gt; to the &lt;code&gt;staff&lt;&#x2F;code&gt; group:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;dscl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -append&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;Groups&#x2F;staff GroupMembership xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s verify, and check &lt;code&gt;id&lt;&#x2F;code&gt; again:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid=1001(xistence) gid=1001(xistence) groups=1001(xistence),12(everyone),20(staff),61(localaccounts),399(com.apple.access_ssh),402(com.apple.sharepoint.group.2),401(com.apple.sharepoint.group.1),100(_lpoperator)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For this to fully take effect, log out and log back in. This will make sure
that all new files have the correct user ID&#x2F;group ID set.&lt;&#x2F;p&gt;
&lt;p&gt;After the change to the Group ID, the group still doesn&#x27;t show up in &lt;em&gt;System
Preferences&lt;&#x2F;em&gt; -&amp;gt; &lt;em&gt;Users and Groups&lt;&#x2F;em&gt;, which I find weird since it is not a
built-in group.&lt;&#x2F;p&gt;
&lt;p&gt;Luckily everything is back to the way it was before the upgrade, and my backup
scripts and NFS shares work again without issues.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Cobbler with CentOS 7 failure to boot&#x2F;kickstart</title>
        <published>2015-07-08T19:54:43+00:00</published>
        <updated>2015-07-08T19:54:43+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2015/cobbler-with-centos-7-failure-to-boot/"/>
        <id>https://funcptr.net/2015/cobbler-with-centos-7-failure-to-boot/</id>
        
        <content type="html" xml:base="https://funcptr.net/2015/cobbler-with-centos-7-failure-to-boot/">&lt;p&gt;Over the past week I&#x27;ve been working on building out an instance of Cobbler and
testing some of the provisioning that it is able to do. One of the operating
systems that I wanted to deploy is CentOS 7.&lt;&#x2F;p&gt;
&lt;p&gt;After I imported the system into cobbler, it correctly showed up in the
pxelinux boot menu and it would happily load the kernel and the initrd, however
after initial bootup it would throw the following error message:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dracut-initqueue[867]: Warning: Could not boot.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dracut-initqueue[867]: Warning: &#x2F;dev&#x2F;root does not exist&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;         Starting Dracut Emergency Shell...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Warning: &#x2F;dev&#x2F;root does not exist&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Generating &amp;quot;&#x2F;run&#x2F;initramfs&#x2F;rdsosreport.txt&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Entering emergency mode. Exit the shell to continue.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Type &amp;quot;journalctl&amp;quot; to view the system logs.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;You might want to save &amp;quot;&#x2F;run&#x2F;initramfs&#x2F;rdsosreport.txt&amp;quot; to a USB stick or &#x2F;boot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;after mounting them and attach it to a bug report&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After that it gives you a root shell.&lt;&#x2F;p&gt;
&lt;p&gt;Some Google searching led me to an &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20160202155132&#x2F;https:&#x2F;&#x2F;lists.fedorahosted.org&#x2F;pipermail&#x2F;cobbler&#x2F;2014-August&#x2F;009647.html&quot;&gt;mailing list post for Cobbler&lt;&#x2F;a&gt; where
someone mentioned that adding &lt;code&gt;ksdevice=link&lt;&#x2F;code&gt; to the Cobbler profile allowed
the system to boot without issues.&lt;&#x2F;p&gt;
&lt;p&gt;However before I just implement a change I want to know why that fixes the
issue, so I searched Google for &quot;kickstart ksdevice&quot; and found &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20150923201114&#x2F;https:&#x2F;&#x2F;access.redhat.com&#x2F;documentation&#x2F;en-US&#x2F;Red_Hat_Enterprise_Linux&#x2F;6&#x2F;html&#x2F;Installation_Guide&#x2F;s1-kickstart2-startinginstall.html&quot;&gt;Red Hat&#x27;s
documentation on starting a kickstart&lt;&#x2F;a&gt;. Searching that page for &quot;ksdevice&quot;
led me to this section:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;ksdevice=&amp;lt;device&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The installation program uses this network device to connect to the network. You can specify the device in one of five ways:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;the device name of the interface, for example, &lt;code&gt;eth0&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;the MAC address of the interface, for example, &lt;code&gt;00:12:34:56:78:9a&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;the keyword &lt;code&gt;link&lt;&#x2F;code&gt;, which specifies the first interface with its link in the up state&lt;&#x2F;li&gt;
&lt;li&gt;the keyword &lt;code&gt;bootif&lt;&#x2F;code&gt;, which uses the MAC address that pxelinux set in the
BOOTIF variable. Set IPAPPEND 2 in your pxelinux.cfg file to have pxelinux
set the BOOTIF variable.&lt;&#x2F;li&gt;
&lt;li&gt;the keyword &lt;code&gt;ibft&lt;&#x2F;code&gt;, which uses the MAC address of the interface specified by iBFT&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For example, consider a system connected to an NFS server through the eth1
device. To perform a kickstart installation on this system using a kickstart
file from the NFS server, you would use the command &lt;code&gt;ks=nfs:&amp;lt;server&amp;gt;:&#x2F;&amp;lt;path&amp;gt; ksdevice=eth1&lt;&#x2F;code&gt; at the boot: prompt.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;While &lt;code&gt;ksdevice=link&lt;&#x2F;code&gt; would work for some of the machines I am deploying, it
wouldn&#x27;t work for most since they have multiple interfaces and each one of
those interfaces would have link, what I really wanted was &lt;code&gt;ksdevice=bootif&lt;&#x2F;code&gt;,
which is the most sensible default.&lt;&#x2F;p&gt;
&lt;p&gt;So I modified the profile with &lt;code&gt;ksdevice=link&lt;&#x2F;code&gt; just to test, and that worked
without issues, so then I modified the profile and added &lt;code&gt;ksdevice=link&lt;&#x2F;code&gt;, and
this failed.&lt;&#x2F;p&gt;
&lt;p&gt;I figured I should check the &lt;code&gt;pxelinux.cfg&#x2F;default&lt;&#x2F;code&gt; file that Cobbler generates
upon issuing a &lt;code&gt;cobbler sync&lt;&#x2F;code&gt; and verify that &lt;code&gt;ksdevice=bootif&lt;&#x2F;code&gt; is actually
listed correctly.&lt;&#x2F;p&gt;
&lt;p&gt;What I found was this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LABEL CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        kernel &#x2F;images&#x2F;CentOS-7.1-x86_64&#x2F;vmlinuz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        MENU LABEL CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        append initrd=&#x2F;images&#x2F;CentOS-7.1-x86_64&#x2F;initrd.img ksdevice=${net0&#x2F;mac} lang=  kssendmac text  ks=http:&#x2F;&#x2F;10.10.10.1&#x2F;cblr&#x2F;svc&#x2F;op&#x2F;ks&#x2F;profile&#x2F;CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        ipappend 2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This has a &lt;code&gt;ksdevice=${net0&#x2F;mac}&lt;&#x2F;code&gt; which is not what I had put in the profile,
overwriting &lt;code&gt;ksdevice&lt;&#x2F;code&gt; in the profile with &lt;code&gt;ksdevice=link&lt;&#x2F;code&gt; did correctly put
that into the &lt;code&gt;pxelinux.cfg&#x2F;default&lt;&#x2F;code&gt; file, so Cobbler was overwriting my change
somehow.&lt;&#x2F;p&gt;
&lt;p&gt;A quick search of &lt;code&gt;${net0&#x2F;mac}&lt;&#x2F;code&gt; led me to a page about &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;etherboot.org&#x2F;wiki&#x2F;commandline&quot;&gt;gPXE commandline
items&lt;&#x2F;a&gt; that contained the same variable. At which point I remembered that in
Cobbler you set up your profile to be gPXE enabled or not. The default when you
import an image is to enable gPXE support.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cobbler profile report  --name=CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Name                           : CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TFTP Boot Files                : {}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Comment                        : &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DHCP Tag                       : default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Distribution                   : CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Enable gPXE?                   : True&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Enable PXE Menu?               : 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;So let&#x27;s modify the profile to disable gPXE support:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cobbler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; profile edit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; --name=CentOS-7.1-x86_64 --enable-gpxe=False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cobbler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; sync&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify that the change was made:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cobbler profile report  --name=CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Enable gPXE?                   : False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then let&#x27;s take a look at our &lt;code&gt;pxelinux.cfg&#x2F;default&lt;&#x2F;code&gt; file and make sure that it
looks correct:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LABEL CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        kernel &#x2F;images&#x2F;CentOS-7.1-x86_64&#x2F;vmlinuz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        MENU LABEL CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        append initrd=&#x2F;images&#x2F;CentOS-7.1-x86_64&#x2F;initrd.img ksdevice=bootif lang=  kssendmac text  ks=http:&#x2F;&#x2F;10.10.10.1&#x2F;cblr&#x2F;svc&#x2F;op&#x2F;ks&#x2F;profile&#x2F;CentOS-7.1-x86_64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        ipappend 2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This time our ksdevice is correctly set. Upon rebooting my PXE booted server it
picked up the correct interface, made a DHCP request and kickstarted the server
using the provided kickstart file, and installation completed successfully.&lt;&#x2F;p&gt;
&lt;p&gt;So unless you chain-boot gPXE from pxelinux by default, make sure that your
profiles are not set to be gPXE enabled if you want to use them directly from
the pxelinux menu.&lt;&#x2F;p&gt;
&lt;p&gt;While researching more about this article, I found a blog post by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20160507142852&#x2F;https:&#x2F;&#x2F;blog.vladionescu.com&#x2F;pxe-installing-rhel-7-from-cobbler-2-6&#x2F;&quot;&gt;Vlad Ionescu
about PXE installing RHEL 7 from Cobbler&lt;&#x2F;a&gt; where he suggests disabling
&lt;code&gt;ksdevice&lt;&#x2F;code&gt; entirely and adding an extra &lt;code&gt;inst.repo&lt;&#x2F;code&gt; variable to the kernel
command line, however on older versions of CentOS 7 and Red Hat Enterprise
Linux 7 there is a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1096846&quot;&gt;bug report&lt;&#x2F;a&gt; that shows that an empty &lt;code&gt;ksdevice&lt;&#x2F;code&gt; could
cause anaconda to crash, and setting a manual &lt;code&gt;inst.repo&lt;&#x2F;code&gt; for every profile
seems like overkill when just disabling gPXE for the profile also solves the
problem.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Neutron L3 agent with multiple provider networks</title>
        <published>2014-09-29T18:11:00+00:00</published>
        <updated>2014-09-29T18:11:00+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2014/neutron-l3-agent-multiple-provider-networks/"/>
        <id>https://funcptr.net/2014/neutron-l3-agent-multiple-provider-networks/</id>
        
        <content type="html" xml:base="https://funcptr.net/2014/neutron-l3-agent-multiple-provider-networks/">&lt;p&gt;Due to requirements outside of my control, there was a requirement to run
multiple &quot;provider&quot; networks each with each providing their own floating
address pool from a single network node, I wanted to do this as simply as
possible using a single l3 agent rather than having to figure out how to get
systemd to start multiple with different configuration files.&lt;&#x2F;p&gt;
&lt;p&gt;Currently I&#x27;ve installed and configured an OpenStack instance that looks like
this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;+---------------------+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|                     |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|                  +--+----+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|                  |       |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|      +-----------+-+  +--+----------+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|      | Compute     |  | Compute     |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|      |     01      |  |     02      |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|      +------+------+  +-----+-------+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|             |               |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|             |               +----------+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|             +------------+--+          |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|                          |             |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| +-------------+    +-----+-------+     |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| | Controller  |    |   Network   |     |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| |             |    |             |     +---+  Tenant Networks (vlan tagged) (vlan ID&amp;#39;s 350 - 400)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| +-----+----+--+    +------+----+-+&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|       |    |              |    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|       |    |              |    +-----------+  Floating Networks (vlan tagged) (vlan ID&amp;#39;s 340 - 349)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|       |    |              |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|       |    |              |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;+------------+--------------+----------------+  Management Network (10.5.2.0&#x2F;25)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        +------------------------------------+  External API Network (10.5.2.128&#x2F;25)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;There are two compute nodes, a controller node that runs all of the API
services, and a network node that is strictly used for providing network
functions (routers, load balancers, firewalls, all that fun stuff!).&lt;&#x2F;p&gt;
&lt;p&gt;There are two flat networks that provide the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;External API access&lt;&#x2F;li&gt;
&lt;li&gt;A management network that OpenStack uses internally to communicate between
instances and to manage it, which is not accessible from the other three
networks.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The other two networks are both vlan tagged:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Tenant networks, with the possibility of 50 vlan ID&#x27;s&lt;&#x2F;li&gt;
&lt;li&gt;Floating networks, with existing vlan ID&#x27;s for existing networks&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Since the OpenStack Icehouse release, the l3 agent has supported the ability to
use the Open vSwitch configuration to specify how traffic should be routed
rather than statically defining that a single l3 agent routes certain traffic
to a single Linux bridge. Setting this up is fairly simple if you follow the
documentation, with one caveat, variables you think would be defined to no
value, actually have a value and thus need to be explicitly zeroed out.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;on-the-network-node&quot;&gt;On the network node&lt;&#x2F;h2&gt;
&lt;p&gt;First, we need to configure the l3 agent, so let&#x27;s set some extra variables in
&lt;code&gt;&#x2F;etc&#x2F;neutron&#x2F;l3-agent.ini&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;gateway_external_network_id&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;external_network_bridge&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It is important that these two are set, not left commented out, unfortunately
when commented out they have some defaults set and it will fail to work, so
explicitly setting them to blank will fix that issue.&lt;&#x2F;p&gt;
&lt;p&gt;Next, we need to set up our Open vSwitch configuration. In
&lt;code&gt;&#x2F;etc&#x2F;neutron&#x2F;plugin.ini&lt;&#x2F;code&gt; the following needs to be configured:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bridge_mappings&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;network_vlan_ranges&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Note, that these may already be configured, in which case there is nothing left
to do. Mine currently looks like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;bridge_mappings&lt;&#x2F;span&gt;&lt;span&gt; = tenant1:br-tnt,provider1:br-ex&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This basically specifies that any networks created under &quot;provider name&quot;
&lt;code&gt;tenant1&lt;&#x2F;code&gt; are going to be mapped to the Open vSwitch bridge &lt;code&gt;br-tnt&lt;&#x2F;code&gt; and any
networks with &quot;provider name&quot; &lt;code&gt;provider1&lt;&#x2F;code&gt; will be mapped to &lt;code&gt;br-ex&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;br-tnt&lt;&#x2F;code&gt; is mapped to my tenant network and on the switch has vlan ID&#x27;s 350 -
400 assigned, and &lt;code&gt;br-ex&lt;&#x2F;code&gt; has vlan ID&#x27;s 340 - 349 assigned.&lt;&#x2F;p&gt;
&lt;p&gt;Following the above knowledge, my &lt;code&gt;network_vlan_ranges&lt;&#x2F;code&gt; is configured as such:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;network_vlan_ranges&lt;&#x2F;span&gt;&lt;span&gt; = tenant1:350:400,provider1:340:349&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make sure to restart all neutron services:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;openstack-service&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; restart neutron&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;on-the-controller-where-neutron-server-lives&quot;&gt;On the controller (where &lt;code&gt;neutron-server&lt;&#x2F;code&gt; lives)&lt;&#x2F;h2&gt;
&lt;p&gt;On the controller we just need to make sure that our &lt;code&gt;network_vlan_ranges&lt;&#x2F;code&gt;
matches what is on the network node, with one exception, we do not list our
&lt;code&gt;provider1&lt;&#x2F;code&gt; vlan ranges since we don&#x27;t want to make those available to
accidentally be assigned when a regular tenant creates a new network.&lt;&#x2F;p&gt;
&lt;p&gt;So our configuration should list:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;network_vlan_ranges&lt;&#x2F;span&gt;&lt;span&gt; = tenant1:350:400&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make sure that all neutron services are restarted:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;openstack-service&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; restart neutron&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;create-the-neutron-networks&quot;&gt;Create the Neutron networks&lt;&#x2F;h2&gt;
&lt;p&gt;Now, as an administrative user we need to create the provider networks.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;source&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; ~&#x2F;keystonerc_admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;neutron&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; net-create&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;192.168.1.0&#x2F;24-floating&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --router:external&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; True&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:network_type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; vlan&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:physical_network&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; provider1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:segmentation_id&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 340&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;neutron&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; net-create&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;192.168.2.0&#x2F;24-floating&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --router:external&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; True&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:network_type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; vlan&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:physical_network&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; provider1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --provider:segmentation_id&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 341&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Notice how we&#x27;ve created two networks, given them each individual names (I like
to use the name of the network they are going to be used for) and have been
attached to the &lt;code&gt;provider1&lt;&#x2F;code&gt;. Note that &lt;code&gt;provider1&lt;&#x2F;code&gt; is completely
administratively defined, and could just as well have been &lt;code&gt;physnet1&lt;&#x2F;code&gt;, so long
as it is consistent across all of the configuration files.&lt;&#x2F;p&gt;
&lt;p&gt;Now let&#x27;s create subnets on this network:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;neutron&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; subnet-create&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;192.168.1.0&#x2F;24-floating&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; 192.168.1.0&#x2F;24&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --allocation-pool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; start=192.168.1.4,end=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt;192.168.1.254 \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --disable-dhcp --gateway&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 192.168.1.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;neutron&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; subnet-create&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;192.168.2.0&#x2F;24-floating&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; 192.168.2.0&#x2F;24&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --allocation-pool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; start=192.168.2.4,end=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt;192.168.2.254 \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    --disable-dhcp --gateway&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 192.168.2.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now that these networks are defined, you should be able to have tenants create
routers and set their gateways to either of these new networks by selecting
from the drop-down in Horizon or by calling &lt;code&gt;neutron router-gateway-set &amp;lt;router id&amp;gt; &amp;lt;network id&amp;gt;&lt;&#x2F;code&gt; on the command line.&lt;&#x2F;p&gt;
&lt;p&gt;The l3 agent will automatically configure and set up the router as required on
the network node, and traffic will flow to either vlan 340 or vlan 341 as
defined above depending on what floating network the user uses as a gateway.&lt;&#x2F;p&gt;
&lt;p&gt;This drastically simplifies the configuration of multiple floating IP networks
since no longer is there a requirement to start up and configure multiple l3
agents each with their own network ID configured. This makes configuration less
brittle and easier to maintain over time.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>OpenStack resizing of instances</title>
        <published>2014-09-29T17:10:00+00:00</published>
        <updated>2014-09-29T17:10:00+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2014/openstack-resizing-instances/"/>
        <id>https://funcptr.net/2014/openstack-resizing-instances/</id>
        
        <content type="html" xml:base="https://funcptr.net/2014/openstack-resizing-instances/">&lt;p&gt;One thing that is not always adequately explained in the OpenStack
documentation is how exactly instance resizing works, and what is required,
especially while using KVM as the virtualisation provider, with multiple
compute nodes.&lt;&#x2F;p&gt;
&lt;p&gt;You might find something similiar to the following in your logs, and no good
documentation on how to fix it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ERROR nova.compute.manager [req-7cb1c029-beb4-4905-a9d9-62d488540eda f542d1b5afeb4908b8b132c4486f9fa8 c2bfab5ad24642359f43cdff9bb00047] [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Setting instance vm_state to ERROR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Traceback (most recent call last):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]   File &amp;quot;&#x2F;usr&#x2F;lib&#x2F;python2.7&#x2F;site-packages&#x2F;nova&#x2F;compute&#x2F;manager.py&amp;quot;, line 5596, in _error_out_instance_on_exception&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]     yield&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]   File &amp;quot;&#x2F;usr&#x2F;lib&#x2F;python2.7&#x2F;site-packages&#x2F;nova&#x2F;compute&#x2F;manager.py&amp;quot;, line 3459, in resize_instance&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]     block_device_info)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]   File &amp;quot;&#x2F;usr&#x2F;lib&#x2F;python2.7&#x2F;site-packages&#x2F;nova&#x2F;virt&#x2F;libvirt&#x2F;driver.py&amp;quot;, line 4980, in migrate_disk_and_power_off&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]     utils.execute(&amp;#39;ssh&amp;#39;, dest, &amp;#39;mkdir&amp;#39;, &amp;#39;-p&amp;#39;, inst_base)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]   File &amp;quot;&#x2F;usr&#x2F;lib&#x2F;python2.7&#x2F;site-packages&#x2F;nova&#x2F;utils.py&amp;quot;, line 165, in execute&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]     return processutils.execute(*cmd, **kwargs)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]   File &amp;quot;&#x2F;usr&#x2F;lib&#x2F;python2.7&#x2F;site-packages&#x2F;nova&#x2F;openstack&#x2F;common&#x2F;processutils.py&amp;quot;, line 193, in execute&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b]     cmd=&amp;#39; &amp;#39;.join(cmd))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] ProcessExecutionError: Unexpected error while running command.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Command: ssh 10.5.2.20 mkdir -p &#x2F;var&#x2F;lib&#x2F;nova&#x2F;instances&#x2F;99736f90-db0f-4cba-8f44-a73a603eee0b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Exit code: 255&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Stdout: &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] Stderr: &amp;#39;Host key verification failed.\r\n&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRACE nova.compute.manager [instance: 99736f90-db0f-4cba-8f44-a73a603eee0b] &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ERROR oslo.messaging.rpc.dispatcher [-] Exception during message handling: Unexpected error while running command.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Command: ssh 10.5.2.20 mkdir -p &#x2F;var&#x2F;lib&#x2F;nova&#x2F;instances&#x2F;99736f90-db0f-4cba-8f44-a73a603eee0b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Exit code: 255&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Stdout: &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Stderr: &amp;#39;Host key verification failed.\r\n&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;When OpenStack&#x27;s nova is instructed to resize an instance it will also change
the host it is running on, almost never will it schedule the instance on the
same host and do the resize on the same host it already exists. There is a
configuration flag to change this, however in my case I would rather the
scheduler be run again, especially if the instance size is changing
drastically. During the resize process, the node where the instance is
currently running will use SSH to connect to the instance where the resized
instance will live, and copy over the instance and associated files.&lt;&#x2F;p&gt;
&lt;p&gt;There are a couple of assumptions I will be making:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Your &lt;code&gt;nova&lt;&#x2F;code&gt;, and &lt;code&gt;qemu&lt;&#x2F;code&gt; user both have the same UID on all compute nodes&lt;&#x2F;li&gt;
&lt;li&gt;The path for your instances is the same on all of your compute nodes&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;configure-the-nova-user&quot;&gt;Configure the nova user&lt;&#x2F;h2&gt;
&lt;p&gt;First things first, let&#x27;s make sure our &lt;code&gt;nova&lt;&#x2F;code&gt; user has an appropriate shell set:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;etc&#x2F;passwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; nova&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify that the last entry is &lt;code&gt;&#x2F;bin&#x2F;bash&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If not, let&#x27;s modify the user and make it so:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;usermod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;bin&#x2F;bash nova&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;generate-ssh-key-and-configuration&quot;&gt;Generate SSH key and configuration&lt;&#x2F;h2&gt;
&lt;p&gt;After doing this the next steps are all run as the &lt;code&gt;nova&lt;&#x2F;code&gt; user.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;su&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; - nova&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We need to generate an SSH key:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;ssh-keygen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; rsa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Follow the directions, and save the key WITHOUT a passphrase.&lt;&#x2F;p&gt;
&lt;p&gt;Next up we need to configure SSH to not do host key verification, unless you
want to manually SSH to all compute nodes that exist and accept the key (and
continue to do so for each new compute node you add).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; EOF&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; ~&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Host *&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    StrictHostKeyChecking no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    UserKnownHostsFile=&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next we need to make sure we copy the the contents of &lt;code&gt;id_rsa.pub&lt;&#x2F;code&gt; to
&lt;code&gt;authorized_keys&lt;&#x2F;code&gt; and set the mode on it correctly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; ~&#x2F;.ssh&#x2F;id_rsa.pub&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .ssh&#x2F;authorized_keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 600&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .ssh&#x2F;authorized_keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This should be all the configuration for SSH you need to do. Now comes the
import part, you will need to tar up and copy the &lt;code&gt;~nova&#x2F;.ssh&lt;&#x2F;code&gt; directory to
every single compute node you have provisioned. This way all compute nodes will
be able to SSH to the remote host to run the commands required to copy an
instance over, and resize it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;reset-state-on-existing-error-ed-instances&quot;&gt;Reset state on existing ERROR&#x27;ed instances&lt;&#x2F;h2&gt;
&lt;p&gt;If you have any instances that are currently in the &lt;code&gt;ERROR&lt;&#x2F;code&gt; state due to a
failed resize, you will be able to issue the following command to reset the
state back to running and try again:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;nova&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; reset-state&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; --active&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;ID of instanc&lt;&#x2F;span&gt;&lt;span&gt;e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will start the instance, and you will be able to once again issue the
resize command to resize the instance.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Building custom ports with Poudriere and Portshaker</title>
        <published>2013-12-11T00:10:11+00:00</published>
        <updated>2013-12-11T00:10:11+00:00</updated>
        
        <author>
          <name>
            Scott Sturdivant
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2013/using-portshaker-with-poudriere/"/>
        <id>https://funcptr.net/2013/using-portshaker-with-poudriere/</id>
        
        <content type="html" xml:base="https://funcptr.net/2013/using-portshaker-with-poudriere/">&lt;p&gt;&lt;em&gt;Guest post by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ScottSturdivant&quot;&gt;Scott Sturdivant&lt;&#x2F;a&gt;.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Maintaining custom ports and integrating them into your build process doesn&#x27;t
need to be difficult.  The documentation surrounding this process however is
either non-existent, or lacking in its clarity.  At the end of the day, it really
is as simple as maintaining a repository whose structure matches the ports tree
layout, then managing that repository and the standard ports tree
with &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freshports.org&#x2F;ports-mgmt&#x2F;portshaker&#x2F;&quot;&gt;portshaker&lt;&#x2F;a&gt;, and finally handing the end result off to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20140108191325&#x2F;https:&#x2F;&#x2F;fossil.etoilebsd.net&#x2F;poudriere&#x2F;doc&#x2F;trunk&#x2F;doc&#x2F;index.wiki&quot;&gt;poudriere&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;your-custom-repository&quot;&gt;Your Custom Repository&lt;&#x2F;h2&gt;
&lt;p&gt;For this example, we&#x27;ll assume a &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git-scm.com&quot;&gt;git&lt;&#x2F;a&gt; repo is used and that you&#x27;re already
familiar with how to build &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;&quot;&gt;FreeBSD&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;ports&#x2F;&quot;&gt;ports&lt;&#x2F;a&gt;.  We&#x27;ll also assume that we
have but a single port that we&#x27;re maintaining and that it is called &lt;code&gt;myport&lt;&#x2F;code&gt;.
The hierarchy of your repo should simply be &lt;code&gt;category&#x2F;myport&lt;&#x2F;code&gt;.  We&#x27;ll refer to
this repo simply as &lt;code&gt;myrepo&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;portshaker&quot;&gt;Portshaker&lt;&#x2F;h2&gt;
&lt;p&gt;Portshaker is the tool responsible for taking multiple ports sources and then
merging them down into a single target.  In our case, we have two sources: our
git repo (&lt;code&gt;myrepo&lt;&#x2F;code&gt;) containing &lt;code&gt;myport&lt;&#x2F;code&gt;, and the standard FreeBSD ports tree.
We aim to merge this down into a single ports tree that poudriere will then use
for its builds.&lt;&#x2F;p&gt;
&lt;p&gt;To configure portshaker, add the following to the
&lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;portshaker.conf&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# vim:set syntax=sh:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# $Id: portshaker.conf.sample 116 2008-09-30 16:15:02Z romain.tartiere $&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#---[ Base directory for mirrored Ports Trees ]---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;mirror_base_dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;var&#x2F;cache&#x2F;portshaker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#---[ Directories where to merge ports ]---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;ports_trees&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;use_zfs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;no&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;poudriere_ports_mountpoint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;poudriere&#x2F;ports&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;default_poudriere_tree&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;default_merge_from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;freebsd myrepo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Some key points here are that the two items listed in for the
&lt;code&gt;default_merge_from&lt;&#x2F;code&gt; argument need to have scripts present in the
&lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;portshaker.d&lt;&#x2F;code&gt; directory.  Further more, the combination of the
&lt;code&gt;poudriere_ports_mountpoint&lt;&#x2F;code&gt; and &lt;code&gt;default_poudriere_tree&lt;&#x2F;code&gt; needs to be a ports
tree that is then registered with poudriere.&lt;&#x2F;p&gt;
&lt;p&gt;Next, we need to tell portshaker how to go off and fetch our two types of ports
trees, &lt;code&gt;freebsd&lt;&#x2F;code&gt; and &lt;code&gt;myrepo&lt;&#x2F;code&gt;.  For the &lt;code&gt;freebsd&lt;&#x2F;code&gt; ports tree, create
&lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;portshaker.d&#x2F;freebsd&lt;&#x2F;code&gt; with the following contents and make it
executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;share&#x2F;portshaker&#x2F;portshaker.subr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;portsnap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;run_portshaker_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, create a similar script to handle our repository containing our custom
port.  &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;portshaker.d&#x2F;myrepo&lt;&#x2F;code&gt; should contain the following and
similarly be executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;share&#x2F;portshaker&#x2F;portshaker.subr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;git_clone_uri&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;http:&#x2F;&#x2F;github.com&#x2F;scottsturdivant&#x2F;packaging.git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;git_branch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;master&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;run_portshaker_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Obviously replace the &lt;code&gt;git_clone_uri&lt;&#x2F;code&gt; and &lt;code&gt;git_branch&lt;&#x2F;code&gt; variables to reflect
your actual configuration.  For more information about the values and what they
can contain, consult &lt;code&gt;man portshaker.d&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Now, portshaker should be all set.  Execute &lt;code&gt;portshaker -U&lt;&#x2F;code&gt; to update your
&lt;code&gt;merge_from&lt;&#x2F;code&gt; ports trees (&lt;code&gt;freebsd&lt;&#x2F;code&gt; and &lt;code&gt;myrepo&lt;&#x2F;code&gt;).  You&#x27;ll see the standard
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;cgi&#x2F;man.cgi?query=portsnap&amp;amp;sektion=8&quot;&gt;portsnap&lt;&#x2F;a&gt; fetch and extract process as well as a git clone.  After a good
bit of time, these will both be present in the &lt;code&gt;&#x2F;var&#x2F;cache&#x2F;portshaker&lt;&#x2F;code&gt;
directory.  Go ahead and merge them together by executing &lt;code&gt;portshaker -M&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Hooray!  You now have &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;poudriere&#x2F;ports&#x2F;default&#x2F;ports&lt;&#x2F;code&gt; that is a
combination of the normal ports tree and your custom one.&lt;&#x2F;p&gt;
&lt;p&gt;We&#x27;re effectively complete with configuring portshaker.  Whenever your port is
updated, just re-run &lt;code&gt;portshaker -U&lt;&#x2F;code&gt; and &lt;code&gt;portshaker -M&lt;&#x2F;code&gt; to grab the latest
changes and perform the merge.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;poudriere&quot;&gt;Poudriere&lt;&#x2F;h2&gt;
&lt;p&gt;Poudriere is a good tool for building ports.  We will use it to handle our
merged directory.  Begin by configuring poudriere
(&lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;poudriere.conf&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;NO_ZFS&lt;&#x2F;span&gt;&lt;span&gt;=yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;FREEBSD_HOST&lt;&#x2F;span&gt;&lt;span&gt;=ftp:&#x2F;&#x2F;ftp.freebsd.org&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;RESOLV_CONF&lt;&#x2F;span&gt;&lt;span&gt;=&#x2F;etc&#x2F;resolv.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;BASEFS&lt;&#x2F;span&gt;&lt;span&gt;=&#x2F;usr&#x2F;local&#x2F;poudriere&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;USE_PORTLINT&lt;&#x2F;span&gt;&lt;span&gt;=no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;USE_TMPFS&lt;&#x2F;span&gt;&lt;span&gt;=yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;DISTFILES_CACHE&lt;&#x2F;span&gt;&lt;span&gt;=&#x2F;usr&#x2F;ports&#x2F;distfiles&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;CHECK_CHANGED_OPTIONS&lt;&#x2F;span&gt;&lt;span&gt;=yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Really there&#x27;s nothing here that is specific to the problem at hand, so feel
free to consult the provided configuration file to tune it to your needs.&lt;&#x2F;p&gt;
&lt;p&gt;Now, the step that &lt;em&gt;is&lt;&#x2F;em&gt; specific is to set poudriere up with a ports tree that
it does not manage, specifically our resultant merged directory.  If you
consult &lt;code&gt;man poudriere&lt;&#x2F;code&gt;, it specifies that for the &lt;code&gt;ports&lt;&#x2F;code&gt; subcommand, there is
a &lt;code&gt;-m method&lt;&#x2F;code&gt; switch which controls the methodology used to create the ports
tree.  By default, it is portsnap.  This is confusing as in our case, we do not
want poudriere to actually do anything.  We want it to just use an existing
path.  Fortunately, there is a way!&lt;&#x2F;p&gt;
&lt;p&gt;The poudriere wiki has an entry for using the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20130817160004&#x2F;https:&#x2F;&#x2F;fossil.etoilebsd.net&#x2F;poudriere&#x2F;doc&#x2F;trunk&#x2F;doc&#x2F;use_system_ports_tree.wiki&quot;&gt;system ports tree&lt;&#x2F;a&gt;, so we
adopt it for our needs by executing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;poudriere&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; ports&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -c -F -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; none&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -M&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;poudriere&#x2F;ports&#x2F;default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt;    -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you&#x27;ve consulted the poudriere manpage, you&#x27;ll see that the &lt;code&gt;-F&lt;&#x2F;code&gt; and &lt;code&gt;-f&lt;&#x2F;code&gt;
switches both reference ZFS in their help.  As we&#x27;re not using ZFS, it&#x27;s not
clear how they will behave.  However, in conjunction with the custom mountpoint
(&lt;code&gt;-M &#x2F;usr&#x2F;local&#x2F;poudriere&#x2F;ports&#x2F;default&lt;&#x2F;code&gt;), we ultimately wind up with what we
want, a ports tree that poudriere can use, but does not manage:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# poudriere ports -l&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PORTSTREE            METHOD     PATH&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;default              -          &#x2F;usr&#x2F;local&#x2F;poudriere&#x2F;ports&#x2F;default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note that this resulting PATH is the combination of the
&lt;code&gt;poudriere_ports_mountpoint&lt;&#x2F;code&gt; and &lt;code&gt;default_poudriere_tree&lt;&#x2F;code&gt; variables present in
our &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;portshaker.conf&lt;&#x2F;code&gt; configuration file.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-software-from-your-custom-ports-tree&quot;&gt;Building software from your custom ports tree&lt;&#x2F;h2&gt;
&lt;p&gt;Go ahead and create your jail(s) like you normally would (i.e.
&lt;code&gt;poudriere -c -j 92amd64 -V 9.2-RELEASE -a amd64&lt;&#x2F;code&gt;) and any other configuration
you would like, and then go ahead and build &lt;code&gt;myport&lt;&#x2F;code&gt; with
&lt;code&gt;poudriere bulk -j 92amd64 -p default category&#x2F;myport&lt;&#x2F;code&gt;.  Success!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>FreeBSD 8.2 to 9.0 update with ZFS on root (mirror)</title>
        <published>2012-04-24T18:36:20+00:00</published>
        <updated>2012-04-24T18:36:20+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2012/freebsd-8-2-to-9-0-update-with-zfs-on-root/"/>
        <id>https://funcptr.net/2012/freebsd-8-2-to-9-0-update-with-zfs-on-root/</id>
        
        <content type="html" xml:base="https://funcptr.net/2012/freebsd-8-2-to-9-0-update-with-zfs-on-root/">&lt;p&gt;Upgrading from one version of FreeBSD to another has become much simpler with
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.daemonology.net&#x2F;freebsd-update&#x2F;&quot;&gt;&lt;code&gt;freebsd-update&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; than before, a full rebuild of the FreeBSD kernel&#x2F;world
source used to be required (other upgrade paths existed but were not widely
touted). &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; works extremely well when using UFS as your file
system, there are however some gotcha&#x27;s that one needs to look out for when
using FreeBSD Root on ZFS. Two machines needed upgrading, both are running with
a ZFS root mirror on FreeBSD 8.2-RELEASE. I had followed the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;wiki.freebsd.org&#x2F;RootOnZFS&#x2F;GPTZFSBoot&#x2F;Mirror&quot;&gt;FreeBSD Root on
ZFS (mirror)&lt;&#x2F;a&gt; wiki article and everything has been running smoothly ever
since.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  pool: zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; state: ONLINE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; scrub: scrub completed after 0h35m with 0 errors on Mon Mar  5 10:58:19 2012&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;config:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    NAME           STATE     READ WRITE CKSUM&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    zroot          ONLINE       0     0     0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      mirror       ONLINE       0     0     0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        gpt&#x2F;disk0  ONLINE       0     0     0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        gpt&#x2F;disk1  ONLINE       0     0     0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;errors: No known data errors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wanting to take advantage of some of the advancements made in &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;releases&#x2F;9.0R&#x2F;announce.html&quot;&gt;FreeBSD
9.0-RELEASE&lt;&#x2F;a&gt; such as the updated ZFS, a bug that was fixed that stopped
jails from owning a ZFS file system, improved dtrace, and better IPv6 support
required that the plunge be taken and an upgrade was in order.  There were a
couple reports of people having done source upgrades and then having issues
booting their system, but I found one &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;lists.freebsd.org&#x2F;pipermail&#x2F;freebsd-questions&#x2F;2012-January&#x2F;237308.html&quot;&gt;mailling list post&lt;&#x2F;a&gt; that suggested
that everything went well using &lt;code&gt;freebsd-update&lt;&#x2F;code&gt;, so that is the route I went
with.&lt;&#x2F;p&gt;
&lt;p&gt;I read through the entirety of the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.FreeBSD.org&#x2F;releases&#x2F;9.0R&#x2F;relnotes-detailed.html#UPGRADE&quot;&gt;FreeBSD 9.0-ERLEASE Release Notes&lt;&#x2F;a&gt;
before moving forward to make sure I didn&#x27;t miss any important changes that
would cause my system to not restart correctly or would require changing system
configuration files before attempting the upgrade. I would advise you to do the
same.&lt;&#x2F;p&gt;
&lt;p&gt;I ran &lt;code&gt;freebsd-update -r 9.0-RELEASE upgrade&lt;&#x2F;code&gt; and after accepting the list of
components that were installed, I got an error saying:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# freebsd-update -r 9.0-RELEASE upgrade&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Looking up update.FreeBSD.org mirrors... 4 mirrors found.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Fetching metadata signature for 8.2-RELEASE from update2.freebsd.org... done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Fetching metadata index... done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Inspecting system... done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;The following components of FreeBSD seem to be installed:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;kernel&#x2F;generic src&#x2F;base src&#x2F;bin src&#x2F;cddl src&#x2F;contrib src&#x2F;crypto src&#x2F;etc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;src&#x2F;games src&#x2F;gnu src&#x2F;include src&#x2F;krb5 src&#x2F;lib src&#x2F;libexec src&#x2F;release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;src&#x2F;rescue src&#x2F;sbin src&#x2F;secure src&#x2F;share src&#x2F;sys src&#x2F;tools src&#x2F;ubin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;src&#x2F;usbin world&#x2F;base world&#x2F;catpages world&#x2F;dict world&#x2F;doc world&#x2F;games&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;world&#x2F;info world&#x2F;lib32 world&#x2F;manpages&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;The following components of FreeBSD do not seem to be installed:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;world&#x2F;proflibs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Does this look reasonable (y&#x2F;n)? y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Fetching metadata signature for 9.0-RELEASE from update2.freebsd.org... done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Fetching metadata index... done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;The update metadata is correctly signed, but&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;failed an integrity check.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Cowardly refusing to proceed any further.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Specifically the line stating &quot;Cowardly refusing to proceed further&quot;, a quick
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;google.com&#x2F;&quot;&gt;Google&lt;&#x2F;a&gt; later I found the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;lists.freebsd.org&#x2F;pipermail&#x2F;freebsd-stable&#x2F;2011-October&#x2F;064321.html&quot;&gt;9.0-RC1 mailling list post&lt;&#x2F;a&gt; that suggested
the following one line fix:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;s&#x2F;=_&#x2F;=%@_&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;sbin&#x2F;freebsd-update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After that quick fix, a re-run of &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; functioned without issues
and finished, showing me what it would change, asking me if it seemed
acceptable and telling me what it was going to remove and what was going to be
installed.&lt;&#x2F;p&gt;
&lt;p&gt;Next we run &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; for the first time in this three step process:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;freebsd-update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Don&#x27;t restart yet (although it tells you to)! We need to go back and make sure
we update the boot records first.&lt;&#x2F;p&gt;
&lt;p&gt;Going back to the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;lists.freebsd.org&#x2F;pipermail&#x2F;freebsd-questions&#x2F;2012-January&#x2F;237308.html&quot;&gt;mailling list post made by Magnus Strahlert&lt;&#x2F;a&gt;, I made note
of the following:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Had to upgrade the gpt bootcode as instructed when upgrading the zpool for
the system to boot.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This is the only comment that worried me, and nowhere in the email thread does
the poster describe what commands he ran. In any case I figure he meant
re-running the boot code commands from the FreeBSD Root on ZFS wiki article:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;gpart&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; bootcode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;boot&#x2F;pmbr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;boot&#x2F;gptzfsboot&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; da0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;gpart&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; bootcode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;boot&#x2F;pmbr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;boot&#x2F;gptzfsboot&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; da1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After running these commands, it told me that it had updated the boot code and then I ran:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;shutdown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; now&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After the machine came back online (it is in those moments when you have a
small heartattack when the machine doesn&#x27;t come up as fast as you had expected
...) you log back in and run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;freebsd-update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will install all of the updated binaries that came with FreeBSD 9.0, at
this point FreeBSD update will tell you to upgrade all installed software and
ports, and then run &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; one more time to remove all unnecessary
shared libraries. If you want to have certain software continue functioning,
yet you want &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; to remove any other remaining old 8.x files, you
can install &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freshports.org&#x2F;misc&#x2F;compat8x&#x2F;&quot;&gt;&lt;code&gt;misc&#x2F;compat8x&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; from the ports tree. This is the suggested
route to go if you want to keep the 8.x libraries around for compatibility
reasons.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;ports&#x2F;misc&#x2F;compat8x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;make&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; install clean&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# or&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# portmaster misc&#x2F;compat8x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I use &lt;code&gt;portmaster&lt;&#x2F;code&gt; and the following command will simply rebuild every port
installed on the system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;portmaster&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -aPf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;-P&lt;&#x2F;code&gt; to &lt;code&gt;portmaster&lt;&#x2F;code&gt; means look for package and if available use it,
otherwise build from port.&lt;&#x2F;p&gt;
&lt;p&gt;Run &lt;code&gt;freebsd-update&lt;&#x2F;code&gt; one last time:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;freebsd-update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Since we are running ZFS we will most likely also want to upgrade our pool to
the latest version of ZFS to take advantage of any new goodies (such as
deduplication!), upgrading a zpool is easy:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; upgrade zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That upgrades to the latest pool version, now we will want to upgrade our
existing file systems to the latest version of ZFS, do note that this will make
them incompatible with older file system verisons (so if you use zfs send for
backups, your other endpoint will need to be of the same ZFS version)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; upgrade&lt;&#x2F;span&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # List all ZFS file systems that need to be upgraded&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; upgrade&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # Upgrade all file systems&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After this one last reboot to make sure that all the processes come back online
using the newer libraries and that you didn&#x27;t accidentally miss something.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;shutdown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; now&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;At this point the system has been upgraded from FreeBSD 8.0-RELEASE to FreeBSD
9.0-RELEASE and has all of the latest updates and enhancements.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Converting KVM virtual machines to VirtualBox</title>
        <published>2012-04-01T01:03:32+00:00</published>
        <updated>2012-04-01T01:03:32+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2012/converting-kvm-to-virtualbox/"/>
        <id>https://funcptr.net/2012/converting-kvm-to-virtualbox/</id>
        
        <content type="html" xml:base="https://funcptr.net/2012/converting-kvm-to-virtualbox/">&lt;p&gt;Recently the requirement came up to take a &lt;a rel=&quot;external&quot; title=&quot;Kernel Virtual Machine&quot; href=&quot;http:&#x2F;&#x2F;www.linux-kvm.org&#x2F;&quot;&gt;KVM&lt;&#x2F;a&gt; based virtual machine and
move it over to a &lt;a rel=&quot;external&quot; title=&quot;Oracle VirtualBox&quot; href=&quot;https:&#x2F;&#x2F;www.virtualbox.org&#x2F;&quot;&gt;VirtualBox&lt;&#x2F;a&gt; image. Which turned out to be a fairly simple
endeavour, and was fairly painless. The longest part was transferring over the
40 GB image from one machine to the other where the conversion could take
place. The machine the image was coming from was only on a 100 Mbit&#x2F;sec
connection so that took a good hour.&lt;&#x2F;p&gt;
&lt;p&gt;Converting from KVM to VirtualBox for a FreeBSD image was pretty
simple, the &lt;code&gt;VBoxManage&lt;&#x2F;code&gt; command has a &lt;code&gt;convertdd&lt;&#x2F;code&gt; command that allows you to
convert from raw disk &lt;code&gt;.img&lt;&#x2F;code&gt; format to &lt;code&gt;.vdi&lt;&#x2F;code&gt; format.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;VBoxManage convertdd KVM-image.img VB-image.vdi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After this, unfortunately, there is no way to to automatically convert over the
settings that the virtual machine had, such as the network cards, the memory
allocations and hard drive settings. You will have to go to VirtualBox and
create a new virtual machine and replicate all of the settings. Once that is
done make sure to select the same type of disk controller (SATA or IDE) so that
the drive will hopefully be assigned the same name in the device tree so that
you don&#x27;t need to alter your &lt;code&gt;&#x2F;etc&#x2F;fstab&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Hopefully everything boots without any issues. If not try creating a new
virtual machine, attach the converted image as a secondary drive and see if you
can mount the converted image within your new install. If so maybe transferring
the data using &lt;code&gt;rsync&lt;&#x2F;code&gt; or &lt;code&gt;dump&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;restore&lt;&#x2F;code&gt; would be an option.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>NAT with PF on an interface with multiple IP addresses</title>
        <published>2011-09-08T02:40:00+00:00</published>
        <updated>2011-09-08T02:40:00+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2011/nat-with-pf-on-an-interface/"/>
        <id>https://funcptr.net/2011/nat-with-pf-on-an-interface/</id>
        
        <content type="html" xml:base="https://funcptr.net/2011/nat-with-pf-on-an-interface/">&lt;p&gt;If you want to do NAT for your currently running jail instances on FreeBSD so
that they can have outgoing connections you could try the following &lt;code&gt;pf.conf&lt;&#x2F;code&gt;
to set up NAT on the interface that the jails have their IP addresses on.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ext_if=&amp;quot;em0&amp;quot;    # The network card your default gateway is on&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;jail_if=&amp;quot;lo1&amp;quot;   # The interface that your jails have IP addresses on&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Set some options&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set optimization aggressive&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set block-policy drop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set skip on lo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# NAT on the external interface when coming from the jail interface&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nat on $ext_if from $jail_if:network:0 to any -&amp;gt; ($ext_if)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# We just pass everything&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pass quick all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;What I have done is create IP addresses within the private network range
(&lt;code&gt;10&#x2F;8&lt;&#x2F;code&gt;, &lt;code&gt;172.16&#x2F;12&lt;&#x2F;code&gt;, &lt;code&gt;192.168&#x2F;16&lt;&#x2F;code&gt;) on the &lt;code&gt;lo1&lt;&#x2F;code&gt; interface. These can&#x27;t be in
the &lt;code&gt;127&#x2F;8&lt;&#x2F;code&gt; range because those addresses can&#x27;t be NAT&#x27;ed (not sure if this is
a limitation in pf or if this is a FreeBSD limitation), which is a shame
because using &lt;code&gt;127.1.0.1&#x2F;24&lt;&#x2F;code&gt; would be pretty awesome in my opinion.&lt;&#x2F;p&gt;
&lt;p&gt;What I did find though is that the above will not work correctly if your main
network card (the one your default gateway is on, in the example &lt;code&gt;em0&lt;&#x2F;code&gt;)
contains multiple IP addresses. At that point the syntax &lt;code&gt;($ext_if)&lt;&#x2F;code&gt; does not
function correctly and will cause packet loss&#x2F;drop. &lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2011-09-08freebsdversion-1&quot;&gt;&lt;a href=&quot;#fn-2011-09-08freebsdversion&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;p&gt;
&lt;p&gt;So instead of using the syntax above we simply replace &lt;code&gt;($ext_if)&lt;&#x2F;code&gt; with the
actual IP address of the interface. This takes care of the issue and will let
your jails have proper internet access without issues.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ext_if=&amp;quot;em0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;jail_if=&amp;quot;lo1&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set optimization aggressive&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set block-policy drop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set skip on lo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nat on $ext_if from $jail_if:network:0 to any -&amp;gt; 192.168.1.2 # Your IP! &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pass quick all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The other way you can solve this problem off course is to provide your jails
with IP addresses within the same range that go to your default gateway thereby
solving the problem of needing to NAT in the first place.&lt;&#x2F;p&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-2011-09-08freebsdversion&quot;&gt;
&lt;p&gt;Do note that I am using FreeBSD 8.2, so this may
be fixed in the new FreeBSD 9 that is due to be released soon. &lt;a href=&quot;#fr-2011-09-08freebsdversion-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;section&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>FreeBSD running within KVM: Serial Console</title>
        <published>2011-08-21T18:53:52+00:00</published>
        <updated>2011-08-21T18:53:52+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2011/freebsd-running-within-kvm-serial-console/"/>
        <id>https://funcptr.net/2011/freebsd-running-within-kvm-serial-console/</id>
        
        <content type="html" xml:base="https://funcptr.net/2011/freebsd-running-within-kvm-serial-console/">&lt;p&gt;Instead of using virtualisation technology such as VMWare of VirtualBox I
decided to give the new &lt;a rel=&quot;external&quot; title=&quot;Kernel based Virtual Machine&quot; href=&quot;http:&#x2F;&#x2F;www.linux-kvm.org&#x2F;page&#x2F;Main_Page&quot;&gt;KVM&lt;&#x2F;a&gt; technology that is included with Linux. It is
fast, and has been extremely reliable. However I wanted to be able to access
the console on the guest FreeBSD instances.&lt;&#x2F;p&gt;
&lt;p&gt;I used virt-manager, a graphical tool, to set up everything, including creating
the virtual machine, I didn&#x27;t want to have to deal with XML configuration files
and whatnot. After installing FreeBSD there are a few changes I made to get a
virtual console working, this allows &lt;code&gt;virsh console &amp;lt;domain&amp;gt;&lt;&#x2F;code&gt; to function
as expected.&lt;&#x2F;p&gt;
&lt;p&gt;First we add a new file to the root file system (which should be the first
slice on the drive):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;-Dh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;boot.config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;See &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;cgi&#x2F;man.cgi?query=boot.config&amp;amp;sektion=5&quot;&gt;man 5 boot.config&lt;&#x2F;a&gt; for more information. Basically -D says that FreeBSD
should boot with a dual console configuration (built-in over VGA) and serial
console, and -h says to force the serial console to on.&lt;&#x2F;p&gt;
&lt;p&gt;If you were to reboot now and use the virsh command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;virsh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; console FreeBSD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;you would see the system go through the boot process and show output starting
from when the boot block gains control, at this point however you still have no
way to login to this new console since we never specified that we wanted any
ttys on the serial console, for that we need to edit &#x2F;etc&#x2F;ttys.&lt;&#x2F;p&gt;
&lt;p&gt;We are looking for the ttyu0 entry, we want to make sure to change dialup to
vt100, and off to on, so that it should look like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ttyu0   &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty std.9600&amp;quot;   vt100   on secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now when we reboot once more we will get the usual login display that we have
come to expect of console on FreeBSD, and we can login over the serial console.
This way we don&#x27;t have to open up the virtual machine manager to get a console,
and can continue to do almost everything from a terminal window.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>PostgreSQL setup for external connections</title>
        <published>2011-08-16T17:48:54+00:00</published>
        <updated>2011-08-16T17:48:54+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2011/postgresql-setup-for-external-connections/"/>
        <id>https://funcptr.net/2011/postgresql-setup-for-external-connections/</id>
        
        <content type="html" xml:base="https://funcptr.net/2011/postgresql-setup-for-external-connections/">&lt;p&gt;PostgreSQL is a fantastic open-source RDBMS which is extremely powerful, once
installed on FreeBSD getting it set up is pretty simple. We do want to change
some of the defaults though. By default the system will be set up to trust any
user using the local socket to connect as any user to any database.&lt;&#x2F;p&gt;
&lt;p&gt;By setting up the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;8.2&#x2F;static&#x2F;app-initdb.html&quot;&gt;&lt;code&gt;initdb&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; flags we can change how PostgreSQL generates
the default configuration files. Adding &lt;code&gt;-A md5&lt;&#x2F;code&gt; tells it to use the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;8.2&#x2F;static&#x2F;auth-methods.html#AUTH-PASSWORD&quot;&gt;md5
authentication mechanism&lt;&#x2F;a&gt;, which requires that passwords sent over the wire
are md5 hashed.&lt;&#x2F;p&gt;
&lt;p&gt;Add the following to &lt;a rel=&quot;external&quot; title=&quot;man 5 rc.conf&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;cgi&#x2F;man.cgi?query=rc.conf&amp;amp;sektion=5&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;rc.conf&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; for the initdb flags, and enable
PostgreSQL as a service:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;postgresql_initdb_flags=&amp;quot;-D &#x2F;usr&#x2F;local&#x2F;pgsql&#x2F;data -W -A md5&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;postgresql_enable=&amp;quot;YES&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;rc.d&#x2F;postgresql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; initdb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will initialise and create the configuration as well as setting up some of
the default tables. You will want to navigate to the folder specified in the
&lt;code&gt;initdb_flags&lt;&#x2F;code&gt; above:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;pgsql&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;this is where you will find the files that we are going to modify next to get
PostgreSQL set up to listen to connections coming in on a private network
(&lt;code&gt;192.168.1.1&#x2F;24&lt;&#x2F;code&gt;) and where we allow connections coming in from servers on
that network. This is strictly for setting up PostgreSQL in a situation where
you have multiple servers accessing it as a client on a private network.&lt;&#x2F;p&gt;
&lt;p&gt;After this we need to modify a few files to get it to listen to TCP&#x2F;IPv4
connections, first we start with &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;8.2&#x2F;static&#x2F;runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS&quot;&gt;&lt;code&gt;postgresql.conf&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; and add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;listen_addresses&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;127.0.0.1,192.168.1.1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then in &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;8.2&#x2F;static&#x2F;auth-pg-hba-conf.html&quot;&gt;&lt;code&gt;pg_hba.conf&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; we add a new line:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;host	all		all		192.168.1.1&#x2F;24		md5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This allows anyone in the 192.168.1.1&#x2F;24 range to connect to our PostgreSQL
instance and to use the databases. This is exactly what we want to allow, now
we start PostgreSQL using the rc script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;rc.d&#x2F;postgresql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Setting up jails with multiple IPs and providing it with internet access</title>
        <published>2011-08-15T15:40:04+00:00</published>
        <updated>2011-08-15T15:40:04+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2011/setting-up-jails-with-multiple-ips-and-providing-it-with-internet-access/"/>
        <id>https://funcptr.net/2011/setting-up-jails-with-multiple-ips-and-providing-it-with-internet-access/</id>
        
        <content type="html" xml:base="https://funcptr.net/2011/setting-up-jails-with-multiple-ips-and-providing-it-with-internet-access/">&lt;p&gt;I have multiple VMs up and running and generally I have an internal to the
VMs only network set up, in the current project I am working on I have
three completely different networks set up.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;DHCP assigned network that routes to the outside network on the host (192.168.0.1&#x2F;24)&lt;&#x2F;li&gt;
&lt;li&gt;An internal to the VM&#x27;s network interface (10.99.12.1&#x2F;24)&lt;&#x2F;li&gt;
&lt;li&gt;A network that is tied to the host&#x27;s wireless network (setup to be an AP) (10.99.11.1&#x2F;24)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;So within my FreeBSD VM I have the following: &lt;code&gt;em0&lt;&#x2F;code&gt;, &lt;code&gt;em1&lt;&#x2F;code&gt;, &lt;code&gt;em2&lt;&#x2F;code&gt; as
&quot;network cards&quot;. In my FreeBSD VM, I am creating two jails that are going
to contain different pieces of server software. The jails need IP&#x27;s in
the following ranges, 10.99.12.1&#x2F;24 (to connect to another VM),
10.99.11.1&#x2F;24 (Wifi network) and then it needs to have an IP address that
is considered &quot;local&quot; and we can NAT on, so in addition to the above
networks we also needed to add another network. The easiest way to create
new interface with IP addresses is using a bridge. They can be assigned
IP addresses, which is all we need.&lt;&#x2F;p&gt;
&lt;p&gt;At this point inside of a jail it kinda looks like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;em0: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; metric 0 mtu 1500&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    options=209b&amp;lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ether 52:54:00:6b:6a:49&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    media: Ethernet autoselect (1000baseT &amp;lt;full-duplex&amp;gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    status: active&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;em1: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; metric 0 mtu 1500&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    options=209b&amp;lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ether 52:54:00:2f:a5:55&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inet 10.99.12.4 netmask 0xffffffff broadcast 10.99.12.4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    media: Ethernet autoselect (1000baseT &amp;lt;full-duplex&amp;gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    status: active&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;em2: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; metric 0 mtu 1500&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    options=209b&amp;lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ether 52:54:00:bb:b6:43&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inet 10.99.11.14 netmask 0xffffffff broadcast 10.99.11.14&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    media: Ethernet autoselect (1000baseT &amp;lt;full-duplex&amp;gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    status: active&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; metric 0 mtu 16384&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    options=3&amp;lt;RXCSUM,TXCSUM&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;bridge0: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; metric 0 mtu 1500&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ether da:de:63:c9:55:6c&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inet 10.0.1.4 netmask 0xffffffff broadcast 10.0.1.4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;em0&lt;&#x2F;code&gt; doesn&#x27;t have an address since that is our DHCP address, &lt;code&gt;em1&lt;&#x2F;code&gt;,
&lt;code&gt;em2&lt;&#x2F;code&gt; and &lt;code&gt;bridge0&lt;&#x2F;code&gt; all have IP addresses, in the jail configuration the
&lt;code&gt;bridge0&lt;&#x2F;code&gt; IP address is listed first, and thus when something binds or
sends it sends from that IP address. The thing is that at this point the
jail does not have internet access.&lt;&#x2F;p&gt;
&lt;p&gt;Jails inherit the routing table from their host environment (yes, you
can compile in more routing tables ... but I don&#x27;t want to modify stock),
any traffic that goes to the outside is going to go out over the default
route, thing is you&#x27;d expect that traffic to show up on &lt;code&gt;bridge0&lt;&#x2F;code&gt; where
the IP address exists, instead using &lt;code&gt;tcpdump&lt;&#x2F;code&gt; you see it show up on
&lt;code&gt;em0&lt;&#x2F;code&gt;, which is where the default route is. I would have expected having
to do NAT on the bridge, not just the external interface.&lt;&#x2F;p&gt;
&lt;p&gt;Here is the &lt;code&gt;pf&lt;&#x2F;code&gt; configuration.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ext_if=&amp;quot;em0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;jail_if=&amp;quot;bridge0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set optimization aggressive&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set block-policy drop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set skip on lo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nat on $ext_if from $jail_if:network:0 to any -&amp;gt; ($ext_if)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pass quick all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And we&#x27;ve got internet within our jail.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Apache mod_fastcgi and PHP with PHP-FPM</title>
        <published>2010-11-14T23:37:27+00:00</published>
        <updated>2010-11-14T23:37:27+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2010/apache-mod-fastcgi-and-php-with-php-fpm/"/>
        <id>https://funcptr.net/2010/apache-mod-fastcgi-and-php-with-php-fpm/</id>
        
        <content type="html" xml:base="https://funcptr.net/2010/apache-mod-fastcgi-and-php-with-php-fpm/">&lt;p&gt;Recently I did a server migration from an older server to a newer server and in
an attempt to help stability I wanted to see if there was a better way to do
PHP FastCGI. In my research I came across running PHP using the FastCGI server
that spins up a PHP on a TCP&#x2F;IP port and allows the web server to connect to
it. However this doesn&#x27;t help with spawning or keeping track of instances or
error recovery.&lt;&#x2F;p&gt;
&lt;p&gt;This is where &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;php-fpm.org&#x2F;&quot;&gt;PHP-FPM&lt;&#x2F;a&gt; comes in handy. It does all of the hard work for us,
it spawns the processes and has a bunch of really awesome features that help
run PHP as various different users as required with different PHP ini files and
memory limits. PHP-FPM&#x27;s defaults, at least from a ports install, are extremely
sane and I don&#x27;t really suggest changing them. After setting up PHP FPM I had
to set up Apache.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; doesn&#x27;t allow for remote connections, and as such I was unable to use
it for what I needed it for. &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; provides the
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20101111193738&#x2F;http:&#x2F;&#x2F;www.fastcgi.com&#x2F;mod_fastcgi&#x2F;docs&#x2F;mod_fastcgi.html#FastCgiExternalServer&quot;&gt;FastCGIExternalServer&lt;&#x2F;a&gt; configuration key, which is exactly what I needed.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;The FastCgiExternalServer directive defines filename as an external
FastCGI application. If filename does not begin with a slash (&lt;code&gt;&#x2F;&lt;&#x2F;code&gt;) then it is
assumed to be relative to the &lt;code&gt;ServerRoot&lt;&#x2F;code&gt;. The filename does not have to exist
in the local filesystem. URIs that Apache resolves to this filename will be
handled by this external FastCGI application.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;What this documentation does not state is that the path up to the last part of
it has to exist in the local file system. So in my first couple of attempts I
pointed it at &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&#x2F;php5.fcgi&lt;&#x2F;code&gt; without having an actual fastcgi
directory located in &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;www&#x2F;&lt;&#x2F;code&gt;. There are a lot of examples that require
creating a new &lt;code&gt;FastCGIExternalServer&lt;&#x2F;code&gt; for each and every &lt;code&gt;VirtualHost&lt;&#x2F;code&gt; this is
unacceptable to me, the reason they require it is because they set the
&lt;code&gt;FastCGIExternalServer&lt;&#x2F;code&gt; path to the folder where they are going to be serving
files from.&lt;&#x2F;p&gt;
&lt;p&gt;In the end I found that after creating the &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&lt;&#x2F;code&gt; directory
(and reading the &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; source code) that all it does is make Apache
believe a file exists in a certain directory, much like &lt;code&gt;Alias&lt;&#x2F;code&gt;, except &lt;code&gt;Alias&lt;&#x2F;code&gt;
allows full paths to be aliased, not so here.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;AddType&lt;&#x2F;code&gt; and &lt;code&gt;Action&lt;&#x2F;code&gt; add custom types and what the action should be when
such a type is encountered. In this case the action is to redirect the request
to &lt;code&gt;&#x2F;php5.fcgi&lt;&#x2F;code&gt; which will handle the rest of the request. This does not require
another FastCGI section per &lt;code&gt;VirtualHost&lt;&#x2F;code&gt; as each PHP request will just get
shuttled to the php handler.&lt;&#x2F;p&gt;
&lt;p&gt;Do take note that I have specifically disallowed Apache to serve anything from
the &lt;code&gt;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&#x2F;&lt;&#x2F;code&gt; folder, except for a single file &lt;code&gt;php5.fcgi&lt;&#x2F;code&gt;
which is our &lt;code&gt;FastCGIExternalServer&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;IfModule mod_fastcgi.c&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Alias &#x2F;php5.fcgi &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    FastCGIExternalServer &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&#x2F;php5.fcgi -flush -host 127.0.0.1:9000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddType application&#x2F;x-httpd-fastphp5 .php&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Action application&#x2F;x-httpd-fastphp5 &#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;Directory &amp;quot;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi&#x2F;&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        Order deny,allow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        Deny from all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;Files &amp;quot;php5.fcgi&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Order allow,deny&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Allow from all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&#x2F;Files&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;Directory&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;IfModule&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note that even-though in my &lt;a href=&quot;&#x2F;2009&#x2F;moving-from-mod-fastcgi-to-mod-fcgid&#x2F;&quot;&gt;last post&lt;&#x2F;a&gt; concerning &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; I as moving
away from it, I am now doing the opposite, instead of &lt;a href=&quot;&#x2F;2009&#x2F;moving-from-mod-fastcgi-to-mod-fcgid&#x2F;&quot;&gt;moving from
&lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; to &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; I&#x27;m back to &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt;, only because
&lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; doesn&#x27;t offer the same functionality.&lt;&#x2F;p&gt;
&lt;p&gt;So far this has provided far more stability, along with PHP-FPM doing all of
the process management I can now use a single PHP instance that is running on a
single port for the various web servers I am testing. At the moment I have both
Lighttpd and Apache using the same PHP-FPM instance. It is faster, less
memory is wasted and PHP-FPM is much better at process management than
&lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; or &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Moving from mod_fastcgi to mod_fcgid</title>
        <published>2009-08-25T23:22:03+00:00</published>
        <updated>2010-11-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2009/moving-from-mod-fastcgi-to-mod-fcgid/"/>
        <id>https://funcptr.net/2009/moving-from-mod-fastcgi-to-mod-fcgid/</id>
        
        <content type="html" xml:base="https://funcptr.net/2009/moving-from-mod-fastcgi-to-mod-fcgid/">&lt;p&gt;Update: I&#x27;ve since moved to a PHP-FPM with &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; based setup which works
much better than &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; could ever dream of, taking process management away
from Apache and putting it where it actually makes sense has improved server
load and improved website speed. See my new &lt;a href=&quot;&#x2F;2010&#x2F;apache-mod-fastcgi-and-php-with-php-fpm&#x2F;&quot;&gt;PHP-FPM with mod_fastcgi
post&lt;&#x2F;a&gt; for more information.&lt;&#x2F;p&gt;
&lt;p&gt;--&lt;&#x2F;p&gt;
&lt;p&gt;Errors, all they cause is trouble. The dreaded 500 error showed up when
visiting my favourite tech website, the one I am the administrator for. This
time I had enough, there was going to be no more playing around with PHP
settings, attempting to figure out why PHP was suddenly dying and or why
&lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; refused to retry a select() when it failed due to a system
signal.&lt;&#x2F;p&gt;
&lt;p&gt;The server in question runs Apache in MPM worker mode since a threaded Apache
is going to be faster than a pre-fork, besides this server does not have as
much memory so it seemed to be better to have multiple threads rather than
multiple processes, each of which would have their own memory segment. There
however is the issue that this server also needs to run PHP, the accepted
method to do so is to use &lt;code&gt;mod_php&lt;&#x2F;code&gt; along with Apache; however PHP is not thread
safe.&lt;&#x2F;p&gt;
&lt;p&gt;The alternative is FastCGI, basically it spawns PHP processes as a separate
stand-alone process, with their own memory space, much like Apache pre-fork,
however now when one process grows to big, or when a process is no longer
needed it can be cleaned up, keeping memory to a minimum. Also, FastCGI is
perfectly thread safe, this means that with Apache running in MPM worker mode
we could now still run our PHP scripts even when they were not thread safe.&lt;&#x2F;p&gt;
&lt;p&gt;Setting up &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; is not that hard, it takes some httpd.conf
configuration values, and off course the loadmodule is assumed here:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Set up mod_fastcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;IfModule `mod_fastcgi`.c&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    FastCgiIpcDir &#x2F;var&#x2F;tmp&#x2F;fcgi-ipc&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300 -idle-timeout 240 -pass-header HTTP_AUTHORIZATION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddHandler  fastcgi-script              .fcgi .fcg .fpl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Action      application&#x2F;x-httpd-php5    &#x2F;fastcgi-bin&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddType     application&#x2F;x-httpd-php5    .php .php5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;IfModule&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Set up the script alias, basically anything in this directory gets executed as a fastcgi script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ScriptAlias &#x2F;fastcgi-bin&#x2F; &amp;quot;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;Location &#x2F;fastcgi-bin&#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Options ExecCGI &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SetHandler fastcgi-script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Order allow,deny&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Allow from all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;Location&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Because of errors that &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; was throwing out at me, I figured
&lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; is worth a try. However all of the configurations I found required
me to add an FCGIWrapper line into each of my VirtualHost blocks, which was an
immediate no-no since there is well over 100 of those on the server, and I&#x27;d
rather spend my time doing other things.&lt;&#x2F;p&gt;
&lt;p&gt;With some trial and error, and some Googling I put the following together for
&lt;code&gt;mod_fcgid&lt;&#x2F;code&gt;, tested it out, and once it worked perfectly set Apache off running
with the following configuration:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Set up mod_fcgid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;IfModule `mod_fcgid`.c&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddHandler  fcgid-script                 .fcgi .fcg .fpl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    IPCCommTimeout 60&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SocketPath  &#x2F;var&#x2F;tmp&#x2F;fcgi-ipc&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Action      application&#x2F;x-httpd-php5    &#x2F;fastcgi-bin&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddType     application&#x2F;x-httpd-php5    .php .php5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;IfModule&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Set up the script alias, basically anything in this directory gets executed as a fastcgi script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ScriptAlias &#x2F;fastcgi-bin&#x2F; &amp;quot;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;Location &#x2F;fastcgi-bin&#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Options ExecCGI &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SetHandler fcgid-script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Order allow,deny&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Allow from all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;Location&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Notice how similar they both are, that was the whole goal. &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; was
supposed to be a drop in replacement, and thankfully it was. PHP was served as
it once was, with a twist.&lt;&#x2F;p&gt;
&lt;p&gt;The php5.fcgi script is as follows for those of you trying to set this up as
well:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# To use your own php.ini, comment the next line and uncomment the following one&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#PHPRC=&amp;quot;&#x2F;usr&#x2F;local&#x2F;etc&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#export PHPRC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;PHP_FCGI_CHILDREN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; PHP_FCGI_CHILDREN&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;bin&#x2F;php-cgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Some things that that intrigued me is that my php processes seemed to be capped
now. Where &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; would spawn processes but never remove them or kill
them when they were no longer needed, &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; keeps the running php
processes to a sane limit instantly starting new processes when required to
handle the requests coming in. This means that the server now has more free
memory for MySQL, or file caches which has helped speed up other types of
transfers as well. Even with the relatively short time that &lt;code&gt;mod_fcgid&lt;&#x2F;code&gt; has
been in place it has been faster, more reliable and more sane than
&lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt;. Whichever one you pick, make sure to benchmark your server and
check your error logs to solve common issues, the issue may not be what FastCGI
module you picked but rather PHP itself that is causing the errors!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Hosting NFS shares from a Zone</title>
        <published>2009-02-21T00:10:26+00:00</published>
        <updated>2009-02-21T00:10:26+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2009/hosting-nfs-shares-from-a-zone/"/>
        <id>https://funcptr.net/2009/hosting-nfs-shares-from-a-zone/</id>
        
        <content type="html" xml:base="https://funcptr.net/2009/hosting-nfs-shares-from-a-zone/">&lt;p&gt;I am currently trying to get my web development environment all set up.
While I like using vi, I really do prefer TextMate on my Mac OS X to do
the real heavy lifting and all of the editing.&lt;&#x2F;p&gt;
&lt;p&gt;As I was working on getting my homedir on my zone to be shared over NFS I
was getting errors that NFS was not a valid protocol from &lt;code&gt;sharemgr&lt;&#x2F;code&gt;, the
program that is used to add new shares to the system.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# sharemgr create -P nfs homedir  &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Invalid protocol specified: nfs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A little bit of Googling brought me to a mailing list message saying that
some server packages may be missing. This is entirely possible since my
Zone was created with a minimal set of packages, so I log into the global
host where NFS sharing does work and run the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@Keyhole.network.lan:~# pkg list | grep nfs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SUNWnfsc                                      0.5.11-0.101    installed  ----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SUNWnfsckr                                    0.5.11-0.101    installed  ----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SUNWnfss                                      0.5.11-0.101    installed  ----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SUNWnfsskr                                    0.5.11-0.101    installed  ----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ah, so those are probably not installed in the zone, quick &lt;code&gt;pkg install&lt;&#x2F;code&gt;
later:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# pkg install SUNWnfsc SUNWnfsckr SUNWnfss SUNWnfsskr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DOWNLOAD                                    PKGS       FILES     XFER (MB)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Completed                                    3&#x2F;3       17&#x2F;17     0.28&#x2F;0.28 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PHASE                                        ACTIONS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Install Phase                                  55&#x2F;55 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PHASE                                          ITEMS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Reading Existing Index                           9&#x2F;9 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Indexing Packages                                3&#x2F;3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, lets re-run the &lt;code&gt;sharemgr&lt;&#x2F;code&gt; command again and see if this time we do
indeed get our group created:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# sharemgr create -P nfs homedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# sharemgr show -vp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;default nfs=()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;zfs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;homedir nfs=()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Yes, there we go. Now I can add a share to that group. Until more errors
start showing up:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# sharemgr add-share -s &#x2F;export&#x2F;home&#x2F;xistence&#x2F; homedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NFS: Cannot share remote filesystem: &#x2F;export&#x2F;home&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NFS: Service needs to be enabled by a privileged user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Failed to enable share for &amp;quot;nfs&amp;quot;: system error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This time Google does not help out, instead it gives me the option to
search without quotes around the search terms which gives me absolutely
nothing.&lt;&#x2F;p&gt;
&lt;p&gt;Well, lets see if the services are running in the first place:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# svcs -a | grep nfs    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;disabled       22:19:04 svc:&#x2F;network&#x2F;nfs&#x2F;client:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;disabled       22:24:26 svc:&#x2F;network&#x2F;nfs&#x2F;server:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;online         22:24:20 svc:&#x2F;network&#x2F;nfs&#x2F;rquota:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;online         22:24:20 svc:&#x2F;network&#x2F;nfs&#x2F;status:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;online         22:24:20 svc:&#x2F;network&#x2F;nfs&#x2F;mapid:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;online         22:24:20 svc:&#x2F;network&#x2F;nfs&#x2F;cbd:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;online         22:24:21 svc:&#x2F;network&#x2F;nfs&#x2F;nlockmgr:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Nope, for some reason the nfs server keeps being disabled even though I
did enable it using &lt;code&gt;svcadmin&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Okay, lets take a look with &lt;code&gt;svcs&lt;&#x2F;code&gt; what is going on:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:&#x2F;# svcs -l nfs&#x2F;server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;fmri         svc:&#x2F;network&#x2F;nfs&#x2F;server:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;name         NFS server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;enabled      false (temporary)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;state        disabled&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;next_state   none&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;state_time   Fri Feb 20 22:25:26 2009&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;logfile      &#x2F;var&#x2F;svc&#x2F;log&#x2F;network-nfs-server:default.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;restarter    svc:&#x2F;system&#x2F;svc&#x2F;restarter:default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;contract_id  &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   require_any&#x2F;error svc:&#x2F;milestone&#x2F;network (online)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   require_all&#x2F;error svc:&#x2F;network&#x2F;nfs&#x2F;nlockmgr (online)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   optional_all&#x2F;error svc:&#x2F;network&#x2F;nfs&#x2F;mapid (online)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   require_all&#x2F;restart svc:&#x2F;network&#x2F;rpc&#x2F;bind (online)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   optional_all&#x2F;none svc:&#x2F;network&#x2F;rpc&#x2F;keyserv (disabled)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   optional_all&#x2F;none svc:&#x2F;network&#x2F;rpc&#x2F;gss (absent)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   optional_all&#x2F;none svc:&#x2F;network&#x2F;shares&#x2F;group (multiple)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dependency   require_all&#x2F;error svc:&#x2F;system&#x2F;filesystem&#x2F;local (online)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ah, it has a log file, lets see what that log file says:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:&#x2F;# cat &#x2F;var&#x2F;svc&#x2F;log&#x2F;network-nfs-server\:default.log &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ Feb 20 22:11:07 Disabled. ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ Feb 20 22:11:07 Rereading configuration. ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ Feb 20 22:18:43 Enabled. ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ Feb 20 22:19:04 Enabled. ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ Feb 20 22:24:21 Executing start method (&amp;quot;&#x2F;lib&#x2F;svc&#x2F;method&#x2F;nfs-server start&amp;quot;). ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;The NFS server is not supported in a local zone&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Eh? What? That seems weird, but it is of course plausible. Zones are new
to Solaris and thus not everything may be virtualised yet. Taking that
query to google brings me to a web page asking the same question I am
asking: Local zone as NFS server. Taking a look it brings me to a bug
report and ultimately to: Bug ID 4964859 RFE: Zones should be able to be
NFS servers. Well, I guess that ends that little stunt. I will be sharing
it from the global zone. While this is acceptable to me, I do not believe
that it is acceptable to most other people using Zones, and while it is
unfortunate but it does not look like there is a whole lot of activity on
the bug, as apparently there are no resources available.&lt;&#x2F;p&gt;
&lt;p&gt;I ended up doing the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sharemgr create -P nfs webdev-homedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then I followed that up with some servers that should be allowed access,
and others that should not:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sharemgr set -P nfs -S sys -p &amp;#39;rw=10.10.10.226 none=*&amp;#39; webdev-homedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then finally I added the share I wanted to share all along:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sharemgr add-share -r &amp;quot;homedir&amp;quot; -d &amp;quot;xistence home dir&amp;quot; -s &#x2F;storage&#x2F;zones&#x2F;dev-web&#x2F;root&#x2F;export&#x2F;home&#x2F;xistence webdev-homedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This creates a long NFS share to type in, since the full path now becomes:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nfs:&#x2F;&#x2F;keyhole&#x2F;storage&#x2F;zones&#x2F;dev-web&#x2F;root&#x2F;export&#x2F;home&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Which is not that big of a problem for me, especially since I just save
it in my favourites in Mac OS X and everything is peachy. It works like a
charm.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Upgrading an OpenSolaris ipkg zone</title>
        <published>2009-01-18T00:10:02+00:00</published>
        <updated>2009-01-18T00:10:02+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2009/so-you-want-to-upgrade-your-zone/"/>
        <id>https://funcptr.net/2009/so-you-want-to-upgrade-your-zone/</id>
        
        <content type="html" xml:base="https://funcptr.net/2009/so-you-want-to-upgrade-your-zone/">&lt;p&gt;Recently I was working on my OpenSolaris machine (file server, ZFS rocks, will
write more on that later), and I have one non-global zone, one that use for web
development, which is aptly called dev-web.&lt;&#x2F;p&gt;
&lt;p&gt;So the following shows up when I run zoneadm:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# zoneadm list -iv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ID NAME             STATUS     PATH                           BRAND    IP    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   0 global           running    &#x2F;                              native   shared&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   4 dev-web          running    &#x2F;storage&#x2F;zones&#x2F;dev-web         ipkg     shared&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The thing is, I had upgraded the global zone with the latest update available for the version (&lt;code&gt;snv_101b&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;pkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; image-update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This had not upgraded my one none-global zone. And running &lt;code&gt;pkg image-update&lt;&#x2F;code&gt;
from within the zone itself is not possible, because you can&#x27;t do an upgrade on
a &quot;live&quot; system, mainly because the &lt;code&gt;image-update&lt;&#x2F;code&gt; wants to create a new bootable
environment, something that was already created when I upgraded the global
zone. So what we have to do is mount the non-global zone to &lt;code&gt;&#x2F;mnt&lt;&#x2F;code&gt; and tell &lt;code&gt;pkg&lt;&#x2F;code&gt;
with &lt;code&gt;-R&lt;&#x2F;code&gt; where to find it and upgrade it anyway!&lt;&#x2F;p&gt;
&lt;p&gt;First we are going to halt the current zone, important is running on the test
system, I just used:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zoneadm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -z&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; dev-web halt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;However, the better way is to off course use the shutdown command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zlogin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; dev-web shutdown&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and then for good measure a halt!&lt;&#x2F;p&gt;
&lt;p&gt;Next up, looking at what we are going to be mounting.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# zfs list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool                             11.9G  42.7G    75K  &#x2F;rpool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;ROOT                        2.93G  42.7G    18K  legacy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;ROOT&#x2F;opensolaris            7.34M  42.7G  2.74G  &#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;ROOT&#x2F;opensolaris-1          2.92G  42.7G  2.74G  &#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;dump                        1.87G  42.7G  1.87G  -&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;export                      5.27G  42.7G    19K  &#x2F;export&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;export&#x2F;home                 5.27G  42.7G    21K  &#x2F;export&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;export&#x2F;home&#x2F;guest           5.24G  14.8G  5.24G  &#x2F;export&#x2F;home&#x2F;guest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;export&#x2F;home&#x2F;xistence        37.0M  42.7G  37.0M  &#x2F;export&#x2F;home&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rpool&#x2F;swap                        1.87G  43.0G  1.51G  -&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage                            493G  3.08T  35.1K  &#x2F;storage&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;media                      398G  3.08T   398G  &#x2F;storage&#x2F;media&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;virtualbox                2.10G  3.08T  2.10G  &#x2F;storage&#x2F;virtualbox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;xistence                  91.7G  3.08T  91.7G  &#x2F;storage&#x2F;xistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;zones                      957M  99.1G  30.4K  &#x2F;storage&#x2F;zones&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;zones&#x2F;dev-web              957M  19.1G  32.0K  &#x2F;storage&#x2F;zones&#x2F;dev-web&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;zones&#x2F;dev-web&#x2F;ROOT         957M  19.1G  28.8K  legacy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;zones&#x2F;dev-web&#x2F;ROOT&#x2F;zbe    1.60M  19.1G   936M  legacy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;storage&#x2F;zones&#x2F;dev-web&#x2F;ROOT&#x2F;zbe-1   955M  19.1G   935M  legacy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;When &lt;code&gt;pkg image-update&lt;&#x2F;code&gt; was run on the global zone it created a new bootable
environment named opensolaris-1, the cool thing is, that &lt;code&gt;beadm&lt;&#x2F;code&gt; at the same time
will also create a new bootable environment for your zones. That way you can
upgrade your zones afterwards, and if stuff does not work, you can revert the
ENTIRE machine back to the previous state (ZFS is cool like that), thereby also
making sure that your zones are reverted so that there are no
incompatibilities.&lt;&#x2F;p&gt;
&lt;p&gt;So what we are looking for in this case is a zbe-1, this is the new root for
the zone that we need to update, so we now need to mount it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; zfs storage&#x2F;zones&#x2F;dev-web&#x2F;ROOT&#x2F;zbe-1 &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note, that there is no &lt;code&gt;&#x2F;&lt;&#x2F;code&gt; in front of storage, this is because we are specifying
a pool name, since there is no &quot;real&quot; path that is defined as
&lt;code&gt;&#x2F;storage&#x2F;zones&#x2F;dev-web&#x2F;ROOT&#x2F;zbe-1&lt;&#x2F;code&gt;. Now that it is mounted, we are able to pass
the -R flag to pkg, to get it to update our zone:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# pkg -R &#x2F;mnt image-update -v&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Creating Plan &#x2F; Before evaluation:     &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UNEVALUATED:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;+pkg:&#x2F;entire@0.5.11,5.11-0.101:20081204T010954Z&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;After evaluation:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pkg:&#x2F;entire@0.5.11,5.11-0.101:20081119T235706Z -&amp;gt; pkg:&#x2F;entire@0.5.11,5.11-0.101:20081204T010954Z&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Actuators:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;None&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PHASE                                        ACTIONS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Update Phase                                     1&#x2F;1 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PHASE                                          ITEMS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Reading Existing Index                           9&#x2F;9 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Indexing Packages                                1&#x2F;1 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------------------------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NOTE: Please review release notes posted at:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   http:&#x2F;&#x2F;opensolaris.org&#x2F;os&#x2F;project&#x2F;indiana&#x2F;resources&#x2F;relnotes&#x2F;200811&#x2F;x86&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------------------------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Voilá, and the deed is done. The last command is to off course unmount the
zone, that we can then issue a zoneadm boot command to start it back up:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;umount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;zoneadm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -z&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; dev-web boot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then on the zone after we log into it (over SSH in my case):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xistence@webdev.network.lan:~# pkg list -u&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;No installed packages have available updates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Which is exactly what we wanted! Your zone is now upgraded with the latest
version available from the global zone.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Using DJB&#x27;s daemontools and netcat to bounce a request around</title>
        <published>2008-11-29T17:56:05+00:00</published>
        <updated>2008-11-29T17:56:05+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2008/using-djb-s-daemontools-and-netcat-to-bounce-an-incoming-request-around-the-world/"/>
        <id>https://funcptr.net/2008/using-djb-s-daemontools-and-netcat-to-bounce-an-incoming-request-around-the-world/</id>
        
        <content type="html" xml:base="https://funcptr.net/2008/using-djb-s-daemontools-and-netcat-to-bounce-an-incoming-request-around-the-world/">&lt;p&gt;Lately I have been moving the data from one server to another server, located
halfway across the globe, and I needed some way to forward all incoming
requests from the old server to the new server. This had to be done so that DNS
could take its time to update while everything was now already being served
from the new location.&lt;&#x2F;p&gt;
&lt;p&gt;What I ended up doing was using daemontools along with netcat to pipe the
request around the world. Here are the steps I took in doing so:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;redirect&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;redirect&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; smtp smtp&#x2F;env&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; smtp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Put the following in a file named run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;envdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; .&#x2F;env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    case &amp;quot;$REMOTENAME&amp;quot; in h) H=;; p) H=p;; *) H=H;; esac&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    case &amp;quot;$REMOTEINFO&amp;quot; in r) R=;; [0-9]*) R=&amp;quot;t$REMOTEINFO&amp;quot;;; *) R=R;; esac&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    exec \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;    &#x2F;usr&#x2F;local&#x2F;bin&#x2F;tcpserver \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        -vDU&amp;quot;$H$R&amp;quot; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        ${LOCALNAME+&amp;quot;-l$LOCALNAME&amp;quot;} \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        ${BACKLOG+&amp;quot;-b$BACKLOG&amp;quot;} \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        ${CONCURRENCY+&amp;quot;-c$CONCURRENCY&amp;quot;} \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        -- &amp;quot;${IP-0}&amp;quot; &amp;quot;${PORT}&amp;quot; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;        &#x2F;usr&#x2F;bin&#x2F;nc &amp;quot;${REMOTEHOST}&amp;quot; &amp;quot;${REMOTEPORT}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make it executable: &lt;code&gt;chmod +x run&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Then we need to set up a few environment variables:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; env&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;example.net&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; REMOTEHOST&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;25&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; REMOTEPORT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;25&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; PORT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;hostname&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt; LOCALNAME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;200&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; CONCURRENCY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I made &lt;code&gt;REMOTEPORT&lt;&#x2F;code&gt; and &lt;code&gt;PORT&lt;&#x2F;code&gt; be separate on purpose, in one case I now had more
IP&#x27;s than before, so instead of having SSL running on a separate port it was
running on the default port, and I needed a clean way to forward that.&lt;&#x2F;p&gt;
&lt;p&gt;Now just add it to your services folder as a symlink and it will automatically
be started, from there it will do it&#x27;s job! I also suggest adding some simple
logging, or discarding all off the output from tcpserver.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>FreeBSD GEOM striping and concatenation</title>
        <published>2006-12-13T06:44:20+00:00</published>
        <updated>2006-12-13T06:44:20+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2006/freebsd-geom-striping-and-concatenation/"/>
        <id>https://funcptr.net/2006/freebsd-geom-striping-and-concatenation/</id>
        
        <content type="html" xml:base="https://funcptr.net/2006/freebsd-geom-striping-and-concatenation/">&lt;p&gt;Some of the hard drives in my FreeBSD box. Just a little back-story:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad0 - 20 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad1 - 40 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad2 - 100 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad3 - 60 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;da0 - 8 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;da1 - 8 GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I had already made a &lt;code&gt;gstripe(8)&lt;&#x2F;code&gt; out of the two SCSI drives, &lt;code&gt;da[1|2]&lt;&#x2F;code&gt;,
however I wanted to see if I could do the same with &lt;code&gt;ad[1|2|3]&lt;&#x2F;code&gt;. As I did
not want to resort to gvinum, which is rather heavy, and I was unable to
figure out how it worked. The entire point behind gstripe is that since it
is striped, the writes&#x2F;reads are faster since it writes&#x2F;reads to all the
drives at the same time. So first I tried:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;gstripe&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; label&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; st1 &#x2F;dev&#x2F;ad1 &#x2F;dev&#x2F;ad2 &#x2F;dev&#x2F;ad3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That however complained that it would only use 40 GB&#x27;s on all of the
drives, since the smallest drive in the collection was 40 GB. I then read
up on &lt;code&gt;gconcat(8)&lt;&#x2F;code&gt;, which concatenates all the drives together to look
like one big drive, without the speed improvement of striping. So I
figured, since FreeBSD&#x27;s gstripe is GEOM based, it should not care about
what the underlying data sink is, just that it is a device, so just maybe
this could work:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;gconcat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; label&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; gb100 &#x2F;dev&#x2F;ad1 &#x2F;dev&#x2F;ad3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;So now I had created a 100 GB &quot;hd&quot; at &lt;code&gt;&#x2F;dev&#x2F;concat&#x2F;gb100&lt;&#x2F;code&gt;. I now did what
I was planning to do:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;gstripe&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; label&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; st1 &#x2F;dev&#x2F;ad2 &#x2F;dev&#x2F;concat&#x2F;gb100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;No problem. I now had 180.48 GB, of which only about 166 GB was usable.
Which is still excellent. As it still came with a speed improvement.
Followed up with the standard advice from &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.freebsd.org&#x2F;doc&#x2F;en_US.ISO8859-1&#x2F;books&#x2F;handbook&#x2F;geom-striping.html&quot;&gt;the handbook&lt;&#x2F;a&gt; I did the
following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;bsdlabel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -wB&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;dev&#x2F;stripe&#x2F;st1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;newfs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;dev&#x2F;stripe&#x2F;st1a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;dev&#x2F;stripe&#x2F;st1a &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Which got me the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;stripe&#x2F;st1a    180G    5.5G    161G     3%    &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Full:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Filesystem          Size    Used   Avail Capacity  Mounted on&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad0s1a         496M     63M    393M    14%    &#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;devfs               1.0K    1.0K      0B   100%    &#x2F;dev&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad0s1e         496M    230K    456M     0%    &#x2F;tmp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad0s1f          15G    2.2G     11G    17%    &#x2F;usr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;ad0s1d         1.4G    115M    1.2G     9%    &#x2F;var&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;stripe&#x2F;st0a     16G    4.0K     15G     0%    &#x2F;usr&#x2F;scsi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;stripe&#x2F;st1a    180G    5.5G    161G     3%    &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next up I might actually add &lt;code&gt;gdbe(8)&lt;&#x2F;code&gt; or &lt;code&gt;geli(8)&lt;&#x2F;code&gt; even in front of the
stripe, so that I will have an encrypted stripe. Talk about stacking.
Might give gvinum a try sometime.&lt;&#x2F;p&gt;
&lt;p&gt;All working:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;keyhole# gconcat status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        Name  Status  Components&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;concat&#x2F;gb100      UP  ad1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                      ad3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;keyhole# gstripe status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Name  Status  Components&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;stripe&#x2F;st0      UP  da0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    da1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;stripe&#x2F;st1      UP  ad2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    concat&#x2F;gb100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
        
    </entry>
    <entry xml:lang="en">
        <title>FastCGI quick and dirty</title>
        <published>2006-09-13T00:19:31+00:00</published>
        <updated>2006-09-13T00:19:31+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2006/fastcgi-quick-and-dirty/"/>
        <id>https://funcptr.net/2006/fastcgi-quick-and-dirty/</id>
        
        <content type="html" xml:base="https://funcptr.net/2006/fastcgi-quick-and-dirty/">&lt;p&gt;In this quick and dirty guide for FreeBSD I will assume you have already
compiled and installed PHP5 with fcgi mode enabled, which can be checked by
running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;bin&#x2F;php-cgi&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I will also assume you have installed &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; from &lt;code&gt;www&#x2F;mod_fastcgi&lt;&#x2F;code&gt;
in the ports.&lt;&#x2F;p&gt;
&lt;p&gt;Create the fast cgi ipc temp dir, make sure you place this somewhere it will
keep existing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;var&#x2F;tmp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;var&#x2F;tmp&#x2F;fcgi-ipc&#x2F;dynamic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -R&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 0777&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;var&#x2F;tmp&#x2F;fcgi-ipc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s create the directory where we are going to place our PHP wrapper, this
config is for server wide using the same FastCGI PHP config. This is on
purpose, since it will allow server wide PHP usage. If you want you could then
split it up into virtualhosts if one required a standalone php running for
that.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 755&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next up we create the very simple wrapper:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; EOF&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;#!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;# To use your own php.ini, comment the next line and uncomment the following one&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;#PHPRC=&amp;quot;&#x2F;usr&#x2F;local&#x2F;etc&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;export PHPRC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;PHP_FCGI_CHILDREN=8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;export PHP_FCGI_CHILDREN&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;exec &#x2F;usr&#x2F;local&#x2F;bin&#x2F;php-cgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Set &lt;code&gt;PHP_FCGI_CHILDREN&lt;&#x2F;code&gt; to whatever value you want, that is how many processes
it will use. I suggest the standard which is 8, if you make it more, you use
more ram, you make it less Apache will have to wait if all of the PHP
processes are in use.&lt;&#x2F;p&gt;
&lt;p&gt;Next up, make it executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; +x &#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Last but not least, edit &lt;code&gt;httpd.conf&lt;&#x2F;code&gt; and make sure to add a comment in front
of the &lt;code&gt;mod_php5&lt;&#x2F;code&gt; line, and uncomment the &lt;code&gt;mod_fastcgi&lt;&#x2F;code&gt; line. Then add this
to the end of your Apache config:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;IfModule mod_fastcgi.c&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    FastCgiIpcDir &#x2F;var&#x2F;tmp&#x2F;fcgi-ipc&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    FastCgiConfig  -pass-header HTTP_AUTHORIZATION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddHandler  fastcgi-script              .fcgi .fcg .fpl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Action      application&#x2F;x-httpd-php5    &#x2F;fastcgi-bin&#x2F;php5.fcgi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AddType     application&#x2F;x-httpd-php5    .php .php5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;IfModule&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ScriptAlias &#x2F;fastcgi-bin&#x2F; &amp;quot;&#x2F;usr&#x2F;local&#x2F;www&#x2F;fastcgi-bin&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;Location &#x2F;fastcgi-bin&#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Options ExecCGI&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SetHandler fastcgi-script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Order allow,deny&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Allow from all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;Location&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. Restart apache and watch as the first time you access a PHP script
FastCGI will spawn several of them, and they start serving requests. Load
usage may seem higher, that is because unlike Apache the standalone running
PHP&#x27;s handle the jobs as they come in with whatever one is first, Apache will
try to put as much work in one of its preforked modules. As the PHP processes
come and go through FastCGI the memory usage will go up and down. Mine has
an average of about 300 MB, which is very good compared to the 800 MB Apache
with &lt;code&gt;mod_php&lt;&#x2F;code&gt; would rack up.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Backup Script</title>
        <published>2006-09-09T00:33:02+00:00</published>
        <updated>2006-09-09T00:33:02+00:00</updated>
        
        <author>
          <name>
            
              Delta Regeer
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://funcptr.net/2006/backup-script/"/>
        <id>https://funcptr.net/2006/backup-script/</id>
        
        <content type="html" xml:base="https://funcptr.net/2006/backup-script/">&lt;p&gt;I was working on some backup scripts and I decided I might as well generalise
almost all of it (I am sorry about the hard coded paths) so almost anyone can
come grab it and use it on their servers. The shell script is pretty self
explanatory and I am not very good at documenting code, so the script source
itself is your best bet as to why I did something some way. This script is in
production use on several servers I administrate, I hope someone can use it as
well.&lt;&#x2F;p&gt;
&lt;p&gt;Documentation on how to use it:&lt;&#x2F;p&gt;
&lt;p&gt;A backup script which will mount &lt;code&gt;&#x2F;backup&lt;&#x2F;code&gt;, then use rsync to copy files from
&lt;code&gt;&#x2F;usr&#x2F;home&lt;&#x2F;code&gt; to &lt;code&gt;&#x2F;backup&#x2F;yyyy-mm-dd&lt;&#x2F;code&gt;. After it is done, it will remove the
oldest backup, 14 days ago. All paths are hardcoded.&lt;&#x2F;p&gt;
&lt;p&gt;If a file &lt;code&gt;.exclude&lt;&#x2F;code&gt; is in a user&#x27;s homedir, it is looked at, and is used to
exclude certain directories or files from the rsync. For example:&lt;&#x2F;p&gt;
&lt;p&gt;In &lt;code&gt;&#x2F;usr&#x2F;home&#x2F;xistence&#x2F;.exclude&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;public_html&#x2F;iso&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;No trailing slash, this will cause the folder
&lt;code&gt;&#x2F;usr&#x2F;home&#x2F;xistence&#x2F;public_html&#x2F;iso&lt;&#x2F;code&gt; to not be backed up. This might be for
various reasons, but for this example it is because backing up GB sized files
should not be something that is done, only because it takes ages and wastes
valuable space.&lt;&#x2F;p&gt;
&lt;p&gt;Thing to keep in mind is, if you want to backup a 40 GB HD, with 22 GB used,
to keep even a 3 day backup of that would require 3 * 22 GB, or 66 GB of
available space on the backup drive. It is therefore in one&#x27;s best interest
to exclude very large files, and back them up in a different method since
they are most likely not going to change much across revisions.&lt;&#x2F;p&gt;
&lt;p&gt;This script should be set to cron every 30 minutes, as rsync will do one full
backup when the day changes, and then from there on do incremental backups.&lt;&#x2F;p&gt;
&lt;p&gt;Maybe removing the &lt;code&gt;--delete&lt;&#x2F;code&gt; option might help with customers that delete
files and expect them to still be in the backup for that day, this way
however if a file is removed it will still exist in the backup until it is
deleted after 14 days.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D6DEEB; background-color: #011627;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;#!&#x2F;usr&#x2F;local&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# This file REQUIRES bash, and can not be run under &#x2F;bin&#x2F;sh!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;###&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # Copyright 2006 Delta Regeer. All rights  reserved.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # Redistribution and use in source and binary forms, with or without&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # modification, are permitted provided that the following conditions&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # are met:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # 1. Redistributions of source code must retain the above copyright&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #    notice, this list of conditions and the following disclaimer.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # 2. Redistributions in binary form must reproduce the above copyright&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #    notice, this list of conditions and the following disclaimer in the&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #    documentation and&#x2F;or other materials provided with the distribution.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS&amp;#39;&amp;#39; AND&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # SUCH DAMAGE.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # The views and conclusions contained in the software and  documentation are&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # those of the authors and should not be  interpreted as representing official&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; # policies, either expressed  or implied, of bsdPanel project.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt; #&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;###&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; HOMEDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;usr&#x2F;bin&#x2F;find&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;home&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -maxdepth&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;^.$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;	if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $HOMEDIR&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.exclude ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;		echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Exclude found for &lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$HOMEDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;		while&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; line&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;			if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;				# They are missing a full path, we will be nice and add it&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;				TMPLINE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$HOMEDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;				line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$TMPLINE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;			fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;			echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;	Excluding &lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;			echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;tmp&#x2F;exclude.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;$$&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;		done&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $HOMEDIR&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.exclude&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;	fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -ne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	&#x2F;sbin&#x2F;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;	if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -ne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;		logger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -s -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; user.err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Backup drive could not be mounted! Bailing!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;		&#x2F;sbin&#x2F;umount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;		exit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;	fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;BACKUPDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;backup&#x2F;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;+%Y-%m-%d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;OLDDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;&#x2F;backup&#x2F;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -v-14d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;+%Y-%m-%d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; ! -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $BACKUPDIR&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $BACKUPDIR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -ne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	logger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -s -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; user.err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Could not create backup folder &lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$BACKUPDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;. Bailing!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	&#x2F;sbin&#x2F;umount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;	exit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #637777;font-style: italic;&quot;&gt;# We got this far, now we have to run rsync. Rsync is very verbose on purpose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;bin&#x2F;rsync&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -av --relative --delete&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;usr&#x2F;home&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $BACKUPDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; --exclude-from=&#x2F;tmp&#x2F;exclude.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;$$&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt; $?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -ne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	logger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -s -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; user.err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;rsync failed. Do not trust backup (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$BACKUPDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	&#x2F;sbin&#x2F;umount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;	exit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F78C6C;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C5E478;font-style: italic;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Backup complete! Deleting oldest backup (14 days ago)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $OLDDIR&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;	rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -rf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt; $OLDDIR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #C792EA;font-style: italic;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;sbin&#x2F;umount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;&#x2F;bin&#x2F;rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; &#x2F;tmp&#x2F;exclude.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #7FDBCA;&quot;&gt;$$&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #82AAFF;font-style: italic;&quot;&gt;logger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -s -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; user.notice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #82AAFF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt; backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;Backup complete at &lt;&#x2F;span&gt;&lt;span style=&quot;color: #C5E478;&quot;&gt;$BACKUPDIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #ECC48D;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D9F5DD;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
        
    </entry>
</feed>
