<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>Hobbit Client as a Service on Solaris 10</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>This is already documented
on The Shire:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><a
href="http://www.trantor.org/theshire/doku.php/addons:hobbitsmf">http://www.trantor.org/theshire/doku.php/addons:hobbitsmf</a></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Everett, Vernon [mailto:Vernon.Everett@woodside.com.au] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Donnerstag, 6. Dezember 2007
02:25<br>
<b><span style='font-weight:bold'>To:</span></b> hobbit@hswn.dk<br>
<b><span style='font-weight:bold'>Subject:</span></b> [hobbit] Hobbit Client as
a Service on Solaris 10</span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hi
all</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
have set up my Hobbit clients to run (and auto-start) as a service on Solaris
10.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thought
I would share this with the list. </span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>(If I
have reinvented the wheel, then apologies for cluttering the list, but I
couldn't find anything like this anywhere else)</span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>T.J.
Are you still looking after the Hobbit Wiki?</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>If
enough people find this guide useful, it might be good to add it to the Wiki.</span></font>
</p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>For
those of you familiar with Solaris 10, you should know about services, but for
some, adding new ones is a little tricky.</span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>To
get Hobbit working as a sevice we need to do the following.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Create
the file</span></font> <font size=2 face="Courier New"><span style='font-size:
10.0pt;font-family:"Courier New"'>/var/svc/manifest/application/hobbit.xml</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>In it,
put the following </span></font><br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><?xml
version="1.0"?></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><!DOCTYPE
service_bundle SYSTEM
"/usr/share/lib/xml/dtd/service_bundle.dtd.1"></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><!--</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
Copyright 2007 Vernon Everett - vernon(a)everett.co.za</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
Free for use and distibution for non-commercial purposes.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
No warranty exists either implicit or implied.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
Standard disclaimer applies.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
Commercial use is subject to license terms.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>--></span></font>
</p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'><service_bundle type='manifest'
name='Hobbit-monitor:hobbit'></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'><service</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
name='application/hobbit'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
type='service'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>   
version='1'></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <dependency</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
name='filesystem'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
grouping='require_all'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
restart_on='none'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
type='service'></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>               
<service_fmri value='svc:/system/filesystem/local'/></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</dependency></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <dependency</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
name='multi-user-server'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
grouping='optional_all'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
type='service'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
restart_on='none'></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>               
<service_fmri value='svc:/milestone/multi-user-server' /></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</dependency></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <exec_method</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
type='method'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
name='start'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
exec='/usr/lib/hobbit/client/runclient.sh start'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
timeout_seconds='10'></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
<method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
<method_credential user='hobbit'/></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
</method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</exec_method></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <exec_method</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
type='method'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
name='stop'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
exec='/usr/lib/hobbit/client/runclient.sh stop'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
timeout_seconds='10'></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
<method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
<method_credential user='hobbit' /></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
</method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</exec_method></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <exec_method</span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
type='method'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
name='restart'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
exec='/usr/lib/hobbit/client/runclient.sh restart'</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>           
timeout_seconds='10'  ></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
<method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
<method_credential user='hobbit' /></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>     
</method_context></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</exec_method></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <instance
name='default' enabled='true' /></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <stability
value='Unstable' /></span></font> </p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>        <template></span></font>
<br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>               
<common_name></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>                       
<loctext xml:lang='C'></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>                               
Hobbit Monitor Client</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>                       
</loctext></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>               
</common_name></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>       
</template></span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'></service></span></font>
</p>

<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'></service_bundle></span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Take
note of lines 37, 47 and 57, the lines that start "exec=". You may
need to edit the path to your Hob bit start script.</span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>To
avoid confusion or possible issues, shut down your hobbit client at this point
using the runclient script.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Now,
as root, run the command </span></font><br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>#
svccfg import /var/svc/manifest/application/hobbit.xml</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>We
should now have a service called hobbit.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>#
svcs | grep hobbit</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>online         
9:23:05 svc:/application/hobbit:default</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>(It
will probably have gone online at this point)</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>You
can now treat it as you would a regular service.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>If it
hasn't gone online, kick it off as normal.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>#
svcadm enable hobbit</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>It may
be necessary to do a disable and then an enable, but that should get it going.</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>And
because we have set the default as enabled, the service should start
automagically when you do a reboot.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Confirm
it's all good by doing a</span></font> <font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'># ps -efa | grep hobbit</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>All
the usual scripts should be running.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>If
you don't want it as a serivce anymore, as root run</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>#
svccfg delete hobbit.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>This
will remove the service, and allow you to continue running it from the
runclient script.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Have
fun.</span></font> </p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Regards</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>    
Vernon</span></font> </p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'> </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>NOTICE: This email and any attachments are confidential. </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>They may contain legally privileged information or </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>copyright material. You must not read, copy, use or </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>disclose them without authorisation. If you are not an </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>intended recipient, please contact us at once by return </span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>email and then delete both messages and all attachments.</span></font></pre></div>

</div>

</body>

</html>