Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc - only perform the checkyesno on the variable named in $...



details:   https://anonhg.NetBSD.org/src/rev/8d67ad2c9cc7
branches:  trunk
changeset: 497103:8d67ad2c9cc7
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Sep 19 13:04:38 2000 +0000

description:
- only perform the checkyesno on the variable named in $rcvar (rather than
  implicitly using $name if $rcvar isn't set), and always perform this check,
  even when using start_cmd (et al).
  this check is performed before the pidcmd
  is run, speeding up scripts that weren't going to be run anyway.
  this should speed up booting slow systems.

- take advantage of the above and remove
        start_precmd="checkyesno foo"
  in scripts that use start_cmd.

- explicitly set rcvar=foo in the rc.d/foo scripts which have an equivalent
  rc.conf entry

- fix `rcvar' and `restart' when $rcvar isn't set.
  these above changes fix PR [bin/11027].

- when doing `force*', ignore the return value of *_precmd.
  this fixes PR [bin/10781].

- rename what sysdb provides from `databases' to `sysdb', to reflect
  the name of the script.

- improve the comments in rc.subr

diffstat:

 etc/rc.d/DAEMON      |    6 +-
 etc/rc.d/accounting  |    5 +-
 etc/rc.d/amd         |    3 +-
 etc/rc.d/apmd        |    3 +-
 etc/rc.d/bootparams  |    3 +-
 etc/rc.d/cleartmp    |    4 +-
 etc/rc.d/cron        |    3 +-
 etc/rc.d/dhclient    |    3 +-
 etc/rc.d/dhcpd       |    3 +-
 etc/rc.d/dhcrelay    |    3 +-
 etc/rc.d/dmesg       |    4 +-
 etc/rc.d/gated       |    3 +-
 etc/rc.d/inetd       |    3 +-
 etc/rc.d/ipfilter    |    8 +-
 etc/rc.d/ipmon       |    3 +-
 etc/rc.d/ipnat       |   10 +--
 etc/rc.d/ipsec       |    9 +-
 etc/rc.d/kdc         |    3 +-
 etc/rc.d/lkm1        |    7 +-
 etc/rc.d/lkm2        |    5 +-
 etc/rc.d/lkm3        |    7 +-
 etc/rc.d/lpd         |    3 +-
 etc/rc.d/mopd        |    3 +-
 etc/rc.d/motd        |    4 +-
 etc/rc.d/mrouted     |    3 +-
 etc/rc.d/named       |    3 +-
 etc/rc.d/nfslocking  |    4 +-
 etc/rc.d/ntpd        |    3 +-
 etc/rc.d/ntpdate     |    4 +-
 etc/rc.d/postfix     |   11 +--
 etc/rc.d/rarpd       |    3 +-
 etc/rc.d/rbootd      |    3 +-
 etc/rc.d/route6d     |    3 +-
 etc/rc.d/routed      |    3 +-
 etc/rc.d/rpcbind     |    3 +-
 etc/rc.d/rtadvd      |    3 +-
 etc/rc.d/rtsold      |    3 +-
 etc/rc.d/rwho        |    3 +-
 etc/rc.d/savecore    |    4 +-
 etc/rc.d/screenblank |    3 +-
 etc/rc.d/sendmail    |   12 ++-
 etc/rc.d/sshd        |    3 +-
 etc/rc.d/sysdb       |    4 +-
 etc/rc.d/syslogd     |    5 +-
 etc/rc.d/timed       |    3 +-
 etc/rc.d/wscons      |    4 +-
 etc/rc.d/xdm         |    3 +-
 etc/rc.d/xfs         |    3 +-
 etc/rc.d/ypbind      |    5 +-
 etc/rc.d/yppasswdd   |    5 +-
 etc/rc.d/ypserv      |    7 +-
 etc/rc.subr          |  167 +++++++++++++++++++++++++++++++++-----------------
 52 files changed, 230 insertions(+), 158 deletions(-)

diffs (truncated from 1455 to 300 lines):

diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/DAEMON
--- a/etc/rc.d/DAEMON   Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/DAEMON   Tue Sep 19 13:04:38 2000 +0000
@@ -1,12 +1,12 @@
 #!/bin/sh
 #
-# $NetBSD: DAEMON,v 1.4 2000/08/21 23:39:07 lukem Exp $
+# $NetBSD: DAEMON,v 1.5 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: DAEMON
-# REQUIRE: accounting aftermountlkm amd cleartmp databases dmesg ipmon
+# REQUIRE: accounting aftermountlkm amd cleartmp dmesg ipmon
 # REQUIRE: ipnat ipsec ldconfig named network nonlocalswap nfslocking
-# REQUIRE: pwcheck quota savecore securelevel sysctl virecover ypbind
+# REQUIRE: pwcheck quota savecore securelevel sysctl sysdb virecover ypbind
 
 #      This is a dummy dependancy, to ensure that general purpose daemons
 #      are run _after_ the above are.
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/accounting
--- a/etc/rc.d/accounting       Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/accounting       Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: accounting,v 1.2 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: accounting,v 1.3 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: accounting
@@ -9,9 +9,8 @@
 . /etc/rc.subr
 
 name="accounting"
-start_precmd="checkyesno accounting"
+rcvar=$name
 start_cmd="accounting_start"
-stop_precmd=$start_precmd
 stop_cmd="accounting_stop"
 
 accounting_start()
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/amd
--- a/etc/rc.d/amd      Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/amd      Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: amd,v 1.5 2000/06/02 22:54:11 fvdl Exp $
+# $NetBSD: amd,v 1.6 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: amd
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="amd"
+rcvar=$name
 command="/usr/sbin/${name}"
 load_rc_config $name
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/apmd
--- a/etc/rc.d/apmd     Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/apmd     Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: apmd,v 1.3 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: apmd,v 1.4 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: apmd
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="apmd"
+rcvar=$name
 command="/usr/sbin/${name}"
 
 load_rc_config $name
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/bootparams
--- a/etc/rc.d/bootparams       Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/bootparams       Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: bootparams,v 1.4 2000/06/02 22:54:11 fvdl Exp $
+# $NetBSD: bootparams,v 1.5 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: bootparams
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="bootparamd"
+rcvar=$name
 command="/usr/sbin/rpc.${name}"
 required_files="/etc/bootparams"
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/cleartmp
--- a/etc/rc.d/cleartmp Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/cleartmp Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: cleartmp,v 1.2 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: cleartmp,v 1.3 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: cleartmp
@@ -9,8 +9,8 @@
 . /etc/rc.subr
 
 name="cleartmp"
+rcvar="clear_tmp"
 start_cmd="cleartmp_start"
-start_precmd="checkyesno clear_tmp"
 stop_cmd=":"
 
 cleartmp_start()
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/cron
--- a/etc/rc.d/cron     Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/cron     Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: cron,v 1.4 2000/07/17 15:24:48 lukem Exp $
+# $NetBSD: cron,v 1.5 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: cron
@@ -10,6 +10,7 @@
 . /etc/rc.subr
 
 name="cron"
+rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/dhclient
--- a/etc/rc.d/dhclient Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/dhclient Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: dhclient,v 1.6 2000/07/26 00:11:49 lukem Exp $
+# $NetBSD: dhclient,v 1.7 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: dhclient
@@ -13,6 +13,7 @@
 . /etc/rc.subr
 
 name="dhclient"
+rcvar=$name
 command="/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/dhcpd
--- a/etc/rc.d/dhcpd    Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/dhcpd    Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: dhcpd,v 1.3 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: dhcpd,v 1.4 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: dhcpd
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="dhcpd"
+rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 required_files="/etc/${name}.conf /var/db/${name}.leases"
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/dhcrelay
--- a/etc/rc.d/dhcrelay Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/dhcrelay Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: dhcrelay,v 1.3 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: dhcrelay,v 1.4 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: dhcrelay
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="dhcrelay"
+rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/dmesg
--- a/etc/rc.d/dmesg    Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/dmesg    Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: dmesg,v 1.4 2000/07/26 00:11:49 lukem Exp $
+# $NetBSD: dmesg,v 1.5 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: dmesg
@@ -9,7 +9,7 @@
 . /etc/rc.subr
 
 name="dmesg"
-start_precmd="checkyesno dmesg"
+rcvar=$name
 start_cmd="do_dmesg"
 stop_cmd=":"
 
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/gated
--- a/etc/rc.d/gated    Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/gated    Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: gated,v 1.3 2000/05/13 08:45:06 lukem Exp $
+# $NetBSD: gated,v 1.4 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: gated
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 
 name="gated"
+rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 required_files="/etc/${name}.conf"
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/inetd
--- a/etc/rc.d/inetd    Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/inetd    Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: inetd,v 1.5 2000/07/17 15:24:48 lukem Exp $
+# $NetBSD: inetd,v 1.6 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: inetd
@@ -10,6 +10,7 @@
 . /etc/rc.subr
 
 name="inetd"
+rcvar=$name
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 required_files="/etc/${name}.conf"
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/ipfilter
--- a/etc/rc.d/ipfilter Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/ipfilter Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ipfilter,v 1.6 2000/07/21 01:14:23 lukem Exp $
+# $NetBSD: ipfilter,v 1.7 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: ipfilter
@@ -9,9 +9,10 @@
 . /etc/rc.subr
 
 name="ipfilter"
+rcvar=$name
 start_precmd="ipfilter_prestart"
 start_cmd="ipfilter_start"
-stop_precmd="checkyesno ipfilter && [ -f /etc/ipf.conf ]"
+stop_precmd="test -f /etc/ipf.conf"
 stop_cmd="ipfilter_stop"
 reload_precmd="$stop_precmd"
 reload_cmd="ipfilter_reload"
@@ -21,9 +22,6 @@
 
 ipfilter_prestart()
 {
-       if ! checkyesno ipfilter; then
-               return 1
-       fi
        if [ ! -f /etc/ipf.conf ]; then
                warn "/etc/ipf.conf not readable; ipfilter start aborted."
                        #
diff -r 687781bb0999 -r 8d67ad2c9cc7 etc/rc.d/ipmon
--- a/etc/rc.d/ipmon    Tue Sep 19 11:11:50 2000 +0000
+++ b/etc/rc.d/ipmon    Tue Sep 19 13:04:38 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ipmon,v 1.2 2000/05/13 08:45:07 lukem Exp $
+# $NetBSD: ipmon,v 1.3 2000/09/19 13:04:38 lukem Exp $
 #
 
 # PROVIDE: ipmon
@@ -9,6 +9,7 @@
 . /etc/rc.subr
 



Home | Main Index | Thread Index | Old Index