Hi Steve,<br><br>I will try what you suggest but there is a couple of things that are strange to me in what you say.<br><br>1. I completely agree with except for the fact that when I run in commandline: rrdtool - <directory> the process does not end (it waits until I type commands). That's why it's so strange to me that the process exists inmediately.<br>
2. I know that stop method is not right (as I recognized in my first post) but as I am not very proficient in Solaris/SMF/RRDTOOL I was trying to solve the problem incrementally. So first of all I wanted to start the process.<br>
<br>I will try 1 option and see how it goes.<br><br>Thanks<br><br><div class="gmail_quote">On Wed, Dec 1, 2010 at 2:50 AM, Steve Shipway <span dir="ltr"><<a href="mailto:s.shipway@auckland.ac.nz">s.shipway@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-NZ"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">When you define a normal solaris SMF service, it expects to be given a command that starts the process, and this process continue to live until killed by the kill command. </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Your ‘start’ method is just ‘rrdtool’, which will exit on finishing the commands – which is what happens.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Your ‘stop’ method has ‘blabla’ instead of the process ID (which you cannot determine anyway).</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">When you want to run rrdtool as a service, you actually should do it via xinetd, which will spawn a separate handler per connection.</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">To make it work with solaris, you have two options:</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p><span style="font-size: 11pt; color: rgb(31, 73, 125);"><span>1.<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-size: 11pt; color: rgb(31, 73, 125);">Use the inetd method; I’m not an expert with SMF, but I know you can (somehow) define inetd-type handlers via SMF as well using a differrent syntax</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"><span>2.<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-size: 11pt; color: rgb(31, 73, 125);">Use rrdcached instead of rrdtool. This is probably a better solution, though you might want to get the trunk version of rrdtool 1.4.x in order to have the maximum possible support for the various rrdtool commands. The rrdcached command will work nicely with SMF as it is a single daemon and will output the PID to a separate file which you can then use in your kill command.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I would use option (2) but your circumstances might mean (1) is a better option for you.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Steve</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"><hr align="center" size="2" width="100%"></span></div><p class="MsoNormal"><b><span style="font-size: 11pt; color: rgb(31, 73, 125);">Steve Shipway</span></b></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);">ITS Unix Services Design Lead</span></p><p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);">University of Auckland, New Zealand</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);">Floor 1, 58 Symonds Street, Auckland</span></p><p class="MsoNormal"><i><span style="font-size: 10pt; color: rgb(89, 89, 89);">Phone: +64 (0)9 3737599 ext 86487</span></i></p>
<p class="MsoNormal"><i><span style="font-size: 10pt; color: rgb(89, 89, 89);">DDI: +64 (0)9 924 6487</span></i></p><p class="MsoNormal"><i><span style="font-size: 10pt; color: rgb(89, 89, 89);">Mobile: +64 (0)21 753 189</span></i></p>
<p class="MsoNormal"><i><span style="font-size: 10pt; color: rgb(89, 89, 89);">Email: <a href="mailto:s.shipway@auckland.ac.nz" target="_blank"><span style="color: rgb(89, 89, 89);">s.shipway@auckland.ac.nz</span></a></span></i></p>
<p class="MsoNormal"><span style="font-size: 18pt; font-family: Webdings; color: green;" lang="EN-GB">P</span><span style="font-size: 11pt; color: blue;" lang="EN-GB"> </span><span style="font-size: 10pt; color: green;" lang="EN-GB">Please consider the environment before printing this e-mail</span><span style="font-size: 11pt; color: blue;" lang="EN-GB"> </span><span style="font-size: 7.5pt; color: navy;" lang="EN-GB"></span></p>
<p class="MsoNormal"><i><span style="font-size: 10pt; color: rgb(31, 73, 125);"> </span></i></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><div style="border-width: medium medium medium 1.5pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; padding: 0cm 0cm 0cm 4pt;">
<div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;"><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> rrd-users-bounces+s.shipway=<a href="http://auckland.ac.nz" target="_blank">auckland.ac.nz</a>@<a href="http://lists.oetiker.ch" target="_blank">lists.oetiker.ch</a> [mailto:<a href="mailto:rrd-users-bounces%2Bs.shipway" target="_blank">rrd-users-bounces+s.shipway</a>=<a href="http://auckland.ac.nz" target="_blank">auckland.ac.nz</a>@<a href="http://lists.oetiker.ch" target="_blank">lists.oetiker.ch</a>] <b>On Behalf Of </b>Jose Ignacio Gil Jaldo<br>
<b>Sent:</b> Wednesday, 1 December 2010 1:04 a.m.<br><b>To:</b> <a href="mailto:rrd-users@lists.oetiker.ch" target="_blank">rrd-users@lists.oetiker.ch</a><br><b>Subject:</b> [rrd-users] RRDTool as a server in Solaris</span></p>
</div></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom: 12pt;">Hi,<br><br>I'm very new to Solaris and to rrdtool, but in my company we've been using rrdtool in linux without any problem.<br>
<br>Anyway, I'm trying deploy it in a solaris 10 machine and I am not being able to start it as a server.<br><br>I have created a SMF to start it but it seems to go down. The SMF is:<br><br><?xml version='1.0'?><br>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'><br><service_bundle type='manifest' name='export'><br> <service name='rrdtool' type='service' version='0'><br>
<create_default_instance enabled='true'/><br> <single_instance/><br> <instance name='rrdtool' enabled='false'><br> <exec_method<br> type='method'<br>
name='start'<br> exec='/opt/csw/bin/rrdtool - <Directory>'<br> timeout_seconds='0'><br> </exec_method><br>
<exec_method<br> type='method'<br> name='stop'<br> exec='kill -9 blabla'<br> timeout_seconds='30'><br>
</exec_method><br> </instance><br> </service><br></service_bundle><br><br>where <Directory> is the place where I want to leave the statistics. However, when I try to start it using: svcadm enable rrdtool:rrdtool<br>
<br>I get the following log:<br>/usr/bin/kill[8]: blabla: Arguments must be %job or process ids<br>[ Nov 30 11:42:55 Method "stop" exited with status 1 ]<br>[ Nov 30 11:50:44 Leaving maintenance because disable requested. ]<br>
[ Nov 30 11:50:44 Disabled. ]<br>[ Nov 30 11:50:47 Enabled. ]<br>[ Nov 30 11:50:47 Executing start method ("/opt/csw/bin/rrdtool - /opt/synchronica/synchronica/demo-server/statistics") ]<br>[ Nov 30 11:50:47 Method "start" exited with status 0 ]<br>
[ Nov 30 11:50:47 Stopping because all processes in service exited. ]<br>[ Nov 30 11:50:47 Executing stop method ("kill -9 blabla") ]<br>/usr/bin/kill[8]: blabla: Arguments must be %job or process ids<br>[ Nov 30 11:50:47 Method "stop" exited with status 1 ]<br>
[ Nov 30 11:50:47 Executing stop method ("kill -9 blabla") ]<br>/usr/bin/kill[8]: blabla: Arguments must be %job or process ids<br>[ Nov 30 11:50:47 Method "stop" exited with status 1 ]<br>[ Nov 30 11:50:47 Executing stop method ("kill -9 blabla") ]<br>
/usr/bin/kill[8]: blabla: Arguments must be %job or process ids<br>[ Nov 30 11:50:47 Method "stop" exited with status 1 ]<br><br>Also if I run that command in command-line it does not end inmediately and I can run commands.<br>
<br>I know that kill -9 blablabla is not correct but it should not be executed (it is executed because the command ends). Any clue about the problem cause? Do I have to register something else anywhere?<br><br>Thanks a lot<br>
<br></p></div></div></div></div></div></blockquote></div><br>