Date: Wed, 18 Nov 1998 22:24:39 -0500 From: "Yarema" <yds@ingress.net> To: <freebsd-current@FreeBSD.ORG> Subject: Re: /etc/rc.d, and changes to /etc/rc? Message-ID: <021f01be136c$244d6440$1f40e6cd@ichiban.ingress.com>
next in thread | raw e-mail | index | archive | help
>> I strongly oppose this; rc.d already exists and is standardized in several >> releases. Such a change would be gratuitous. > >I wasn't suggesting that rc.d be ditched, merely that another option be >provided if a port wished to make use of it. >> >> rc.shutdown.d would be a self-documenting name. rcK.d doesn't mean >> anything to me. (K=kill?? I don't come from a Solaris background.) > >Yep, Knnscriptname generally means "this is a shutdown script, invoke >me as scriptname stop". rc.shutdown.d would be fine, the examples I >provided were merely a rough idea. >> >> It would save people from hacking /etc/rc.shutdown (like rc.d saves >> hacking /etc/rc.local). I believe someone pointed this out already, but there's no need to make any new rc*.d directories. So long as the scripts in /usr/local/etc/rc.d are written to accept start & stop parameters the way SysVinit /etc/init.d/ scripts are written. Simply applying the patch below to /etc/rc.shutdown should allow ports to be shutdown cleanly. Should be harmless if /usr/local/etc/rc.d/*.sh scripts do not accept the stop parameter. Better yet rename the current /etc/rc.shutdown to /etc/rc.shutdown.local (analogous to /etc/rc.local) and source it into a new /etc/rc.shutdown which only does the stuff below. BTW, ${local_startup} in /etc/rc.conf becomes rather misnamed if this patch is adopted. --- rc.shutdown.orig Fri Aug 1 20:22:45 1997 +++ rc.shutdown Wed Nov 18 22:10:04 1998 @@ -17,6 +17,23 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin export PATH +# If there is a global system configuration file, suck it in. +if [ -f /etc/rc.conf ]; then + . /etc/rc.conf +fi + +# for each valid dir in $local_startup, search for init scripts matching *.sh +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} ] && \ + (trap 'exit 1' 2 ; ${script} stop ; echo -n) + done + done + echo . +fi + echo -n Shutting down daemon processes: # Insert shutdown procedures here To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?021f01be136c$244d6440$1f40e6cd>