Hello Christine, Just a few remarks
On 01/06/09 01:04, Christine Tran wrote: > Hi, > > I have a script that runs all the time, basically, it's a > > while true > sleep > do > check_something > do_something > done > > It runs fine. To be kosher I have written a manifest for it but its > SMF state is never "online", it's always "offline" progressing to > "online". > I've reduced the timeout to 0. I must be missing something obvious, > like a stdout re-direct or something. What's wrong and why won't SMF > online it? I guess you made this script the start method of your service. As this script never ends, the start method never returns its exit code to SMF -> and the service never goes to the online state. A way to do what you want is to create another script to start yours and return the appropriate SMF exit codes if the startup can be done correctly --> your script would be started in background (&). > > Also, there are exit conditions. Since this is not a transient > service, SMF will try to restart. Can I get to a maintenance state > with something like exit $SMF_EXIT_ERR_FATAL, and tweak the manifest > to ignore signals, so SMF *never* restarts it even when all processes > exited? If SMF tries to restart, it will succeed, but this isn't what > I want. > If you don't want SMF to restart it for whatever reason, you can also call: svcadm disable [-t] <your FMRI> Just before exiting. Of course don't use -s here :) HTH, Cheers, William. > This stuff is too simple to write it as a real daemon, ie - a > non-scripting low-level language. > > CT > _______________________________________________ > smf-discuss mailing list > smf-discuss at opensolaris.org