Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Jul 2000 13:11:23 -0500 (CDT)
From:      Tim Zingelman <zingelman@fnal.gov>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: HEADS UP: /etc/rc.shutdown calls local scripts now
Message-ID:  <Pine.GSO.4.21.0007091310130.15474-100000@nova.fnal.gov>

next in thread | raw e-mail | index | archive | help
On Fri, 7 Jul 2000, Doug Barton wrote:

> > /usr/local/etc/rc.d now must _pay attention_ to the argument sent to
> > them. Right now, many scripts in there do a startup procedure when
> > called. (period) This will need to be fixed. There _will_ be some pain. 

> 	And what some of us are saying is that the pain is not a
> requirement to make this feature work. There are ways to accomplish the
> goal that this proposal wants to accomplish without all of the "pain" that
> suddenly changing everything around will engender.
> Doug

I agree.  How painful would it be to grep the scripts for "stop.*)" and
only execute those that match at shutdown time?

if [ "X${local_startup}" != X"NO" ]; then
  echo -n 'Local package shutdown:'
  for dir in ${local_startup}; do
    [ -d ${dir} ] && for script in ${dir}/*.sh; do
      [ -x ${script} ] && grep -q "stop.*)" ${script} && \ 
	(set -T ; trap 'exit 1' 2 ; ${script} stop)
    done
  done
  echo .
fi      

The key part here is the addition of:

  grep -q "stop.*)" ${script} &&

Certainly not guaranteed to catch everything, but much better than
nothing IMHO.

  - Tim



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.21.0007091310130.15474-100000>