William Roche wrote: > 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 (&).
Erm... this is only 50% of the work - the background job will still be associated with the parent shell and may receive a SIGHUP in some conditions. The only safe way to do this is run a background job via '&' and then use $ disown $! # to seperate the background job from the parent. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;)