* mnikhil m <mnikhil.juno at gmail.com> [2005-10-10 03:18]: > On 10/10/05, Ganesh <ganesh.chaudhari at gmail.com> wrote: > > > > If I understand your querry, > > > > you can add the port check logic in your rc script itself. If port is not > > available, just exit with error code other than 0 and some error message. I > > guess it is alreay there ?? > > > > Are you saying when the port becomes free, service should come online ??? > > > > I think u cannot. But you can sure call some script using exec and that > > you are already doing. > > hmm..this was something I too imagined..but not sure and never glared into > the smf architecture .. > Thanks for the info Ganesh :) > BTW, does that means can we have error status of the previous programs > defined and depending on those codes, we can execute something else ??
You may be able to use the exclude_all dependency to do something clever. You won't have general access to the exit status, but the instance's state will be maintenance, and you could key actions in other services to that. optional_all does the simplest action, which is to proceed if the service goes to maintenance. More generally, if you want your service to pounce when the port is available *and* no other service depends on it (or you don't mind them potentially being indeterminably delayed), then you can test for availability in your start method and retry until it's available. You will want the start method to have an infinite timeout for that case. svc.startd(1M) currently has no support for monitoring general resource availability. - Stephen -- Stephen Hahn, PhD Solaris Kernel Development, Sun Microsystems stephen.hahn at sun.com http://blogs.sun.com/sch/