I'm not sure that I fully understand your problem, so I need some more information. Is the dependent service going into maintenance because the background process is not yet ready to perform its services? The output of svcs -xl might be helpful. Also any messages in the dependent service's log file that say why it is going into maintenance would be helpful.
In general using sleeps in a case like this tends to be a problem. You never know for sure how long you need to wait. It would be better to come up with a method to directly determine when the background process is ready to do its job. Do you know for sure that the background process is ready after 10 seconds? SMF will not put the ocssd service in the online state until your script exits. You may want to look into why the background process is taking so long to become available. tom Sachin Butala writes: > created service "ocssd" with shell script which start some background > services. it works fine but dependent service goes into maintenance as > service "ocssd" status comes online where as background process tooks more > time to start. > > to resolve this i put sleep but it won't works as exepected. > > i need to put delay in changing smf service status to online or is it > possible to put delay on dependent service. > > {code} > #!/usr/bin/sh > # > # Sachin Butala (2010-02-17) > # SMF Method file for Oracle 11gR2 OCSS > # E-mail: sachin.butala at trueposition.com > # > > . /lib/svc/share/smf_include.sh > > case "$1" in > start) > /u01/grid/oracle/product/11.2.0/asm_1/bin/crs_start.bin -all 2>&1 & > sleep 10 > ;; > stop) > /u01/grid/oracle/product/11.2.0/asm_1/bin/crs_stop.bin -all > sleep 10 > ;; > 'restart') > stop > while pgrep ocssd > /dev/null > do > sleep 1 > done > start > ;; > *) > echo "" > echo "Usage: `basename $0` { start | stop | restart }" > echo "" > exit 64 > ;; > esac > exit $SMF_EXIT_OK > #---EOF > {code} > -- > This message posted from opensolaris.org > _______________________________________________ > smf-discuss mailing list > smf-discuss at opensolaris.org