On Thu, Aug 16, 2001 at 08:30:29AM -0500, Drew Raines wrote:
> * Marcus Reid <[EMAIL PROTECTED]>:
> >
> > I'm wondering if there's an elegant way to stop these processes during
> > a system shutdown. The best that I've thought of is something like:
> > 
> > for sname in `find /service -name supervise`; do
> >     svc -d `dirname $sname`
> > done
> 
> Try this:
> 
>       % for sname in `ls -1d /service/*`; do svc -d $sname; done      
> 
> (You had two problems with your command.  `find /service -name supervise` is
>  always going to return nothing because /service should all be symlinks.
>  To do what you're trying to do, you could add a -follow to your find
>  command.  The only problem there is svc doesn't want a supervise
>  directory, it wants supervise's parent directory, a la /service/<whatever>.)

Ah, that's what the ''dirname'' was in there for. If I replace 'svc -d' with
'echo' in my command, the output is:

/service/qmail-send/log
/service/qmail-send
/service/qmail-smtpd
/service/qmail-popup

Your command misses the /service/qmail-send/log directory..

I don't know what you mean by '/service should all be symlinks.'
I don't have any symlinks in there; am I missing something important?

Getting svc to run on all of the directories isn't the issue; it's getting
my shutdown script to wait for all of the supervised processes to die before
exiting. If it exits, the system goes ahead and clobbers everything, syncs
the disks and sits there grinning. I was thinking there was maybe a way to
make svc exit only when the supervised process was really dead.. Or should
I poll svstat until either a couple of minutes pass or the process is down?

Thanks,
Marcus

> 
> -- 
> Drew

Reply via email to