On Wed, Oct 03, 2012 at 05:40:01PM +0300, skeletor wrote:
> 03.10.2012 17:13, Antonello Cruz пишет:
> >Do you know *why* your service is restarting too quickly?
> >
> >What do you see in the service logfile?
> >
> >What is the version of the OS you are running?
> >
> >Antonello
> >
> >
>
> I don't know yet.
> In the my service log I see
>
> [ Oct 3 12:43:41 Stopping because all processes in service exited. ]
> [ Oct 3 12:43:41 Executing stop method (:kill). ]
> [ Oct 3 12:43:41 Restarting too quickly, changing state to maintenance. ]
>
> in the restarter log I see
>
> Oct 3 12:43:41/1150: application/network/spawn-search:default
> failed repeatedly: transitioned to maintenance (see 'svcs -xv' for
> details)
>
> $ uname -srvpi
> SunOS 5.11 11.0 i386 i86pc
> $ isainfo -kv
> 64-bit amd64 kernel modules
>
> Now, I think about next workaround - add sleep command with 2-3
> seconds delay to exec script. But this is the most extreme case.
>
> Does it can be solve with standart methods or prorepties of SMF
> service or i need to use some workaround?
> _______________________________________________
> smf-discuss mailing list
> [email protected]
It sounds to me as if you have a transient service. SMF supports three
service models -- contract, transient and wait. Search for duration in
svc.startd(1M) for more information. You should find several occurances.
contract model is the default. It is intended for daemon processes that
should always be running. Thus, if all the processes in the contract die,
the service will be restarted.
Transient services are for services that need to be started, perform some
activity and then exit. Transient services will not be automatically
restarted by SMF. Since your start method is exiting without leaving any
running processes, I suspect that your service falls into this category.
If this is the case, we merely need to tell SMF that your service is a
transient service to fix the problem. The easiest way to do this is to
place an entry like this in your service manifest:
<property_group
name='startd'
type='framework'>
<propval name='duration' type='astring' value='transient'
/>
</property_group>
See the mdmonitor.xml manifest for an example. You will find it under
/var/svc/manifest if you are running s10 or /lib/svc/manifest if you are
running s11. After modifying your manifest, you need to make sure that is
reimported.
tom
_______________________________________________
smf-discuss mailing list
[email protected]