Brian Ruthven - Solaris Network Sustaining - Sun UK
<[email protected]> writes:

> Hi Harry,
>
> I've got nothing canned which I can quickly pass on, however, anything
> I gather will be from google ;-)
>
> The top three hits searching for "writing smf manifest" look useful:
>
> http://www.sun.com/bigadmin/content/selfheal/sdev_intro.jsp
> http://wikis.sun.com/display/BigAdmin/SMF+Short+Cuts
> http://blogs.warwick.ac.uk/chrismay/entry/solaris_smf_manifest/

[...]

Jesus... after looking at those URL a bit I feel like just start
boohooing and go home.  This SMF stuff seems horribly complicated to
me.  They use terms like `JBoss' with no explanation.. 

And the XML itself just seem vastly overdone for something that should
be fairly simple.

> Hopefully that is enough to get you started. I'd suggest copying the
> manifest from a simple service such as utmp.xml and customise it to
> your needs. If your service needs a startup script, then you should
> include /lib/svc/share/smf_include.sh so you can use the correct exit
> codes to signal the right things to the framework.

I guess it will be a start... but man I don't understand hardly any of
it.

To attach a script to an existing service and make it restart when
that service restarts is not really something that should require
yards and yards of code, several documents, and god only knows what
else.

Its tempting to just write a perl script, that looks for the service
to be running, and starts up if it is.  

Is that a really bad approach for this?

`this' in case it has gotten away in the thread is to run a script
that reads from a named-pipe.. that the syslogger writes everything
to. 

The purpose of the script is to have finely grained control over
writing various things to logs... using regular expressions.

And after starting on the script, I realized I might want to change
the regular expressions as the script runs.

So far, I've figured out a way to do that I think, by making the
script read a secondary file every five minutes.  I might write a
regular expression and matching log file in the secondary file and
the script as it runs will start looking for those.  And writing hits
to the new log.

So far I plan just to use matching pairs in the secondary file like
this.

  REGEX     LOG.log

What I haven't really got into yet is the best way to have this script
running in the background... checking for syslog to be running.  That
is, the script would never stop running even if the syslogger shut
down. 

Maybe even some kind of `trap' in the script where it would send me a
message in the event it was killed.  (At least for some kinds of KILL)

That's where it starts to look like it might be better to insinuate
this script in there through SMF. 

I'd really like to see a simplified example of how that might be
done.  Maybe there is an example like that in the URLS you posted.  I
haven't gotten very far looking into them.

_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to