Stuff Nobody Cares About

The soul...
The feeds...
The links...
Wednesday Dec 05, 2007

SMF, segfaults, and contracts on Solaris 10.

Something that isn't immediately obvious when composing an SMF manifest on Solaris is that the process contract doesn't just include the processes launched by SMF, but also those processes launched by those processes.

Most of the time it doesn't matter. But it can catch you off-guard when you neglect to enter a proper ignore_error propval in the manifest. Then, SMF suddenly cares if any of the sub-processes core while running. Core dumps are obviously problems... they shouldn't be happening if your application is well-behaved. But you don't necessarily want a high-profile service like a webserver being shut down by SMF just because some piddly CGI version of "Hello World" chased a NULL.

It can also be frustrating, because these little sub-processes are also not typically blatantly associated with the main service. SMF will typically log a somewhat-helpful error, "pid exited with signal 11" or some such... and, of course, that's where you need process accounting, to find out what "pid" was, if it wasn't kind enough to leave the core in the obvious place.

ptree -c pid will show the contract ID associated with a tree of processes. You can expand on the nature of the process contract with ctstat -vi contract-id and find out what faults SMF will let ride.

Also, something handy I can't believe I didn't know before: svcs -p FMRI will show the currently-running processes associated with an SMF-managed service. Handy.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed