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

<channel>
	<title>blueslugs.com &#187; Pastime</title>
	<atom:link href="http://blueslugs.com/category/pastime/feed/" rel="self" type="application/rss+xml" />
	<link>http://blueslugs.com</link>
	<description>Observations from a West Coast family</description>
	<lastBuildDate>Thu, 22 Dec 2011 23:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bespoke services: network/rmi/registry</title>
		<link>http://blueslugs.com/2006/03/28/bespoke-services-networkrmiregistry/</link>
		<comments>http://blueslugs.com/2006/03/28/bespoke-services-networkrmiregistry/#comments</comments>
		<pubDate>Tue, 28 Mar 2006 23:26:56 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[manifestly]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2006/03/28/bespoke-services-networkrmiregistry/</guid>
		<description><![CDATA[Gary and I were recently prototyping an application that uses Java RMI, and so I ended up searching around to see if anyone has done a service conversion for rmiregistry(1). (rmiregistry(1) is the daemon that lets RMI clients find the available remote objects being served by various virtual machines on a given system.) Turns out [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.sun.com/garypen/">Gary</a> and I were recently
prototyping an application that uses Java RMI, and so I ended up
searching around to see if anyone has done a service conversion for
<code>rmiregistry</code>(1).  (<code>rmiregistry</code>(1) is the daemon
that lets RMI clients find the available remote objects being served by
various virtual machines on a given system.)  Turns out no one has (or
no one&#8217;s published it), which means it&#8217;s time to rev up the
convert-o-tron.</p>

<p>Since we&#8217;re still developing our application and it&#8217;s likely we&#8217;ll
change a definition or two, and since we need to restart the registry to
cause the remote objects, we&#8217;re going to make our prototype service
restart automatically if we restart the registry.  That means our
prototype service has a dependency on <code>network/rmi/registry</code>
with specific <code>restart_on</code> behaviour, meaning that its
service description has a fragment like the following:</p>

<p><pre>
&lt;!--
As an RMI server application, we expect to be able to
register our RMI classes with the registry server.
--&gt;
&lt;dependency
name='rmi-registry'
grouping='require_all'
restart_on='restart'
type='service'&gt;
&lt;service_fmri value='svc:/network/rmi/registry' /&gt;
&lt;/dependency&gt;
</pre></p>

<p>Inject that fragment into your various RMI servers&#8217; descriptions (or
the equivalent property group into the repository) and you&#8217;ll save a bit
of time on application reinitializations.</p>

<p>So, if you&#8217;re interested, please feel free to take a copy of <a
href="http://mediacast.sun.com/share/sch/rmiregistry.xml"><code>network/rmi/registry</code></a>;
comments and corrections welcome.</p>

<p class="tag">
[ <i>T</i>:
<a href="http://www.technorati.com/tag/OpenSolaris" rel="tag">OpenSolaris</a>
<a href="http://www.technorati.com/tag/Solaris" rel="tag">Solaris</a>
<a href="http://www.technorati.com/tag/smf" rel="tag">smf</a>
RMI
]
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31292&type=feed" alt=" Bespoke services: network/rmi/registry"  title="Bespoke services: network/rmi/registry" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2006/03/28/bespoke-services-networkrmiregistry/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New pocket location</title>
		<link>http://blueslugs.com/2006/02/23/new-pocket-location/</link>
		<comments>http://blueslugs.com/2006/02/23/new-pocket-location/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 18:37:08 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2006/02/23/new-pocket-location/</guid>
		<description><![CDATA[I&#8217;m not the most device-laden person around here&#8212;by far. But I occasionally like to carry a camera and my Visor, as well as the obligatory tether-phone. An extra pocket would be nice, as wearing a jacket (with its 2 &#8211; 6 pockets) is uncomfortable for much of the year in a California climate. I always [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m not the most device-laden person around here&mdash;by far.  But I
occasionally like to carry a camera and my Visor, as well as the
obligatory tether-phone.  An extra pocket would be nice, as wearing a
jacket (with its 2 &#8211; 6 pockets) is uncomfortable for much of the year in
a California climate.  I always thought that the Dockers was onto
something with their Mobile Pants, but now <a
href="http://www.reghardware.co.uk/2006/02/23/pink_ipod_tie/">The
Register reports</a> that Thomas Pink has upped the ante by placing a pocket
on the back of a necktie.
</p>

<p class="note">
Seems like a natural place for any digital music player or even a
voice-driven phone, given a headset with one or two buttons.
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31294&type=feed" alt=" New pocket location"  title="New pocket location" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2006/02/23/new-pocket-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seasonal OpenSolaris shirt</title>
		<link>http://blueslugs.com/2005/12/13/seasonal-opensolaris-shirt/</link>
		<comments>http://blueslugs.com/2005/12/13/seasonal-opensolaris-shirt/#comments</comments>
		<pubDate>Tue, 13 Dec 2005 19:00:16 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/12/13/seasonal-opensolaris-shirt/</guid>
		<description><![CDATA[Sara&#8217;s tree [was once available] on a shirt. [That was pretty] slick. Update, 2009-03-26: The swag store and the shirt are no longer available. [ T: OpenSolaris ]]]></description>
			<content:encoded><![CDATA[<p>
Sara&#8217;s <a href="http://blogs.sun.com/roller/page/sarad?entry=i_m_jewish_for_christ" class="broken_link">tree</a>
[was once available] on a shirt.
</p>

<p>
[That was pretty] slick.
</p>

<p><b>Update, 2009-03-26:</b> The swag store and the shirt are no longer available.</p>

<p class="tag">
[ <i>T</i>:
<a href="http://www.technorati.com/tag/OpenSolaris" rel="tag">OpenSolaris</a>
]
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31298&type=feed" alt=" Seasonal OpenSolaris shirt"  title="Seasonal OpenSolaris shirt" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/12/13/seasonal-opensolaris-shirt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What I did during my summer vacation: hack hack hack</title>
		<link>http://blueslugs.com/2005/07/12/what-i-did-during-my-summer-vacation-hack-hack-hack/</link>
		<comments>http://blueslugs.com/2005/07/12/what-i-did-during-my-summer-vacation-hack-hack-hack/#comments</comments>
		<pubDate>Tue, 12 Jul 2005 19:10:33 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/07/12/what-i-did-during-my-summer-vacation-hack-hack-hack/</guid>
		<description><![CDATA[The rest of the family didn&#8217;t have vacation time, beyond the Fourth of July weekend, so I got a chance to do some reading and to write some code. I am particularly excited to use tag(1) at work: my home directory is hosted on the main zfs(7FS) server, which means practically unlimited metadata. Tagging&#8212;I hope&#8212;will [...]]]></description>
			<content:encoded><![CDATA[<p>The rest of the family didn&#8217;t have vacation time, beyond the Fourth
of July weekend, so I got a chance to do <a
href="http://blueslugs.com/wordpress/index.php/archives/2005/07/06/manufacturing-week-reading/"
title="Business books">some reading</a> and to <a
href="http://blueslugs.com/wordpress/index.php/archives/2005/07/12/tag1-delicious-style-file-tagging/"
title="tag(1)"> write some code</a>.  </p>

<p>
I am particularly excited to use <code>tag</code>(1) at work:
my home directory is hosted on the main <code>zfs</code>(7FS) server,
which means practically unlimited metadata.  Tagging&mdash;I hope&mdash;will
let me coalesce my <code>projects/</code>, <code>projects/old-projects</code>,
and <code>play/</code> into a single <code>projects</code> directory with
<code>current</code> and <code>obsolete</code> tags.  I&#8217;m also toying with ideas
around HTML files involving redirects as a private link collection and tagging file
fragments via their offsets.
</p>

<p>
[ <i>T</i>:
<a href="http://www.technorati.com/tag/OpenSolaris" rel="tag">OpenSolaris</a>
<a href="http://www.technorati.com/tag/Solaris" rel="tag">Solaris</a>
<a href="http://www.technorati.com/tag/zfs" rel="tag">zfs</a>
]
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31317&type=feed" alt=" What I did during my summer vacation: hack hack hack"  title="What I did during my summer vacation: hack hack hack" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/07/12/what-i-did-during-my-summer-vacation-hack-hack-hack/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bespoke services:  application/vncserver</title>
		<link>http://blueslugs.com/2005/06/01/bespoke-services-applicationvncserver/</link>
		<comments>http://blueslugs.com/2005/06/01/bespoke-services-applicationvncserver/#comments</comments>
		<pubDate>Wed, 01 Jun 2005 20:00:57 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[manifestly]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/06/01/bespoke-services-applicationvncserver/</guid>
		<description><![CDATA[In honour of the &#8220;Mugs for Manifests&#8221; contest, I thought I would spin out another custom service description I wrote some months ago. My setup for working from home&#8212;key during the last six months of Solaris 10&#8212;is to tunnel into Sun&#8217;s network via one implementation or another of a virtual private network (VPN). In all [...]]]></description>
			<content:encoded><![CDATA[<!--
vim:set filetype=html:
-->

<p>
In honour of the <a
href="http://blogs.sun.com/roller/page/sch/20050527#smf_5_not_quite_free">&#8220;Mugs
for Manifests&#8221; contest</a>, I thought I would spin out another custom
service description I wrote some months ago.
</p>

<p>
My setup for working from home&mdash;key during the last six months of
Solaris 10&mdash;is to tunnel into Sun&#8217;s network via one implementation or another
of a virtual private network (VPN).  In all cases, the VPN solution
runs on Solaris.  Although the VPN lets your system participate more or
less like a regular host, I find it&#8217;s easier to use VNC to remotely
present an X11 display from my main workstation, <i>muskoka</i>.  But,
of course, machine running pre-production bits can fail or be rebooted
or be reinstalled regularly, so I wanted the VNC server on my system to
always be up:  I wanted a VNC service.
</p>

<p>
What&#8217;s distinct about running the VNC server is that it should run as
me, with my environment, and not as root with <code>init</code>(1M)&#8217;s.
<code>svc.startd</code>(1M), while it can run methods according to
<code>smf_method</code>(5), doesn&#8217;t populate the environment fully in
the sense of <code>login</code>(1).  So we will need to extract some
data from the name
service, which is cumbersome to perform in a shell script.  We&#8217;ll write
our method in Perl, which implies
</p>

<p align="center">
<blockquote>
Tip 1:  Methods need not be shell scripts.
</blockquote>
</p>

<p>
In fact, the start method and the stop method can be totally separate
commands:  you could write one in Python, and one can be an executable Java .jar
archive, or some even more bizarre combination.
</p>

<p>
The other trick is that, if VNC fails for some reason, I want to be
aggressive about cleaning up its various leftover temporary files.  For
this purpose, I run the stop method with a different
credential&mdash;the default of <code>root</code>&mdash;than the start
method, which is done in our brief manifest by locating the
<code>&lt;method_context&gt;</code> element on only the start method.
</p>

<p align="center">
<blockquote>
Tip 2:  Methods need not be run with identical method contexts.  Credentials, privileges, and the like may all differ from method to method.
</blockquote>
</p>

<p>
Our manifest then looks like:
</p>

<p><pre>
&lt;?xml version='1.0'?&gt;
&lt;!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'&gt;
&lt;service_bundle type='manifest' name='export'&gt;
&lt;service name='application/vncserver' type='service' version='0'&gt;
&lt;single_instance/&gt;
&lt;instance name='sch' enabled='true'&gt;
&lt;dependency name='milestone' grouping='require_all' restart_on='none' type='service'&gt;
&lt;service_fmri value='svc:/milestone/multi-user:default'/&gt;
&lt;/dependency&gt;
&lt;dependency name='autofs' grouping='require_all' restart_on='none' type='service'&gt;
&lt;service_fmri value='svc:/system/filesystem/autofs:default'/&gt;
&lt;/dependency&gt;
&lt;dependency name='nis' grouping='require_all' restart_on='none' type='service'&gt;
&lt;service_fmri value='svc:/network/nis/client:default'/&gt;
&lt;/dependency&gt;
&lt;exec_method name='stop' type='method' exec='/home/sch/bin/vncserver_method stop' timeout_seconds='60'/&gt;
&lt;exec_method name='start' type='method' exec='/home/sch/bin/vncserver_method start' timeout_seconds='300'&gt;
&lt;method_context&gt;
&lt;method_credential user='sch' group='staff' /&gt;
&lt;/method_context&gt;
&lt;/exec_method&gt;
&lt;/instance&gt;
&lt;/service&gt;
&lt;/service_bundle&gt;
</pre></p>

<p>
The dependencies above are needed if you use NFS for home
directories and NIS for name services; they could be reduced for less
networked setups.
</p>

<p>
And, for the method, we have a short Perl program.  The complete list of
environment variables in <code>login</code>(1) would include
<code>LOGNAME</code>, <code>PATH</code>, <code>MAIL</code>, and
<code>TZ</code> (timezone), and exclude my silly setting of
<code>LANG</code>, but most of these will be set up by the shell that
the VNC startup script (its analgue to <code>.xinitrc</code>.  The
various <code>print</code> calls are just to let the service log show a
little activity, and could be removed.
</p>

<p><pre></p>

<h1>!/usr/perl5/bin/perl</h1>

<p>require 5.8.3;
use strict;
use warnings;
use locale;
my ($name, $passwd, $uid, $gid,  $quota, $comment, $gcos, $dir, $shell,
$expire) = getpwuid "$&lt;";
$ENV{USER} = $name;
$ENV{HOME} = $dir;
$ENV{SHELL} = $shell;
$ENV{LANG} = "en_CA";           # Just to create havoc (i.e. expose bugs).
#</p>

<h1>The stop method is run as root so that it can cleanup.</h1>

<p>#
if (defined($ARGV[0]) &amp;&amp; $ARGV[0] eq "stop") {</p>

<h1>ksh and sh specific</h1>

<p>print "stop method\n";
system("$ENV{SHELL}", "-c", "/opt/csw/bin/vncserver -kill :1");
if (-S "/tmp/.X11-unix/X1") {
unlink("/tmp/.X11-unix/X1");
unlink("/tmp/.X1-lock");
}
exit 0;
}
#</p>

<h1>The start method is run with the user's identity.</h1>

<p>#
print "start method\n";
if (-f "/tmp/.X1-lock") {
unlink("/tmp/.X1-lock");
}
if (-S "/tmp/.X11-unix/X1") {
system("logger -p 1 application/vncserver requires " .
"/tmp/.X11-unix/X1 be removed");
exit 0;
}</p>

<h1>ksh and sh specific</h1>

<p>{ exec "$ENV{SHELL}", "-c",
"/opt/csw/bin/vncserver -pn -geometry 1600x1200 -depth 24 :1" };
system("logger -p 1 application/vncserver can't exec /opt/csw/bin/vncserver");
exit 1;
</pre></p>

<p>
And now we have always-on VNC service for the regular telecommuter:
</p>

<p><pre>
$ svcs -p vncserver
STATE          STIME    FMRI
online         13:01:01 svc:/application/vncserver:sch
13:01:00   100577 Xvnc
13:01:17   100625 xwrits
13:01:17   100626 ctrun
13:01:17   100632 xautolock
13:11:18   102348 xlock
$ uptime
12:00pm  up 23 hr(s),  4 users,  load average: 0.04, 0.07, 0.07
</pre></p>

<h2>Exercises</h2>

<ol>
<li>Remove the hard coded display numbering (&#8220;:1&#8243;, &#8220;X1&#8243;, etc.).</li>
<li>Make the resolution, display depth, RGB encoding, and other standard options into
properties.</li>
</ol>

<p class="tag">
[ <i>T</i>:
<a href="http://www.technorati.com/tag/Solaris" rel="tag">Solaris</a>
<a href="http://www.technorati.com/tag/smf" rel="tag">smf</a>
]
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31323&type=feed" alt=" Bespoke services:  application/vncserver"  title="Bespoke services:  application/vncserver" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/06/01/bespoke-services-applicationvncserver/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Neck kerchiefs (or neckerchiefs)</title>
		<link>http://blueslugs.com/2005/04/26/neck-kerchiefs-or-neckerchiefs/</link>
		<comments>http://blueslugs.com/2005/04/26/neck-kerchiefs-or-neckerchiefs/#comments</comments>
		<pubDate>Tue, 26 Apr 2005 09:06:07 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/04/26/neck-kerchiefs-or-neckerchiefs/</guid>
		<description><![CDATA[So, while I wore the final symmetric/named knot at the OpenSolaris CAB dinner, I haven&#8217;t stopped wearing ties to work. I&#8217;m tying a variety of knots for four-in-hand ties&#8212;Nickys and half-Windsors for the most part&#8212;plus the occasional bow-tie. As far as I can determine, it hasn&#8217;t affected my work. This is, of course, my wrap-up [...]]]></description>
			<content:encoded><![CDATA[<p>
So, while <a href="http://blogs.sun.com/roller/page/sch/20050405">I wore the final symmetric/named knot at the OpenSolaris CAB dinner</a>, I haven&#8217;t stopped wearing ties to work.  I&#8217;m tying a variety of knots for four-in-hand ties&mdash;Nickys and half-Windsors for the most part&mdash;plus the occasional bow-tie.  As far as I can determine, it hasn&#8217;t affected my work.
</p>

<p class="note">
This is, of course, my wrap-up post on neckties.
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31330&type=feed" alt=" Neck kerchiefs (or neckerchiefs)"  title="Neck kerchiefs (or neckerchiefs)" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/04/26/neck-kerchiefs-or-neckerchiefs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For the record, 10</title>
		<link>http://blueslugs.com/2005/04/04/for-the-record-10/</link>
		<comments>http://blueslugs.com/2005/04/04/for-the-record-10/#comments</comments>
		<pubDate>Mon, 04 Apr 2005 17:00:00 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/04/04/for-the-record-10/</guid>
		<description><![CDATA[Tie knot: Knot 78 (Balthus).]]></description>
			<content:encoded><![CDATA[<p class="note">
<strong>Tie knot:</strong> Knot 78 (Balthus).
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31334&type=feed" alt=" For the record, 10"  title="For the record, 10" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/04/04/for-the-record-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For the record, 9</title>
		<link>http://blueslugs.com/2005/03/31/for-the-record-9/</link>
		<comments>http://blueslugs.com/2005/03/31/for-the-record-9/#comments</comments>
		<pubDate>Thu, 31 Mar 2005 17:00:00 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/03/31/for-the-record-9/</guid>
		<description><![CDATA[Tie knot: Bow.]]></description>
			<content:encoded><![CDATA[<p class="note">
<strong>Tie knot:</strong> Bow.
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31335&type=feed" alt=" For the record, 9"  title="For the record, 9" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/03/31/for-the-record-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bespoke services:  application/catman</title>
		<link>http://blueslugs.com/2005/03/29/bespoke-services-applicationcatman/</link>
		<comments>http://blueslugs.com/2005/03/29/bespoke-services-applicationcatman/#comments</comments>
		<pubDate>Tue, 29 Mar 2005 21:31:58 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[manifestly]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/03/29/bespoke-services-applicationcatman/</guid>
		<description><![CDATA[For various reasons&#8212;some reasonable, some suspect&#8212;Solaris doesn&#8217;t ship with a compiled set of windex databases for its manual pages. The unfortunate result is that helpful commands like apropos(1) or man -k are unhelpful: $ apropos sort /usr/man/windex: No such file or directory &#60; p> smf(5) provides one way to address this shortcoming, via a transient [...]]]></description>
			<content:encoded><![CDATA[<p>
For various reasons&mdash;some reasonable, some suspect&mdash;Solaris doesn&#8217;t ship with a compiled set of <code>windex</code> databases for its manual pages.  The unfortunate result is that helpful commands like <code>apropos</code>(1) or <code>man -k</code> are unhelpful:
<pre>
$ apropos sort
/usr/man/windex: No such file or directory
</pre>
</p>

<p>&lt;</p>

<p>p>
<code>smf</code>(5) provides one way to address this shortcoming, via a transient service to be run during startup.  Our service description
would be roughly equivalent to the following:
<pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE service_bundle SYSTEM &quot;/usr/share/lib/xml/dtd/service_bundle.dtd.1&quot;&gt;
&lt;service_bundle type='manifest' name='sch:catman'&gt;
&lt;service
name='application/catman'
type='service'
version='1'&gt;
&lt;create_default_instance enabled='false' /&gt;
&lt;single_instance /&gt;
&lt;!--
By default, application/catman will run in the background
during boot.  If you want to run it periodically, execute</p>

<h1>/usr/sbin/svcadm restart catman</h1>

<p>If you wish to augment the default MANPATH, use the setenv
subcommand to svccfg(1M).  For instance, to add the Java
manual pages to the build:</p>

<h1>/usr/sbin/svccfg -s application/catman</h1>

<p>&gt; setenv MANPATH /usr/share/man:/usr/java/man
&gt; exit</p>

<h1>/usr/sbin/svcadm refresh catman</h1>

<p>If MANPATH is not defined, the default manual path is
/usr/share/man, as per catman(1M).
--&gt;
&lt;dependency
name='local-filesystems'
type='service'
grouping='require_all'
restart_on='none'&gt;
&lt;service_fmri value='svc:/system/filesystem/local' /&gt;
&lt;/dependency&gt;
&lt;dependency
name='remote-filesystems'
type='service'
grouping='optional_all'
restart_on='none'&gt;
&lt;service_fmri value='svc:/network/nfs/client' /&gt;
&lt;service_fmri value='svc:/system/filesystem/autofs' /&gt;
&lt;/dependency&gt;
&lt;exec_method
type='method'
name='start'
exec='/usr/bin/catman -w'
timeout_seconds='0' /&gt;
&lt;exec_method
type='method'
name='stop'
exec=':true'
timeout_seconds='0' /&gt;
&lt;property_group name='startd' type='framework'&gt;
&lt;propval name='duration' type='astring' value='transient' /&gt;
&lt;/property_group&gt;
&lt;stability value='Unstable' /&gt;
&lt;template&gt;
&lt;common_name&gt;
&lt;loctext xml:lang='C'&gt;
manual page index generation
&lt;/loctext&gt;
&lt;/common_name&gt;
&lt;documentation&gt;
&lt;manpage
title='catman'
section='1M'
manpath='/usr/share/man' /&gt;
&lt;/documentation&gt;
&lt;/template&gt;
&lt;/service&gt;
&lt;/service_bundle&gt;
</pre></p>

<p>&lt;</p>

<p>p>
Following my own instructions in the comment block, I defined a value for <code>MANPATH</code> and refreshed the service.
My setting can be double-checked with <code>svcprop</code>(1) like so:
<pre>
$ svcprop -p start application/catman
start/exec astring /usr/bin/catman\ -w
start/timeout_seconds count 0
start/type astring method
start/environment astring MANPATH=/usr/share/man:/usr/openwin/man:/usr/sfw/man:/usr/dt/man:/usr/perl5/man:/usr/java/man:/usr/apache/man:/usr/X11/man:/opt/sfw/man:/opt/csw/man
</pre></p>

<p>
Issuing &#8220;<code>svcadm enable catman</code>&#8221; will cause the service to be executed immediately, and upon each subsequent boot.  Our earlier query
becomes fecund:
<pre>
$ apropos sort
FcFontSort      FcFontSort (3fontconfig)    - Return list of matching fonts
aclsort         aclsort (3sec)  - sort an ACL
alphasort       scandir (3c)    - scan a directory
alphasort       scandir (3ucb)  - scan a directory
bsearch         bsearch (3c)    - binary search a sorted table
bunzip2         bzip2 (1)       - a block-sorting file compressor and associated utilities
bzcat           bzip2 (1)       - a block-sorting file compressor and associated utilities
bzip2           bzip2 (1)       - a block-sorting file compressor and associated utilities
bzip2recover    bzip2 (1)       - a block-sorting file compressor and associated utilities
disksort        disksort (9f)   - single direction elevator seek sort for buffers
ldap_sort       ldap_sort (3ldap)   - LDAP entry sorting functions
ldap_sort_entries               ldap_sort (3ldap)   - LDAP entry sorting functions
ldap_sort_strcasecmp            ldap_sort (3ldap)   - LDAP entry sorting functions
ldap_sort_values                ldap_sort (3ldap)   - LDAP entry sorting functions
libbz2          libbz2 (3)      - library for block-sorting data compression
look            look (1)        - find words in the system dictionary or lines in a sorted list
qsort           qsort (3c)      - quick sort
sort            sort (1)        - sort, merge, or sequence check text files
sortbib         sortbib (1)     - sort a bibliographic database
tsort           tsort (1)       - topological sort
...
</pre>
</p>

<p><strong>Exercises</strong>
<br /></p>

<ol>
<li>Add a configuration property that makes the service also rebuild the nroffed versions of the manual pages, if set to true.
<li>Make the service regenerate only in the case that components in the path have changed.
</ol>

<p class="note">
<strong>Tie knot:</strong> Knot 54 (Hanover).
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31337&type=feed" alt=" Bespoke services:  application/catman"  title="Bespoke services:  application/catman" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/03/29/bespoke-services-applicationcatman/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>For the record, 8</title>
		<link>http://blueslugs.com/2005/03/28/for-the-record-8/</link>
		<comments>http://blueslugs.com/2005/03/28/for-the-record-8/#comments</comments>
		<pubDate>Mon, 28 Mar 2005 17:00:00 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Pastime]]></category>

		<guid isPermaLink="false">http://blueslugs.com/wordpress/2005/03/28/for-the-record-8/</guid>
		<description><![CDATA[Tie knot: No time, no knot, alas.]]></description>
			<content:encoded><![CDATA[<p class="note">
<strong>Tie knot:</strong> No time, no knot, alas.
</p>
<img src="http://blueslugs.com/?ak_action=api_record_view&id=31338&type=feed" alt=" For the record, 8"  title="For the record, 8" />]]></content:encoded>
			<wfw:commentRss>http://blueslugs.com/2005/03/28/for-the-record-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

