<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[/var/tmp/notes]]></title><description><![CDATA[Téo de Hesselle's technical notes on unix and other technology]]></description><link>https://velocity-blog.teodeh.com/</link><image><url>https://velocity-blog.teodeh.com/favicon.png</url><title>/var/tmp/notes</title><link>https://velocity-blog.teodeh.com/</link></image><generator>Ghost 4.34</generator><lastBuildDate>Sun, 01 Nov 2026 06:06:12 GMT</lastBuildDate><atom:link href="https://velocity-blog.teodeh.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[microk8s installation notes]]></title><description><![CDATA[<ul><li>tested on ubuntu 18.04 </li><li>not suitable for production use.</li></ul><h2 id="software-installation">Software installation</h2><p>Adapted from ubuntu <a href="https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#2-deploying-microk8s">documentation</a></p><pre><code>sudo snap install microk8s --classic --channel 1.23/stable</code></pre><p></p><h2 id="grant-admin-access-to-non-root-user">grant admin access to non-root user:</h2><pre><code>mkdir ~/.kube
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
sudo microk8s config &gt; ~/.kube/</code></pre>]]></description><link>https://velocity-blog.teodeh.com/microk8s/</link><guid isPermaLink="false">62005916cabd010001ede923</guid><category><![CDATA[k8s]]></category><category><![CDATA[ubuntu]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Mon, 07 Feb 2022 01:08:51 GMT</pubDate><content:encoded><![CDATA[<ul><li>tested on ubuntu 18.04 </li><li>not suitable for production use.</li></ul><h2 id="software-installation">Software installation</h2><p>Adapted from ubuntu <a href="https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#2-deploying-microk8s">documentation</a></p><pre><code>sudo snap install microk8s --classic --channel 1.23/stable</code></pre><p></p><h2 id="grant-admin-access-to-non-root-user">grant admin access to non-root user:</h2><pre><code>mkdir ~/.kube
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
sudo microk8s config &gt; ~/.kube/config</code></pre><div class="kg-card kg-callout-card kg-callout-card-yellow"><div class="kg-callout-emoji">&#x1F4A1;</div><div class="kg-callout-text">Continue in a new session for the above group permissions to apply</div></div><h2 id="enable-add-ons">enable add-ons</h2><pre><code>microk8s enable dns dashboard storage
</code></pre><h2 id="expose-dashboard-as-a-nodeport">expose dashboard as a nodeport:</h2><pre><code>microk8s kubectl expose \
  -n kube-system deployment   kubernetes-dashboard \
  --type=NodePort --name=kubernetes-dashboard-np
  
  
# find the external port:
microk8s kubectl get service -n kube-system kubernetes-dashboard-np</code></pre><h2 id="get-secret-login-to-dashboard">get secret &amp; login to dashboard</h2><p>it&apos;s a long, ugly string:</p><pre><code>token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d &quot; &quot; -f1)
microk8s kubectl -n kube-system describe secret $token
</code></pre><p>... now we can login to the host via the nodeport service</p><p></p><h2 id="uninstall-remove-data">Uninstall &amp; Remove data</h2><pre><code>microk8s reset
</code></pre>]]></content:encoded></item><item><title><![CDATA[OSX: Per domain DNS servers]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Little known OSX feature (or at least it was new to me):</p>
<p>You can specify a separate DNS resolver configuration per domain. This can be useful to supplement or over-ride VPN connections.</p>
<p>Best of all, it&apos;s really easy -- to specify a custom server for <code>mydomain.int</code>, just</p>]]></description><link>https://velocity-blog.teodeh.com/osx_per_domain_dns_servers/</link><guid isPermaLink="false">603c4a332269e10001cb55d1</guid><category><![CDATA[osx]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Fri, 12 Jul 2013 00:00:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Little known OSX feature (or at least it was new to me):</p>
<p>You can specify a separate DNS resolver configuration per domain. This can be useful to supplement or over-ride VPN connections.</p>
<p>Best of all, it&apos;s really easy -- to specify a custom server for <code>mydomain.int</code>, just run:</p>
<pre><code>sudo mkdir /etc/resolver
sudo echo &quot;nameserver 10.10.10.10 &gt; /etc/resolver/mydomain.int
</code></pre>
<p>&#x2026; and that&apos;s it.</p>
<p>It&apos;s documented in <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/resolver.5.html">resolver(5)</a>, available on apple&apos;s website.</p>
<p><strong>Note:</strong> You can&apos;t use tbhis to override the default resolver. Use System Preferences for that.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[OSX Time Machine Backups to Solaris ZFS Volume]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><em>Tested on Solaris 11.1, Netatalk 3.0.4, and OSX 10.8.4</em></p>
<p>Goal: Back up the household laptops over the network to a solaris fileserver</p>
<p>This seems to work better with AFP rather than SMB, so I installed <a href="http://netatalk.sourceforge.net/">netatalk 3.0.4</a> from source.</p>
<p>Note: This was cobbled</p>]]></description><link>https://velocity-blog.teodeh.com/osx_time_machine_backups_to_solaris_zfs_volume/</link><guid isPermaLink="false">603c4a332269e10001cb55d2</guid><category><![CDATA[solaris]]></category><category><![CDATA[osx]]></category><category><![CDATA[zfs]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Sun, 07 Jul 2013 01:59:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><em>Tested on Solaris 11.1, Netatalk 3.0.4, and OSX 10.8.4</em></p>
<p>Goal: Back up the household laptops over the network to a solaris fileserver</p>
<p>This seems to work better with AFP rather than SMB, so I installed <a href="http://netatalk.sourceforge.net/">netatalk 3.0.4</a> from source.</p>
<p>Note: This was cobbled together from information contained in a few other blogs -- I don&apos;t pretend to be a netatalk expert.</p>
<h3 id="installprerequisitesolarispackages">Install Pre-requisite Solaris packages:</h3>
<pre><code>pkg install developer/gcc-3 system/library/math/header-math \ 
    developer/gnu developer/gnu-binutils  \
    developer/gnome/gettext libgcrypt openssl
`&lt;/pre&gt; 

### Download, build and install netatalk:
 &lt;pre&gt;`wget .../netatalk-3.0.4.tar.gz

tar xzf netatalk-3.0.4.tar.gz
cd netatalk-3.0.4
./configure  --without-ddp --with-init-style=solaris --prefix=/usr/local/netatalk-3.0.4
make
sudo -s     # it didn&apos;t like running make install under sudo.
install         
`&lt;/pre&gt; 

### Setup PAM for netatalk

I&apos;m not 100% sure why this would be required, I assume it&apos;s something to do with netatalk&apos;s PAM implementation.
 &lt;pre&gt;`cp /etc/pam.d/other /etc/pam.d/netatalk
`&lt;/pre&gt; 

### Make a ZFS dataset to store our data

&#x2026; since time machine is designed to eventually consume all space available, a quota is a good idea.
 &lt;pre&gt;`zfs create -o mountpoint=/timemachine tank/timemachine
zfs create -o quota=1tb tank/timemachine/tdehesse
chown tdehesse /timemachine/tdehesse
`&lt;/pre&gt; 

### Setup Netatalk
 &lt;pre&gt;`cat &amp;gt; /usr/local/netatalk-3.0.4/etc/afp.conf &amp;lt;&amp;lt;EOF
;
; Netatalk 3.x configuration file
;

[Global]
; Global server settings
mimic model = MacPro

[timemachine_tdehesse]
path=/timemachine/tdehesse
time machine = yes
EOF
`&lt;/pre&gt; 

### enable autodiscovery related services
 &lt;pre&gt;`root@velocity:bin# svcadm enable svc:/network/dns/multicast:default
root@velocity:bin# svcadm enable svc:/system/avahi-bridge-dsd:default
`&lt;/pre&gt; 

### Start netatalk

Netatalk was kind enough to include SMF functionality for us :)
 &lt;pre&gt;`svcadm enable netatalk
svcs netatalk
STATE          STIME    FMRI
online         11:11:10 svc:/network/netatalk:default
</code></pre>
<h3 id="setuposx">Setup OSX</h3>
<p>This is really simple -- Since netatalk is advertising the volume as being time-machine compatible, the volume should &quot;just work&quot; and appear in the time machine preferences as a regular volume without any client-side hacks, which should help if we ever need to do a bare-metal recovery.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Automated monthly ZFS pool scrubbing]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><em>Tested on solaris 11.1, but should work 10 and up.</em></p>
<p>Just a quick shell script and cron job to perform a monthly scrub of all pools in your system. Whether this is appropriate or not depends on the frequency of data reads in your system and whether they would</p>]]></description><link>https://velocity-blog.teodeh.com/automated_monthly_zfs_pool_scrubbing/</link><guid isPermaLink="false">603c4a332269e10001cb55d3</guid><category><![CDATA[solaris]]></category><category><![CDATA[osx]]></category><category><![CDATA[zfs]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Sat, 06 Jul 2013 23:51:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><em>Tested on solaris 11.1, but should work 10 and up.</em></p>
<p>Just a quick shell script and cron job to perform a monthly scrub of all pools in your system. Whether this is appropriate or not depends on the frequency of data reads in your system and whether they would pick up any potential data corruption or hardware  issues.</p>
<p><strong>scrub-all.sh</strong></p>
<pre><code>#!/usr/bin/bash

export PATH=/usr/sbin:/usr/bin

zpool list -H -o name | while read pool; do
    zpool scrub $pool
 done
`&lt;/pre&gt; 

Example cron entry to run this monthly:
 &lt;pre&gt;`#M H d m w 
10 2 1 * * /home/tdehesse/bin/scrub-all.sh
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Renaming Solaris zones]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h5 id="testedonsolaris111sru84jul2013">Tested on solaris 11.1 SRU 8, 4JUL2013</h5>
<p>Goal: rename solaris zone name the ZFS dataset <strong>oldzonename</strong> to <strong>renamedzone</strong>, from the global zone perspective, and rename the ZFS dataset to match the new name. We&apos;ll also rename the non-global zone inside the zone.</p>
<p>Here is the <a href="http://docs.oracle.com/cd/E26502_01/html/E29024/z.conf.start-115.html">Oracle Documentation</a></p>]]></description><link>https://velocity-blog.teodeh.com/renaming_solaris_zones/</link><guid isPermaLink="false">603c4a332269e10001cb55d4</guid><category><![CDATA[solaris]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Thu, 04 Jul 2013 22:23:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h5 id="testedonsolaris111sru84jul2013">Tested on solaris 11.1 SRU 8, 4JUL2013</h5>
<p>Goal: rename solaris zone name the ZFS dataset <strong>oldzonename</strong> to <strong>renamedzone</strong>, from the global zone perspective, and rename the ZFS dataset to match the new name. We&apos;ll also rename the non-global zone inside the zone.</p>
<p>Here is the <a href="http://docs.oracle.com/cd/E26502_01/html/E29024/z.conf.start-115.html">Oracle Documentation on renaming zones</a>,  and on <a href="http://docs.oracle.com/cd/E23824_01/html/821-1451/sysressysinfo-8.html#gkhbr">renaming a solaris instance</a>.</p>
 <!---->  
<pre><code>root@globalzone:~# zoneadm list -vi
  ID NAME             STATUS     PATH                           BRAND    IP
   4 oldzonename      running    /zones/oldzonename             solaris  excl
`&lt;/pre&gt; 

Halt the zone:
 &lt;pre&gt;`zoneadm -z oldzonename halt
`&lt;/pre&gt; 

Set the new zone name:
 &lt;pre&gt;`root@globalzone:~# zonecfg -z oldzonename
zonecfg:oldzonename&amp;gt; set zonename=renamedzone
zonecfg:renamedzone&amp;gt; set zonepath=/zones/renamedzone
zonecfg:renamedzone&amp;gt; commit
zonecfg:renamedzone&amp;gt; exit
`&lt;/pre&gt; 

Try Rename the ZFS datasets:
 &lt;pre&gt;`root@globalzone:~# zfs rename rpool/zones/oldzonename rpool/zones/renamedzone
cannot rename &apos;rpool/zones/oldzonename&apos;: child dataset with inherited mountpoint is used in a non-global zone
`&lt;/pre&gt; 

This is because the zone **rpool/zones/oldzonename/rpool** has **zoned=true**

We need to remove that setting before trying again:
 &lt;pre&gt;`root@globalzone:~# zfs set zoned=off rpool/zones/oldzonename/rpool
root@globalzone:~# zfs rename rpool/zones/oldzonename rpool/zones/renamedzone
cannot mount &apos;rpool/zones/renamedzone/rpool/ROOT/solaris-2&apos; on &apos;/&apos;: directory is not empty
cannot mount &apos;rpool/zones/renamedzone/rpool/ROOT/solaris-2/var&apos; on &apos;/var&apos;: directory is not empty
root@globalzone:~# zfs set zoned=on rpool/zones/renamedzone/rpool
`&lt;/pre&gt; 

Boot the zone, check everything works:
 &lt;pre&gt;`root@globalzone:~# zoneadm -z renamedzone boot
root@globalzone:~# zlogin renamedzone
root@globalzone:~# zlogin renamedzone
[Connected to zone &apos;renamedzone&apos; pts/6]
Oracle Corporation      SunOS 5.11      11.1    May 2013
root@oldzonename:~#
root@oldzonename:~#
`&lt;/pre&gt; 

Now rename the zone (from inside the zone):
 &lt;pre&gt;`root@oldzonename:~# svccfg -s identity:node setprop config/nodename=renamedzone
root@oldzonename:~# svccfg -s identity:node setprop config/loopback=renamedzone
root@oldzonename:~# svccfg -s identity:node refresh
root@oldzonename:~#
root@oldzonename:~# hostname
renamedzone
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Determining installed packages on Solaris 11]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>If we need to determine which packages have been added to a solaris 11 machine, say because someone is asking for documentation, or you need to build a similar machine/zone, we can use the pkg command&apos;s built in history function:</p>
<p>Show everything, from all time:</p>
<pre><code># pkg history</code></pre>]]></description><link>https://velocity-blog.teodeh.com/determining_installed_packages_on_solaris_11/</link><guid isPermaLink="false">603c4a332269e10001cb55d5</guid><category><![CDATA[solaris]]></category><category><![CDATA[pkg]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Thu, 13 Jun 2013 01:25:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>If we need to determine which packages have been added to a solaris 11 machine, say because someone is asking for documentation, or you need to build a similar machine/zone, we can use the pkg command&apos;s built in history function:</p>
<p>Show everything, from all time:</p>
<pre><code># pkg history -l
</code></pre>
<p>Show which base group is installed (small-server, large-server or desktop groups)</p>
<pre><code># pkg list group/system* NAME (PUBLISHER)                                  VERSION                    IFO 
group/system/solaris-small-server                 0.5.11-0.175.0.0.0.2.2576  i--
</code></pre>
<p>Show just install operations:</p>
<pre><code># pkg history -Ho start,command | grep &quot;pkg install&quot; (long output removed) 
</code></pre>
<p>Now verify these are all still installed (the inverse grep removes the zone install time operations)</p>
<pre><code># pkg list -Hs pkg history -Ho command |grep install |sed s/.*install// &amp;nbsp;| grep -v -- -z  
developer/build/ant                                     Apache Ant 
developer/build/make                                    A utility for managing compilations. 
diagnostic/top                                          provides a rolling display of top cpu using processes 
editor/nano                                             A small text editor 
terminal/xterm                                          xterm - terminal emulator for X 
x11/diagnostic/x11-info-clients                         X Window System diagnostic and information display clients 
x11/library/libxp                                       libXp - X Print Client Library 
x11/session/xauth                                       xauth - X authority file utility 
x11/xclock                                              xclock - analog / digital clock for X
</code></pre>
<p>Then store this in your documentation, or pipe it to <code>awk &apos;{print $1}&apos;</code>, or whatever tool of choice to grab the first column.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Automatic ZFS snapshots on Solaris 11]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Solaris 11 has a built-in mechanism to take hourly/daily/weekly snapshots of your ZFS datasets, e.g. rpool/export/home. The service is called &quot;time-slider&quot;, which can integrate with a nice GUI (which I don&apos;t have installed.</p>
<p>Older snapshots are automatically deleted either when space</p>]]></description><link>https://velocity-blog.teodeh.com/automatic_zfs_snapshots_on_solaris_11/</link><guid isPermaLink="false">603c4a332269e10001cb55d6</guid><category><![CDATA[solaris]]></category><category><![CDATA[zfs]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Mon, 11 Mar 2013 01:10:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Solaris 11 has a built-in mechanism to take hourly/daily/weekly snapshots of your ZFS datasets, e.g. rpool/export/home. The service is called &quot;time-slider&quot;, which can integrate with a nice GUI (which I don&apos;t have installed.</p>
<p>Older snapshots are automatically deleted either when space is too tight, or they are more than X snapshots old (e.g. by default four weekly snapshots are kept, see the svccfg properties below).</p>
<p>The <a href="http://docs.oracle.com/cd/E19082-01/817-2271/ghzuk/index.html">oracle documentation</a> is not very useful, however.</p>
<p>In short, the required steps are:</p>
<pre><code># pkg install time-slider
# svcadm restart dbus
# svcadm enable time-slider
`&lt;/pre&gt; 

We need to specify which datasets will be enabled -- for example our home directories:
 &lt;pre&gt;`zfs set com.sun:auto-snapshot=true rpool/export/home
`&lt;/pre&gt; 

Once we enable time-slider, it will create some auto-snapshot services -- frequent, daily, hourly and weekly. We enable them with:
 &lt;pre&gt;`# svcadm enable auto-snapshot:frequent 
# svcadm enable auto-snapshot:hourly
# svcadm enable auto-snapshot:daily
# svcadm enable auto-snapshot:weekly 
`&lt;/pre&gt; 

It seems that when we install time-slider, it adds some dbus configuration which necessitates the dbus restart above -- otherwise the time-slider service will fail to come online due to a dbus permission error.

We can tweak the configuration of each service using service properties -- view with listprop, edit with editprop:
 &lt;pre&gt;`# svccfg -s auto-snapshot:frequent listprop zfs
zfs           application
zfs/interval astring     minutes
zfs/keep     astring     3
zfs/period   astring     15
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Solaris 11 Patching and Updates]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Solaris 11 is patched differently to previous versions of solaris.</p>
<p>Solaris 11 is installed and patched/updated from &quot;Image Package System&quot; repositories, typically over http/https.   Oracle maintains two repositories, one public which is only updated with  major releases, and a second repository which contains regular support updates</p>]]></description><link>https://velocity-blog.teodeh.com/solaris_11_patching_and_updates/</link><guid isPermaLink="false">603c4a332269e10001cb55d7</guid><category><![CDATA[solaris]]></category><category><![CDATA[pkg]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Tue, 26 Feb 2013 04:08:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Solaris 11 is patched differently to previous versions of solaris.</p>
<p>Solaris 11 is installed and patched/updated from &quot;Image Package System&quot; repositories, typically over http/https.   Oracle maintains two repositories, one public which is only updated with  major releases, and a second repository which contains regular support updates -- this is restricted to customers with a current solaris support contract. See the oracle KB article at the bottom for details on setting up access to oracle&apos;s restricted repository.</p>
<p>Major updates (e.g. 11.0 to 11.1) are applied in the same way as support repository updates, but care must be taken to read the instructions as multiple steps may be required (hint: you can&apos;t go straight from 11.0 to 11.1)</p>
<p>To List configured publishers -</p>
<pre><code># pkg publisher 
PUBLISHER                   TYPE     STATUS P LOCATION 
solaris                     origin   online F https://oracle-oem-oc-mgmt-hostname:8002/IPS/
</code></pre>
<p>There is a special &quot;incorporation&quot; package called entire, whose dependencies will cause all packages to be updated to the same level.</p>
<p>We can see the current version of the entire package using:</p>
<pre><code># pkg list entire 
NAME (PUBLISHER)                                  VERSION                    IFO 
entire                                            0.5.11-0.175.1.0.0.24.2    i--
</code></pre>
<p>.. and we can see all available &quot;entire&quot; packages using:</p>
<pre><code># pkg list -af entire 
NAME (PUBLISHER)                                  VERSION                    IFO 
entire                                            0.5.11-0.175.1.0.0.24.2    --- 
entire                                            0.5.11-0.175.0.12.0.4.0    i-- 
entire                                            0.5.11-0.175.0.10.0.5.0    --- 
entire                                            0.5.11-0.175.0.0.0.2.0     ---
</code></pre>
<p>Note the &quot;<code>i--</code>&quot; showing the currently installed version.</p>
<p>To read the version numbers, for example:</p>
<pre><code>0.5.11-0.175.0.12.0.4.0 
               ^--- 12 == Support repository update 12 
             ^-----  0 == Solaris 11 GA (1 would be Solaris 11.1. etc) 
         ^-------- 175 == this was an internal build number during S11 development, can be ignored 
     ^------------  11 == Solaris 11 (vs 10) 
  ^---------------   5 == Solaris (vs SunOS) 
</code></pre>
<p>The last two are kept for legacy compatibility (so 5.8 can be compared to 5.9, 5.11 by scripts which parse the output of uname)</p>
<p>Solaris updates are typically performed on a clone of the current boot environment, similar to &quot;Live upgrade&quot; in previous solaris versions, except better.<br>
The beadm utility will show the current system&apos;s available boot environments</p>
<pre><code># beadm list
BE        Active Mountpoint Space  Policy Created          
--        ------ ---------- -----  ------ -------          
s11-sru12 NR     /          10.67G static 2012-11-28 17:47 
solaris   -      -          47.12M static 2012-07-09 15:01 
solaris-1 -      -          14.22M static 2012-09-21 13:18
</code></pre>
<p>Note: It is helpful to give boot environments descriptive names.<br>
In this example we see &quot;<code>s11-sru12</code>&quot; is active &quot;N&quot;ow and on &quot;R&quot;eboot</p>
<p>The pkg command will create new boot environments when performing more major changes such as installing a solaris update, or whenever the appropriate flag is provided.</p>
<h2 id="toactuallyapplyanupdate">To actually apply an update:</h2>
<p>0: If you have a local repository server, update its contents to the desired release level.<br>
1: Consult oracle&apos;s documentation for known issues and to ensure you are aware the current version (tip: search for &quot;Solaris SRU Index&quot;)<br>
2: Run pkg utility to create a new, patched boot environment<br>
3: Reboot to use the new boot environment.</p>
<pre><code># pkg update  --accept \ 
 --require-new-be \ 
 --be-name s11-sru12 \ 
 entire@0.5.11-0.175.0.12.0.4.0
</code></pre>
<p>This will clone the current boot environment, and that of any attached zones, apply patches and then wait for you to activate the new boot environment.</p>
<p>This can be done while applications are running, as long as the applications are on their own filesystems.</p>
<p>Activate the new boot environment when ready using:</p>
<pre><code># beadm activate s11-sru12 
# init 6
</code></pre>
<h3 id="noteonwhatspartofabootenvironment">Note on what&apos;s part of a boot environment:</h3>
<p>Everything under <code>rpool/ROOT</code> will be cloned, while everything not under <code>rpool/ROOT</code> (e.g. <code>/export/home</code>) will not be cloned.<br>
This means that application data <strong>MUST</strong> be kept on a separate filesystem to ensure data is not unexpectedly lost during live upgrade.</p>
<p>Also, starting with Solaris 11.1, certain directories under /var have become symbolic links to /var/SHARE, so that certain directories (e.g. mail) are now no longer boot environment specific.</p>
<p>Consider the following example:</p>
<pre><code>rpool/ROOT/solaris     547G   5.0G       109G     5%    / 
rpool/ROOT/solaris/var 547G    20G       109G    16%    /var 
rpool/export           547G    33K       109G     1%    /export 
rpool/export/home      547G   2.1G       109G     2%    /export/home
</code></pre>
<p>1pm: Apply patches/support repository update<br>
2pm: Modify files under /export/home and /opt<br>
3pm: Reboot to new boot environment</p>
<p>After the reboot, the changes we made to /export/home are still part of the active boot environment, while changes to /opt (part of root filesystem) are part of the now-inactive boot environment.</p>
<p>Useful oracle documentation:</p>
<p>Oracle Support Document 1433186.1 (Oracle Solaris 11 Image Packaging System (IPS) Frequently Asked Questions (FAQ))<br>
(<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?id=1433186.1">https://support.oracle.com/epmos/faces/DocumentDisplay?id=1433186.1</a>)</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Solaris 11: Zone Boot environment selection]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Tested on Solaris 11.1, specifically entire@0.5.11-0.175.1.0.0.24.2</p>
<p>I couldn&apos;t find this documented anywhere, so here&apos;s what I found.</p>
<p>How do solaris 11 zones determine which boot environment to use?  Seems they use ZFS properties.</p>
<p>On my test</p>]]></description><link>https://velocity-blog.teodeh.com/solaris_11_zone_boot_environment_selection/</link><guid isPermaLink="false">603c4a332269e10001cb55d8</guid><category><![CDATA[solaris]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Thu, 21 Feb 2013 00:47:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Tested on Solaris 11.1, specifically entire@0.5.11-0.175.1.0.0.24.2</p>
<p>I couldn&apos;t find this documented anywhere, so here&apos;s what I found.</p>
<p>How do solaris 11 zones determine which boot environment to use?  Seems they use ZFS properties.</p>
<p>On my test zone, I have:</p>
<pre><code>root@myhostname:/etc# beadm list 
BE        Active Mountpoint Space   Policy Created         
--        ------ ---------- -----   ------ -------         solaris   N      /          488.90M static 2013-02-20 15:45 
solaris-z R      -          60.0K   static 2013-02-21 10:15
</code></pre>
<p>And here are the ZFS properties:</p>
<pre><code>root@myhostname:/etc# zfs get -r -d 1 -o name,value,source org.opensolaris.libbe:active rpool/ROOT 
NAME                  VALUE  SOURCE 
rpool/ROOT            -      - 
rpool/ROOT/solaris    off    local 
rpool/ROOT/solaris-z  on     local
</code></pre>
<p>Each zone boot envrionment also has a parentbe property which presumably allows the global zone&apos;s pkg command to operate on the correct zone, called org.opensolaris.libbe:parentbe</p>
<pre><code>root@myhostname:/etc# zfs get -r -d 1 -o name,value,source org.opensolaris.libbe:parentbe rpool/ROOT
NAME                  VALUE                                 SOURCE 
rpool/ROOT            -                                     - 
rpool/ROOT/solaris    89b52c6a-80a0-670d-e178-cb91c57061d3  local 
rpool/ROOT/solaris-z  89b52c6a-80a0-670d-e178-cb91c57061d3  local
</code></pre>
<p>The parentbe seems to be used to detemine which zones boot environments are unbootable (showing as <code>!R</code> in the &quot;<code>Active</code>&quot; column of <code>beadm list</code>).</p>
<p>We can edit these properties directly, but obviously it&apos;s better to use the beadm utility -- however knowing which properties it uses can be useful for manually correcting problems.</p>
<p>Useful documentation includes the <code>solaris(5)</code> man page.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Solaris 11.1 -- Easy SMF manifest creation]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The following command will generate a basic SMF manifest for a simple daemon process (in my case, the transmission bit torrent program)</p>
<pre><code>$ svcbundle \ 
  -s service-name=application/transmissionbt \ 
  -s start-method=&quot;/usr/local/transmission-2.76/bin/transmission-daemon&quot; \ 
  -s model=daemon \ 
  &gt; /tmp/xmiss.xml
</code></pre>
<p>.. In my case, I want my</p>]]></description><link>https://velocity-blog.teodeh.com/solaris_11_1_easy_smf_manifest_creation/</link><guid isPermaLink="false">603c4a332269e10001cb55d9</guid><category><![CDATA[solaris]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Mon, 18 Feb 2013 05:39:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>The following command will generate a basic SMF manifest for a simple daemon process (in my case, the transmission bit torrent program)</p>
<pre><code>$ svcbundle \ 
  -s service-name=application/transmissionbt \ 
  -s start-method=&quot;/usr/local/transmission-2.76/bin/transmission-daemon&quot; \ 
  -s model=daemon \ 
  &gt; /tmp/xmiss.xml
</code></pre>
<p>.. In my case, I want my tranmission daemon to run as a non-root user, so I edit the file and replace:</p>
<pre><code>&lt;instance enabled=&quot;true&quot; name=&quot;default&quot;/&gt;
</code></pre>
<p>with</p>
<pre><code>&lt;instance enabled=&quot;true&quot; name=&quot;default&quot;&gt; 
  &lt;methodcontext workingdirectory=&apos;/var/tmp&apos;&gt;         &lt;methodcredential group=&apos;staff&apos; user=&apos;dluser&apos;/&gt;       &lt;/methodcontext&gt;     &lt;/instance&gt;
</code></pre>
<p>Finally, import the manifest:</p>
<pre><code>svccfg import /tmp/xmiss.xml 
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Zone installation errors on Solaris 11]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Had a&#xA0; &quot;checkpoint error&quot; when installing a zone:</p>
<p><span style="font-size: x-small;"><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">2012-12-10 00:58:35,549 InstallationLogger ERROR Checkpoint execution error:<br>
2012-12-10 00:58:35,599 InstallationLogger ERROR<br>
2012-12-10 00:58:35,649 InstallationLogger ERROR The following pattern(s) did not match any allowable packages. Try<br>
2012-12-10 00:58:35,</span></span></p>]]></description><link>https://velocity-blog.teodeh.com/zone_installation_errors_on_solaris_11/</link><guid isPermaLink="false">603c4a332269e10001cb55db</guid><category><![CDATA[solaris]]></category><category><![CDATA[pkg]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Thu, 13 Dec 2012 21:18:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Had a&#xA0; &quot;checkpoint error&quot; when installing a zone:</p>
<p><span style="font-size: x-small;"><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">2012-12-10 00:58:35,549 InstallationLogger ERROR Checkpoint execution error:<br>
2012-12-10 00:58:35,599 InstallationLogger ERROR<br>
2012-12-10 00:58:35,649 InstallationLogger ERROR The following pattern(s) did not match any allowable packages. Try<br>
2012-12-10 00:58:35,700 InstallationLogger ERROR using a different matching pattern, or refreshing publisher information:<br>
2012-12-10 00:58:35,750 InstallationLogger ERROR<br>
2012-12-10 00:58:35,800 InstallationLogger ERROR pkg:///entire@0.5.11,5.11-0.175.1.1.0.4.0:20121106T001344Z<br>
2012-12-10 00:58:35,851 InstallationLogger ERROR pkg:/group/system/solaris-small-server </span></span><br>
This can occur when the pkg repository is out of date compared to your global zone, but this wasn&apos;t my problem -- I was actually using oracle&apos;s support repository at the time.</p>
<p>The underlying root cause was a mis-configured <span style="font-family: &quot;Courier New&quot;, Courier, monospace;">application/pkg/system-repository:default <span style="font-family: inherit;">service, specifically the <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">config/host</span> </span></span>SMF property was set to the local hostname, <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">server1</span> -- while the automated installer seems to assume it&apos;s configured on <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">localhost</span> or (<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">127.0.0.1</span>)</p>
<p>Check yours isn&apos;t broken by running <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">curl <a href="http://localhost:1008">http://localhost:1008</a> </span>-- you should see a HTTP 404 error. If you get connection refused, you&apos;re likely having the same problem I was, or your <span style="font-family: &quot;Courier New&quot;, Courier, monospace;">system-repository </span>service is offline.</p>
<p>NB: I didn&apos;t setup this system, but I presume it was set this way out of the box.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Simple Solaris 11 Automated Installation Server (sparc client)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Notes for setting up a Solaris 11 AI (Automated Installation) server for booting a SPARC system over the network, then booting it without using DHCP (which might conflict with another DHCP server on the network)</p>
<p>Background reading:<br>
<a href="http://docs.oracle.com/cd/E23824_01/html/E21798/useaipart.html#scrolltoc">Oracle&apos;s Documentation</a><br>
<a href="http://portrix-systems.de/blog/brost/solaris-11-network-install-without-dhcp/">Blog entry on Sparc installs without DHCP</a></p>
<p>create our</p>]]></description><link>https://velocity-blog.teodeh.com/simple_solaris_11_automated_installation_server_sparc_client_/</link><guid isPermaLink="false">603c4a332269e10001cb55dc</guid><category><![CDATA[solaris]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Tue, 04 Dec 2012 21:52:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Notes for setting up a Solaris 11 AI (Automated Installation) server for booting a SPARC system over the network, then booting it without using DHCP (which might conflict with another DHCP server on the network)</p>
<p>Background reading:<br>
<a href="http://docs.oracle.com/cd/E23824_01/html/E21798/useaipart.html#scrolltoc">Oracle&apos;s Documentation</a><br>
<a href="http://portrix-systems.de/blog/brost/solaris-11-network-install-without-dhcp/">Blog entry on Sparc installs without DHCP</a></p>
<p>create our service -- this will create the equivalent of a jumpstart boot server.</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">installadm create-service&#xA0; -n s11sparc_install -a sparc </span></p>
<p>Or we can use do this from an AI ISO file, per the manual page for installadm:<br>
_<br>
_<em><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">installadm create-service -n sol-11_1-sparc <br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; -s /export/isos/sol-11_1-ai-sparc.iso <br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; -d /export/images/sol-11_1-sparc</span></em></p>
<p>This would allow us, for example, to use an older AI installation -- e.g. if we have an install server running 11.1 but want to install a client running 11.0 for testing.</p>
<p>Note: the install server tells the client which miniroot to download based on the service selection above. This install server needs to match the Solaris version we&apos;re installing (for the ultra-simple case, with no criteria set up, our client will look at the <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">default-sparc</span> alias).&#xA0;</p>
<p>To install from a local pkg server rather than oracle&apos;s public server, we customise the publisher URL the client will use (<a href="http://docs.oracle.com/cd/E23824_01/html/E21798/changeai.html#scrolltoc">Documentation link</a>)</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">installadm export -n s11sparc_install -m orig_default -o /tmp/localrepo.xml</span></p>
<p><span style="font-family: Times,&quot;Times New Roman&quot;,serif;">&#x2026; near the bottom, specify our local repo mirror -- customise the IP.</span></p>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;source&gt;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;publisher name=&quot;solaris&quot;&gt;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;origin name=&quot;http://<strong>10.1.1.5</strong>/solaris/release&quot;/&gt;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;/publisher&gt;<br>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;/source&gt;</p>
<p>set this as default manifest:</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">installadm create-manifest -n s11sparc_install -d <br>
&#xA0;-f /tmp/localrepo.xml -m localrepo</span></p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">installadm list -n s11sparc_install -m</span></p>
<p>installadm create-manifest -n default-sparc -d <br>
&#xA0;-f /tmp/localrepo.xml -m localrepo</p>
<p>installadm list -n default-sparc -m</p>
<p>Booting with &quot;<strong><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">boot net - install</span></strong>&quot; should now perform a fully automated installation, using the first appropriate disk as an installation target.</p>
<p>&quot;<strong><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">boot net - install aimanifest=prompt</span></strong>&quot; will allow us to specify a manifest XML file at boot time, avoiding the need to worry about manifest selection criteria for very small deployments</p>
<p>... and with &quot;<strong><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">boot net</span></strong>&quot; will boot from the network, and give a prompt to do an interactive installation, or use a shell which we can use as a recovery environment (very useful if things are really broken).</p>
<p>On the client we should be able to boot using something like this for an interactive installation -- note that this won&apos;t use the manifest file we created above.</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">{28} ok show-nets<br>
a) /pci@13,700000/network@0,3<br>
b) /pci@13,700000/network@0,2<br>
c) /pci@13,700000/network@0,1<br>
d) /pci@13,700000/network@0<br>
q) NO SELECTION<br>
Enter Selection, q to quit: c<br>
/pci@13,700000/network@0,1 has been selected.<br>
Type ^Y ( Control-Y ) to insert it in the command line.</span></p>
<p>{28} ok nvalias net /pci@13,700000/network@0,1<br>
{28} ok</p>
<p>{28} ok setenv network-boot-arguments host-ip=<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><strong>10.1.1.10</strong></span>,router-ip=</span><span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><strong>10.1.1.5</strong></span>,subnet-mask=255.255.255.0,file=http://</span><span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><strong>10.1.1.5</strong></span>:5555/cgi-bin/wanboot-cgi<br>
{28} ok boot net -sv<br>
Resetting...</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"></span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"></span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"></span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"></span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;"><br>
<strong>_[long output clipped] _</strong></span></p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">Configuring devices.<br>
Hostname: solaris<br>
Requesting System Maintenance Mode<br>
SINGLE USER MODE</span></p>
<p>Enter user name for system maintenance (control-d to bypass): root<br>
Enter root password (control-d to bypass):<br>
single-user privilege assigned to root on /dev/console.<br>
Entering System Maintenance Mode</p>
<p>Dec&#xA0; 4 01:53:31 su: &apos;su root&apos; succeeded for root on /dev/console<br>
Oracle Corporation&#xA0;&#xA0;&#xA0; SunOS 5.11&#xA0;&#xA0;&#xA0; 11.1&#xA0;&#xA0;&#xA0; September 2012<br>
root@solaris:~#&#xA0; exit</p>
<p>&#x2026; system presents a menu offering to install etc.</p>
<p>Fully automated install testing can wait for another day.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Configuring Solaris 11 to use Active Directory accounts as unix accounts]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h1 id="configuringsolaris11touseactivedirectoryaccountsasunixaccounts">Configuring Solaris 11 to use Active Directory accounts as unix accounts</h1>
<p>How to</p>
<ul>
<li>Configure Active directory to serve unix (RFC2307) data over LDAP,</li>
<li>Configure Solaris 11 to use this as a source of user accounts, with simple LDAP binds instead of Kerberos for authentication</li>
</ul>
<p>Goal:</p>
<ul>
<li>Allow certain active directory users</li></ul>]]></description><link>https://velocity-blog.teodeh.com/configuring_solaris_11_to_use_active_directory_accounts_as_unix_accounts/</link><guid isPermaLink="false">603c4a332269e10001cb55dd</guid><category><![CDATA[solaris]]></category><category><![CDATA[active_directory]]></category><category><![CDATA[authentication]]></category><category><![CDATA[ldap]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Sat, 01 Dec 2012 04:58:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h1 id="configuringsolaris11touseactivedirectoryaccountsasunixaccounts">Configuring Solaris 11 to use Active Directory accounts as unix accounts</h1>
<p>How to</p>
<ul>
<li>Configure Active directory to serve unix (RFC2307) data over LDAP,</li>
<li>Configure Solaris 11 to use this as a source of user accounts, with simple LDAP binds instead of Kerberos for authentication</li>
</ul>
<p>Goal:</p>
<ul>
<li>Allow certain active directory users to be local unix users</li>
<li>Avoid Kerberos complexity</li>
<li>Allow unix users to login using password OR ssh keys.</li>
</ul>
<p>Environment:</p>
<ul>
<li>Windows 2008 Active Directory</li>
<li>Solaris 11 Client</li>
</ul>
<p>Windows 2003 seems similar from various bits of documentation and should be very similar, as is solaris 10, but that&apos;s not what I&apos;ve used here.</p>
<h1 id="activedirectory">Active Directory:</h1>
<p>This is a quick summary of steps. Other people have written this up better than I have, for example here: <a href="http://blog.scottlowe.org/2007/04/25/solaris-10-ad-integration-version-3/">http://blog.scottlowe.org/2007/04/25/solaris-10-ad-integration-version-3/</a><br>
Or here with <a href="http://www.seedsofgenius.net/solaris/solaris-authentication-login-with-active-directory">http://www.seedsofgenius.net/solaris/solaris-authentication-login-with-active-directory</a></p>
<p>Install &quot;Identity Management for Unix&quot; Server Role on your AD Controllers:</p>
<p>Open Server Manager,</p>
<ul>
<li>click &quot;Roles&quot; on the left</li>
<li>click &quot;Add role services&quot; on the right hand side</li>
<li>select &quot;server for network information services&quot; and &quot;administration tools&quot;</li>
</ul>
<p>Open the &quot;Identity Management for Unix&quot; program under administrative tools, then create a new NIS domain.</p>
<p>Populate Unix attributes on the relevant users</p>
<p>Now you need to populateunix related attributes -- uid, home directory (use /home/$uid ) etc under the unix tab of each user who should be able to log in.</p>
<h1 id="solaris">Solaris:</h1>
<p>Configuring active directory name service:</p>
<p>In this example:</p>
<ul>
<li>10.1.1.21 and 10.1.1.22 are the active directory master servers</li>
<li>&quot;Unix Search User&quot; is configured as a domain user (no need for administrator rights). You can get the user&apos;s LDAP DN using the <code>dsquery user -name Unix*</code> command</li>
<li>Customize the items in bold (at least)</li>
</ul>
<p>Warning: this command will overwrite your nsswitch.conf file!</p>
<pre><code>	ldapclient manual \
	    -a authenticationMethod=simple \
	    -a defaultSearchBase=DC=domain,DC=name,DC=local \
	    -a credentialLevel=proxy \
	    -a proxyDN=&quot;cn=Unix LDAP Search,ou=users,DC=domain,DC=name,DC=local&quot; \    
	    -a domainName=domain.name.local \    
	    -a proxyPassword=secret123 \    
	    -a defaultSearchScope=sub \   
	    -a attributeMap=passwd:gecos=cn \    
	    -a attributeMap=passwd:homedirectory=unixHomeDirectory \   
	    -a attributeMap=shadow:userpassword=unixUserPassword \   
	    -a objectClassMap=group:posixGroup=group \    
	    -a objectClassMap=passwd:posixAccount=user \    
	    -a objectClassMap=shadow:shadowAccount=user \    
	    -a serviceSearchDescriptor=passwd:ou=users,DC=domain,DC=name,DC=local?sub \   
	    -a serviceSearchDescriptor=group:ou=Unix\ Groups,DC=domain,DC=name,DC=local?sub \    
	    -a defaultServerList=&quot;10.1.1.21 10.1.1.22&quot;
</code></pre>
<p>Using this data in the name service switch:</p>
<p>Add &quot;ldap&quot; to your &quot;passwd&quot; and &quot;group&quot; map lookups. Here&apos;s my file:</p>
<pre><code>passwd: files ldap
group:  files ldap
hosts:  files dns
ipnodes:        files dns
networks:       files
protocols:      files
rpc:    files
ethers: files
netmasks:       files
bootparams:     files
publickey:      files
netgroup:       files
automount:      files
aliases:        files
services:       files
printers:       user files
project:        files
auth_attr:      files
prof_attr:      files
tnrhtp: files
tnrhdb: files
sudoers:        files
</code></pre>
<p>Apply with:</p>
<pre><code>svcadm restart name-service/switch svcadm restart name-service/cache
</code></pre>
<p>Verify it&apos;s working</p>
<p>At this point, users should be in the passwd database (as if they were in the local /etc/passwd file), but they won&apos;t be able to log in because we haven&apos;t setup the PAM configuration yet.</p>
<p>On solaris, run <code>getent passwd</code> and you should see LDAP related entries.</p>
<p>If you need to tweak anything, remember to restart the name service cache.</p>
<h2 id="configurepamtouseldapbinds">Configure PAM to use LDAP binds</h2>
<p>Here&apos;s my /etc/pam.conf (it could just as easily be multiple files in /etc/pam.d/*)</p>
<pre><code>#
# Sourced from http://docs.oracle.com/cd/E23824_01/html/821-1455/schemas-250.html#scrolltoc
# on 28 NOV 2012
#
# Authentication management
#
# login service (explicit because of pam_dial_auth)
#
login   auth requisite        pam_authtok_get.so.1
login   auth required         pam_dhkeys.so.1
login   auth required         pam_unix_cred.so.1
login   auth required         pam_dial_auth.so.1
login   auth binding          pam_unix_auth.so.1 server_policy
login   auth required         pam_ldap.so.1
#
# SSH public key shoudn&apos;t check LDAP/AD account lock status, but should use it
# for uid/home dir etc (pam_unix*)
#
sshd-pubkey   auth requisite          pam_authtok_get.so.1
sshd-pubkey   auth required           pam_dhkeys.so.1
sshd-pubkey   auth required           pam_unix_cred.so.1
sshd-pubkey   auth required           pam_unix_auth.so.1
sshd-pubkey   auth required           pam_dial_auth.so.1
sshd-pubkey   account requisite       pam_roles.so.1
sshd-pubkey   account required        pam_unix_account.so.1
#
# rlogin service (explicit because of pam_rhost_auth)
#
rlogin  auth sufficient       pam_rhosts_auth.so.1
rlogin  auth requisite        pam_authtok_get.so.1
rlogin  auth required         pam_dhkeys.so.1
rlogin  auth required         pam_unix_cred.so.1
rlogin  auth binding          pam_unix_auth.so.1 server_policy
rlogin  auth required         pam_ldap.so.1
#
# rsh service (explicit because of pam_rhost_auth,
# and pam_unix_auth for meaningful pam_setcred)
#
rsh     auth sufficient       pam_rhosts_auth.so.1
rsh     auth required         pam_unix_cred.so.1
rsh     auth binding          pam_unix_auth.so.1 server_policy
rsh     auth required         pam_ldap.so.1
#
# PPP service (explicit because of pam_dial_auth)
#
ppp     auth requisite        pam_authtok_get.so.1
ppp     auth required         pam_dhkeys.so.1
ppp     auth required         pam_dial_auth.so.1
ppp     auth binding          pam_unix_auth.so.1 server_policy
ppp     auth required         pam_ldap.so.1
#
# Default definitions for Authentication management
# Used when service name is not explicitly mentioned for authentication
#
other   auth required         pam_authtok_get.so.1
other   auth required         pam_dhkeys.so.1
other   auth required         pam_unix_cred.so.1
other   auth binding          pam_unix_auth.so.1 server_policy
other   auth required         pam_ldap.so.1
#
# passwd command (explicit because of a different authentication module)
#
passwd  auth binding          pam_passwd_auth.so.1 server_policy
passwd  auth required         pam_ldap.so.1
#
# cron service (explicit because of non-usage of pam_roles.so.1)
#
cron    account required      pam_unix_account.so.1
#
# Default definition for Account management
# Used when service name is not explicitly mentioned for account management
#
other   account requisite     pam_roles.so.1
other   account binding       pam_unix_account.so.1 server_policy
other   account required      pam_ldap.so.1
#
# Default definition for Session management
# Used when service name is not explicitly mentioned for session management
#
other   session required      pam_unix_session.so.1
#
# Default definition for  Password management
# Used when service name is not explicitly mentioned for password management
#
other   password required     pam_dhkeys.so.1
other   password requisite    pam_authtok_get.so.1
other   password requisite    pam_authtok_check.so.1
other   password required     pam_authtok_store.so.1 server_policy
#
# Support for Kerberos V5 authentication and example configurations can
# be found in the pam_krb5(5) man page under the &quot;EXAMPLES&quot; section.
#
</code></pre>
<p>Configure PAM to allow SSH key logins while LDAP is enabled</p>
<p>You may have noticed that the pam.conf file above has a non-LDAP configuration for the sshd-pubkey service. This is because it seems that the default (&quot;other&quot;) PAM service will use the ldap PAM module which attempts to confirm an account isn&apos;t locked. This isn&apos;t possible when authenticating with a simple LDAP bind, because the SSH daemon doesn&apos;t have access to the user&apos;s password and therefore can&apos;t verify whether the user&apos;s account is locked.</p>
<p>See the &quot;sshd-pubkey&quot; lines in the example above.</p>
<p>Site note: Oracle&apos;s documentation claims this isn&apos;t possible, but it works fine just fine -- however there is a compromise: if you lock a user account they will still be able to log in using SSH keys!</p>
<h1 id="automatichomedirectorycreation">Automatic Home Directory creation</h1>
<p>Full credit: this is based on the following blog post: <a href="http://znogger.blogspot.com.au/2010/05/solaris-automatic-creation-of-home-dirs.html">http://znogger.blogspot.com.au/2010/05/solaris-automatic-creation-of-home-dirs.html</a><br>
Solaris&apos; automounter has a feature called &quot;Executable maps&quot; -- we can specify a shell script which will create a directory on the access attempt. Here it is:</p>
<pre><code>#!/bin/bash #

Automounter executable script.

This script must be referenced in file /etc/auto_master in order

to have any effect. Furthermore it must have the sticky bit set.

#

This script receives as $1 the name of the object (file or directory)

that is being accessed under the moint point. For example if the

moint point is /home and someone is accessing /home/johndoe then

$1 will be &quot;johndoe&quot;.

The script is expected to write the path of the physical location

on stdout.

------------------------------------------------------------------------------

Customizations

Path of our mount point. This must be the same as the name

in the first column in the file /etc/auto_master.

HOMEDIRPATH=/home

Where the physical user home directories are

PHYSICALDIRPATH=/export/home

The group owner to give to a user&apos;s home directory

HOMEDIRGROUP=&quot;staff&quot;

------------------------------------------------------------------------------

hdir=$HOMEDIRPATH/$1

Sanity check

getent passwd $1 &gt; /dev/null if [ $? -ne 0 ]; then exit fi

Now we know that $1 is a valid user with a home directory

under $HOMEDIRPATH

Next see if the user&apos;s physical home dir exist. If not create it.

phdir=&quot;$PHYSICALDIRPATH/$1&quot;

if [ -d &quot;$phdir&quot; ]; then

Yes the user&apos;s physical home dir already exist.

Return the path of the physical home dir to the automounter

and exit.

echo &quot;localhost:$phdir&quot; exit fi

cp -r /etc/skel/ $phdir/

Set owner and group

chown -R &quot;$1&quot;:&quot;$HOMEDIRGROUP&quot; $phdir

Return the path of the physical home dir to the automounter

and exit.

echo &quot;localhost:$phdir&quot;

exit
</code></pre>
<p>This script needs to be used by /etc/auto_master -- here&apos;s mine:</p>
<pre><code>cat &gt; /etc/auto_master &lt;&lt; HOMEEOF #

Copyright (c) 1992, 2011, Oracle and/or its affiliates. All rights reserved.

#

Master map for automounter

# +automaster /net            -hosts          -nosuid,nobrowse /home           /etc/autohomedir /nfs4           -fedfs          -ro,nosuid,nobrowse 
HOMEEOF
</code></pre>
<p>Don&apos;t forget to put a sensible .bash_profile and .bashrc into /etc/skel</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Solaris 11 IPMP example commands]]></title><description><![CDATA[<!--kg-card-begin: markdown--><pre><code>ipadm create-ip net0 
ipadm create-ip net5 

ipadm create-addr -T static -a 10.1.1.122/24 net0/test 
ipadm create-addr -T static -a 10.1.1.123/24 net5/test

ipadm create-ipmp -i net0 -i net5 admipmp0 
ipadm create-addr -T static -a 10.1.1.121/24 admipmp0/v4 

ipadm</code></pre>]]></description><link>https://velocity-blog.teodeh.com/solaris_11_ipmp_example_commands/</link><guid isPermaLink="false">603c4a332269e10001cb55de</guid><category><![CDATA[solaris]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Fri, 02 Nov 2012 10:00:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><pre><code>ipadm create-ip net0 
ipadm create-ip net5 

ipadm create-addr -T static -a 10.1.1.122/24 net0/test 
ipadm create-addr -T static -a 10.1.1.123/24 net5/test

ipadm create-ipmp -i net0 -i net5 admipmp0 
ipadm create-addr -T static -a 10.1.1.121/24 admipmp0/v4 

ipadm show-addr 
ipadm show-if 

# add test target 
route -p add 10.1.1.1 10.1.1.1 -static
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Enabling PLAIN LDAP binds on OSX 10.7 Lion and 10.8 Mountain Lion]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>OSX 10.7 and 10.8 have some issues talking to OpenLDAP and 389 (Red Hat Directory Server), because the server advertises non-plain BINDs in the root DSE entry, but these binds don&apos;t work when your user entries have hashed passwords (which they should).</p>
<p>PS: 10.7.0</p>]]></description><link>https://velocity-blog.teodeh.com/enabling_plain_ldap_binds_on_osx_10_7_lion_and_10_8_mountain_lion/</link><guid isPermaLink="false">603c4a332269e10001cb55df</guid><category><![CDATA[osx]]></category><dc:creator><![CDATA[Teo de Hesselle]]></dc:creator><pubDate>Mon, 22 Oct 2012 04:32:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>OSX 10.7 and 10.8 have some issues talking to OpenLDAP and 389 (Red Hat Directory Server), because the server advertises non-plain BINDs in the root DSE entry, but these binds don&apos;t work when your user entries have hashed passwords (which they should).</p>
<p>PS: 10.7.0 and 10.7.1 are horribly broken and should not be used by anyone for LDAP related work. 10.8.0 seems okay at first glance.</p>
<p>Shamelessly borrowing from the following blog entry<br>
&#xA0;<a href="http://blog.smalleycreative.com/administration/fixing-openldap-authentication-on-os-x-lion/">http://blog.smalleycreative.com/administration/fixing-openldap-authentication-on-os-x-lion/</a></p>
<p>....however I prefer the following shell:</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">for plist in&#xA0; /Library/Preferences/OpenDirectory/Configurations/LDAPv3/*.plist</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">do&#xA0;</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&#xA0;&#xA0;&#xA0; for method in CRAM-MD5 NTML GSSAPI </span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&#xA0;&#xA0;&#xA0; do</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; /usr/libexec/PlistBuddy -c &quot;add &apos;:module options:ldap:Denied SASL Methods:&apos; string $method&quot; $plist</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&#xA0;&#xA0;&#xA0; done</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">done&#xA0;</span><br>
<span style="font-family: &quot;Courier New&quot;,Courier,monospace;">killall opendirectoryd &#xA0;&#xA0; &#xA0; &#xA0; # this refreshes cache </span></p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>