Hi Tom, Thanks for the immediate reply. I got one more question. Can a SMF service running in other zone be implemented as a dependency for another SMF present in some other zone? Say I got a service "A" running in "xyz" zone and service "B" running in "abc" zone. Is it possible to add "A" as dependency to "B" by any means so that "B"'s status gets affected based on "A"'s status?
Thanks, Prasath -----Original Message----- From: Tom Whitten [mailto:thomas.whit...@sun.com] Sent: Monday, July 13, 2009 10:20 PM To: Prasath Srinivasan (WT01 - Telecom Equipment) Cc: Truong.Q.Nguyen at sun.com; smf-discuss at opensolaris.org Subject: Re: [smf-discuss] svcadm enable restarts already started legacy service? prasath.srinivasan at wipro.com writes: > > Hi, > > I got a service which checks whether the service is already running > before attempting to start it again. > > Now I start it in the legacy manner i.e. "<path> <servicename> start" > > This starts the service. > > After this, when I give svcadm enable <FMRI of the service>, again it > executes the start method and the previous process is killed and a new > process is initiated. > > Can someone clarify me if the same process cannot be retained because > when the smf executes the start method, it vcerifies for previous > instance of the process and returns 0, which is not sufficient for the > service to change to online state. So the SMF feature executes stop once > and starts again. > > Pleas do clarify me on this. > > > Thanks, > Prasath svc.startd uses contracts (man contract(4)) to keep track of processes that are running in a service. Since you started your service manually, startd has no knowledge that it is running. That is to say, it does not hold any contracts for those processes. I assume that your service is a contract model service, since that is the default in the manifest. See the svc.startd(1M) man page and look for "duration" for an explanation. When you invoke svcadm enable for your service, started invoked your start method. Your start method exited without starting any other processes. As far as startd is concerned, all processes in your service exited. In the contract model it is considered a service failure when all processes exit. Since your service "failed", startd attempts to restart it. The bottom line is if you want your service to be properly controlled by SMF, then you must start it using SMF commands (svcadm enable). tom Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com