Home | History | Annotate | only in /src/etc/rc.d
History log of /src/etc/rc.d
RevisionDateAuthorComments
 1.1 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.6 19-Apr-2001  lukem s/dependancy/dependency/. require NETWORK and SERVERS instead of network
 1.5 19-Sep-2000  lukem - 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
 1.4 21-Aug-2000  lukem sort lines. add nonlocalswap, securelevel
 1.3 20-Jul-2000  lukem reword description
 1.2 13-Jun-2000  itojun branches: 1.2.2;
add rc.d/ipsec for ipsec configuration. when enabled, it will inject
/etc/ipsec.conf into "setkey -f". PR 9609.
 1.1 13-Mar-2000  lukem branches: 1.1.2;
* replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.2.3 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2.2.2 23-Aug-2000  lukem pull up rev 1.4:
- sort REQUIRE entries
- REQUIRE nonlocalswap, securelevel

approved: thorpej
 1.2.2.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.1 21-Apr-2009  joerg branches: 1.1.2;
Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.1.2.2 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.2.1 21-Apr-2009  jym file DISKS was added on branch jym-xensuspend on 2009-05-13 19:18:03 +0000
 1.8 02-Mar-2022  gutteridge LOGIN: fix typo in description
 1.7 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.6 19-Apr-2001  lukem s/dependancy/dependency/. explicitly require DAEMON
 1.5 06-Apr-2001  wiz Remove references to gated, except the conflict check in rc.d/routed.
Noted by Launey Thomas <ljt@alum.mit.edu>.
 1.4 21-Aug-2000  lukem sort REQUIRE lines
 1.3 20-Jul-2000  lukem reword description
 1.2 02-May-2000  augustss branches: 1.2.4;
s/xntpd/ntpd/
 1.1 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.2.4.2 23-Aug-2000  lukem pull up rev 1.4:
sort `REQUIRE' entries

approved: thorpej
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.1 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.119 29-Dec-2024  jmmv Don't install /etc/rc.d/postfix when MKPOSTFIX=no
 1.118 27-Sep-2023  riastradh branches: 1.118.2;
/etc/rc.d/cerctl_init: New script for certctl rehash in live images.

This is very limited -- it does not supplant postinstall to rehash
certificates on upgrade; it only runs certctl rehash if
/etc/openssl/certs is an empty directory, as you get in live images
not created with sysinst.

We could also have a more general-purpose way to run postinstall(8)
on first boot of an image, but that has a lot more moving parts to
think about, so let's start with this limited-scope low-risk
approach.

PR install/57629

XXX pullup-10
 1.117 03-Feb-2023  mlelstv Add start script to attach iscsi volumes at boot.

The default is to execute the script (iscsid_volumes=YES), so if you have
any volumes defined, you should also start iscsid (iscsid=YES) to avoid
error messages.
 1.116 06-Jun-2022  nia branches: 1.116.2;
build system: Revert all the recent additions of MK[...] knobs that
allow conditionally disabling the building of certain user space
programs in the 'base' set.

There is not enough consensus that this is the right way and a few
people had strong objections, see source-changes-d@.
 1.115 29-May-2022  nia mk: Add a MKPPP flag to exclude pppd(8) and related utilities from
the build
 1.114 28-May-2022  nia mk: Add MKNTP, MKTCPDUMP knobs.
 1.113 25-May-2022  nia mk: Rename the MKMBONE option to MKMROUTING for greater accuracy and
to match the related kernel config option.
 1.112 25-May-2022  nia mk: Allow building base without the MBONE applications by setting
MKMBONE=no in mk.conf
 1.111 26-Jan-2021  martin llvmlockdir -> lvmlockdir
 1.110 10-Jan-2021  riastradh Various entropy integration improvements.

- New /etc/security check for entropy in daily security report.

- New /etc/rc.d/entropy script runs (after random_seed and rndctl) to
check for entropy at boot -- in rc.conf, you can:

. set `entropy=check' to halt multiuser boot and enter single-user
mode if not enough entropy

. set `entropy=wait' to make multiuser boot wait until enough entropy

Default is to always boot without waiting -- and rely on other
channels like security report to alert the operator if there's a
problem.

- New man page entropy(7) discussing the higher-level concepts and
system integration with cross-references.

- New paragraph in afterboot(8) about entropy citing entropy(7) for
more details.

This change addresses many of the issues discussed in security/55659.
This is a first draft; happy to take improvements to the man pages and
scripted messages to improve clarity.

I considered changing motd to include an entropy warning with a
reference to the entropy(7) man page, but it's a little trickier:
- Not sure it's appropriate for all users to see at login rather than
users who have power to affect the entropy estimate (maybe it is,
just haven't decided).
- We only have a mechanism for changing once at boot; the message would
remain until next boot even if an operator adds enough entropy.
- The mechanism isn't really conducive to making a message appear
conditionally from boot to boot.
 1.109 08-Sep-2020  martin Sort - no functional change
 1.108 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.107 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.106 18-Sep-2019  nonaka Moved zfs out of MKX11 block.

Fix build failure without X11.
 1.105 15-Sep-2019  brad Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.104 12-May-2019  kre branches: 1.104.2;

No change... Previous log message should have said:

Install rc.d/smtoff
 1.103 12-May-2019  kre install rc.d
 1.102 25-Apr-2019  roy Fix build, install wsmoused
 1.101 25-Apr-2019  roy Don't install YP rc.d files with MKYP=no
 1.100 10-Apr-2019  sevan Include npf_boot rc.d scripts which loads an interim config early in boot.
By default /etc/default/npf.boot.conf which can be overriden by /etc/npf.boot.conf.
 1.99 23-Sep-2018  maxv Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
 1.98 29-Jun-2018  roy Remove dhclient from the base system.

Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
 1.97 17-Feb-2018  uwe branches: 1.97.2; 1.97.4;
Actually install dhcpd6 rc script. Organize CONFIGFILES
alphabetically again while where.

PR 53018
 1.96 09-Jan-2018  christos Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
 1.95 05-Jan-2017  christos branches: 1.95.6;
add scripts for npfd
 1.94 13-Dec-2015  christos branches: 1.94.2;
Add ip6addrctl
 1.93 30-Mar-2015  chopps Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
 1.92 21-Mar-2015  jmcneill Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
 1.91 21-Feb-2015  joerg Add rc script for /sbin/iscsid.
 1.90 11-Sep-2014  roy Don't try and install rc.d/rtsold
 1.89 16-May-2013  yamt branches: 1.89.6;
try to sync lists of rc.d scripts
 1.88 07-Feb-2012  joerg branches: 1.88.6;
Import the new apropos/whatis.

This code has been developed by Abhinav Upadhyay as part of Google's Summer
of Code 2011. It uses libmandoc to parse man pages and builds a Full
Text Index in a SQLite database. The combination of indexing the full
manual page, filtering out stop words and ranking individual matches
based on the section gives a much improved user experience.

The old makewhatis and friends are kept under MKMAKEMANDB=no for now.
 1.87 17-Dec-2011  tsutsui Add an rc.d(8) script for isibootd(8). Taken from ndbootd(8).
 1.86 23-Nov-2011  tls Load entropy at system boot (only works at securelevel < 1); save
at system shutdown. Disable with random_seed=NO in rc.conf if desired.

Goes to some trouble to never load or save to network filesystems.

Entropy should really be loaded by the boot loader but I am still
sorting out how to pass it to the kernel.
 1.85 06-Sep-2011  riz branches: 1.85.2;
Create and install an rc.d file for devpubd - a daemon to listen
on drvctl and autocreate device nodes in /dev for those which don't have any.
Set the default to "NO" for now.
 1.84 27-May-2011  plunky provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.83 18-Feb-2011  jmcneill Add rc.d script to make sure the system fontconfig cache is up to date.
 1.82 02-Feb-2011  rmind NPF checkpoint:
- Add libnpf(3) - a library to control NPF (configuration, ruleset, etc).
- Add NPF support for ftp-proxy(8).
- Add rc.d script for NPF.
- Convert npfctl(8) to use libnpf(3) and thus make it less depressive.
Note: next clean-up step should be a parser, once dholland@ will finish it.
- Add more documentation.
- Various fixes.
 1.81 13-Jan-2011  kefren branches: 1.81.2;
add ldpd rc script
 1.80 29-Sep-2009  tsarna Multicast DNS ("Bonjour") support, based on Apple's mDNSResponder.
 1.79 25-Jul-2009  mbalmer Document recent gpio(4) changes and introduce a new config file for GPIO.
Integrate with the startup scripts in /etc/rc.d. Introduce new variable
"gpio" for /etc/rc.conf.
 1.78 28-Apr-2009  roy Add an rc.d script for dhcpcd(8)
 1.77 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.76 15-Apr-2009  joerg Add a small script to visualize the rc dependency graph and point to it.
 1.75 16-Jan-2009  haad branches: 1.75.2;
Add lvm rc.d script to build.
 1.74 08-Jan-2009  lukem attempt to make the NOTE a bit more prominent
 1.73 04-Jan-2009  apb * Add etc/rc.d/rndctl script, based on work by Brian A. Seklecki. This
allows you to invoke rndctl(8) during the boot.
* Add rndctl=NO and rndctl_flags="" to /etc/defaults/rc.conf.
* Document rndctl and rndctl_flags variables in rc.conf(5).
 1.72 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.71 11-Dec-2008  mishka Import rc.d/httpd script for httpd(8) daemon control.
See rc.conf(5) for options explanation.
 1.70 05-Dec-2008  cube - Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.69 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.68 18-Jun-2008  yamt branches: 1.68.2;
merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@. requested by core@
 1.67 15-Apr-2008  plunky branches: 1.67.2; 1.67.4;
some changes to serial bluetooth host controller interfaces

btuartd(8) should be named btattach(8) for consistency
with other parts of NetBSD

make btattach(8) a single-use tool for less complexity

device specicific initialisation (from btuart(4)) is carried
out prior to activating the line discipline (in btattach(8)),
which simplifies the API somewhat and means that the user
tool and the kernel do not need to be kept in sync.

btuart(4) driver is much reduced; naming is made consistent
and all tsleep() and delay() are removed to userland
 1.66 14-Jul-2007  ad branches: 1.66.8; 1.66.12;
fixsb has done its job.
 1.65 01-Jul-2007  xtraeme Add the /etc/rc.d/envsys script required by envsys2.
 1.64 20-Feb-2007  briggs Install sys/dev/bluetooth/btuart.h.
Descend into and build/install usr.sbin/btuartd.
Install etc/rc.d/btuartd.
 1.63 04-Feb-2007  xtraeme Install the perusertmp file.
 1.62 07-Oct-2006  rpaulo PR 34692: wpa_supplicant script.
By Jukka Salmi.
 1.61 13-Aug-2006  plunky rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.60 07-Aug-2006  dyoung branches: 1.60.2;
Per lukem's request, revert previous change which skipped installation
of /etc/rc.d/ipfilter and family if MKIPFILTER=no. As lukem points
out, skipping installation of etc/rc.d/ scripts is not inconsistent
with other optional components, such as pf, x11, etc.
 1.59 05-Aug-2006  dyoung Only install ipfilter, ipfs, ipmon, and ipnat if MKIPFILTER=no.
 1.58 26-Jul-2006  tron Bluetooth fixes by Iain Hibbert:
Create "/etc/rc.d/btcontrol" to attach bluetooth devices at boot.
 1.57 19-Jun-2006  gdamore Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.56 30-May-2006  christos Remove sendmail (approved by core)
 1.55 14-May-2006  simonb In the rc.d file list, start a new line for each first letter of
the rc.d scripts. Indent by an extra tab to match indentation of
usr.sbin/postinstall/postinstall
 1.54 30-Apr-2006  rpaulo add missing files
 1.53 08-Feb-2006  agc Add distribution entries and supporting files for the iSCSI target.
 1.52 23-Aug-2005  peter pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.

Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.

No objections on: tech-security
 1.51 04-Aug-2005  peter Add the new ftpd rc.d script.
 1.50 17-Apr-2005  lukem Tweaks for the move of postinstall from /etc to /usr/sbin
 1.49 30-Jun-2004  tron branches: 1.49.2;
Install "pf" and "pflogd".
 1.48 16-May-2004  lukem Consistently use CONFIGFILES & CONFIGLINKS (which enable the 'configinstall'
target) instead of using home-grown 'distribution' targets or using
FILES with the 'install' target.
Add some etc/ subdir Makefiles where appropriate.

XXX: some of etc/Makefile install-etc-files could be converted to CONFIGFILES.
 1.47 18-Apr-2004  dbj enable rc.d fixsb script
initial testing suggests that it is working and I am confident it
will not cause irrevocable damage
 1.46 01-Feb-2004  christos branches: 1.46.2;
add identd
 1.45 14-Jan-2004  jmmv Add the veriexec rc.d script.
 1.44 27-Dec-2003  martin Add rtclocaltime.
 1.43 26-Dec-2003  lukem Revert part of previous; etc/rc.d/kdc must be installed even if Kerberos
isn't enabled.
This is how the rc.d system works in conjunction with our current build
and install system; all the rc.d scripts are installed even if the
subsystems they control are not.
 1.42 11-Dec-2003  dyoung Fix the checkflist for builds without Kerberos 4 (MKKERBEROS4=no)
and without Kerberos 4 & 5 (MKKERBEROS=no). Previously checkflist
complained of missing files.

* move kerberos- and kerberos 4-only files into new flists,
distrib/sets/lists/*/krb.*

* make the flist generators grok MKKERBEROS{,4} variables

* fix Makefiles which treat MKKERBEROS=no as MKKERBEROS5=no.
9 out of 10 experts agree that it is ludicrous to build w/
KERBEROS4 and w/o KERBEROS5.

* fix header files, also, which treat MKKERBEROS=no as MKKERBEROS5=no.

* omit some Kerberos-only subdirectories from the build as
MKKERBEROS{,4} indicate

(I acknowledge the sentiment that flists are the wrong way to go,
and that the makefiles should produce the metalog directly. That
sounds to me like the right way to go, but I am not prepared to do
revamp all the makefiles. While my approach is expedient, it fits
painlessly within the current build architecture until we are
delivered from flist purgatory, and it does not postpone our
delivery. Fair enough?)
 1.41 18-Apr-2003  thorpej Add an rc script for powerd(8).
 1.40 24-Mar-2003  atatat Tweak postinstall to check for (and help out on) the upgrade to
sendmail 8.12.8. Some of the same machinery (in shorter form) is in
the additions to rc.d/sendmail. Also, add a smmsp startup script for
the sendmail client queue runner.
 1.39 16-Jan-2003  martti Back out previous (as discussed with releng). The correct way to set this is:

# echo "myserver" > /var/yp/binding/`domainname`.ypservers
 1.38 16-Jan-2003  martti Script to bind a NIS client to a known server.

$ grep yp /etc/rc.conf
ypbind=YES
ypbind_flags="-ypset"
ypset=YES
ypset_flags="myserver"
 1.37 10-Jan-2003  yamt in comment, metion about src/distrib/sets/lists/etc/mi as well.
 1.36 09-Jan-2003  christos add staticroute
 1.35 09-Oct-2002  elric Added cgd rc.d script and put it in the appropriate postinstall and
mtree files.
 1.34 03-Sep-2002  abs Split raidframe parity checking/rebuild out into raidframeparity, which is
called after quota so we don't end up with fsck and raidframe parity rebuild
taking forever after a crash/reboot.
While we are here check for raid[0-9].conf & raid[1-9][0-9].conf not
raid[0-9].conf & raid[0-9][0-9].conf
 1.33 27-Aug-2002  takemura Added touch panel calibration utility.
 1.32 30-Jul-2002  thorpej Add a wdogctl startup/shutdown script.
 1.31 03-Jul-2002  yamt add comment:
"if you're adding new scripts, don't forget to update
src/etc/postinstall and src/etc/mtree/special."
 1.30 29-Jun-2002  grant add wsmoused.
 1.29 02-Jun-2002  jmcneill Add mixerctl script.
 1.28 24-Apr-2002  lukem branches: 1.28.2;
- in <bsd.files.mk>, don't clear FILES after using it, as that prevents
make -V FILES
from being useful (and given that every other variable can be
extracted using make -V, the behaviour was unusually inconsistent
given that the original reason for clearing it doesn't seem to be
relevant anymore)
- use <bsd.prog.mk> instead of directly including <bsd.files.mk>
(and possibly <bsd.man.mk> or <bsd.own.mk>)
- remove obsolete NOPROG
 1.27 11-Feb-2002  lukem don't forget to install ipfs...
 1.26 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.25 12-Dec-2001  lukem - set NOPROG before .include <bsd.own.mk>
- reformat FILES= lines for easier future additions
 1.24 10-Dec-2001  martin Add rc.d support for ifwatchd (used to run ip-up/ip-down scripts for
in-kernel pppoe interfaces).
 1.23 29-Oct-2001  augustss Add moused, default off.
 1.22 08-Sep-2001  martin Add downinterfaces. Noticed by Thomas Klausner.
 1.21 23-May-2001  fredette sunndd has been renamed ndbootd.
 1.20 21-May-2001  enami Install the file sunndd.
 1.19 05-Apr-2001  thorpej Add a startup script for altqd(8).
 1.18 05-Apr-2001  wiz Don't install /etc/rc.d/gated any longer, since gated isn't in the
base system.
 1.17 18-Jan-2001  thorpej Startup script for racoon(8). Racoon provides "ike", and requires
"kdc" (since you might want to use IPsec on your Kerberos server,
and might be using GSSAPI to authenticate Phase 1) and "ppp" (since
racoon(8) needs to know about all of your network interfaces).
 1.16 14-Jan-2001  minoura Add /etc/rc.d/poffd, for x68k power management deamon.
 1.15 07-Jan-2001  martin Don't fiddle with any isdn interface if the isdnd variable is set to NO
in rc.conf.

Actually do install the isdnd script.
 1.14 28-Sep-2000  thorpej Always install sshd.
 1.13 21-Sep-2000  ad Provide the option of running newsyslog at boot time; mainly for laptop
people.
 1.12 21-Aug-2000  lukem convert fsck.sh -> fsck (using kill -TERM $$ to stop autoboot).
 1.11 10-Aug-2000  thorpej Need bsd.own.mk
 1.10 06-Aug-2000  thorpej Startup script glue for the Heimdal KDC.
 1.9 31-Jul-2000  jwise An sshd startup script for use with usr.bin/sshd. Installation is conditional
on ${SSHDIST}, as with usr.bin/ssh itself.

This script includes a `keygen' target for regenerating RSA and DSA host keys,
and invokes this if these keys are not present when sshd is started up.
 1.8 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.7 13-Jun-2000  itojun branches: 1.7.2;
add rc.d/ipsec for ipsec configuration. when enabled, it will inject
/etc/ipsec.conf into "setkey -f". PR 9609.
 1.6 02-Jun-2000  fvdl * Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.5 03-May-2000  joda branches: 1.5.2;
xntpd -> ntpd
 1.4 26-Apr-2000  thorpej Provide rc.d support for the Postfix mail system. Committed to the
base because there is no support for packages in rc.d, and Postfix
is supposed to become part of the base system anyhow.
 1.3 16-Apr-2000  thorpej nfsiod script is gone.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.2.5 07-Mar-2002  he Pull up revision 1.27 (via patch, requested by seb):
Added ipfs to save state tables. Use -D for ipmon.
 1.7.2.4 29-Sep-2000  thorpej Always install the sshd script.
 1.7.2.3 23-Aug-2000  lukem pull up the following:
etc/rc.d/Makefile 1.12
etc/rc.d/fsck 1.1
etc/rc.d/fsck.sh REMOVE
replace fsck.sh with fsck (using kill -TERM $$ to stop autoboot).

approved: thorpej
 1.7.2.2 09-Aug-2000  lukem pull up revs 1.8-1.9
approved by: thorpej

- add NETWORK, sshd
- remove systemfs
 1.7.2.1 06-Aug-2000  thorpej Update from trunk:
Startup script glue for the Heimdal KDC.
 1.28.2.2 30-Nov-2002  he Pull up revision 1.34 (requested by abs in ticket #772):
Split raidframe parity checking/rebuilding out into
raidframeparity, which is called after quota, so we don't
end up with fsck and raidframe parity rebuild taking forever
after a crash/reboot.
While here, check for raid[0-9].conf and raid[1-9][0-9].conf
and not raid[0-9].conf and raid[0-9][0-9].conf
 1.28.2.1 11-Nov-2002  he Pull up revision 1.32 (via patch, requested by thorpej in ticket #584):
Add a wdogctl startup/shutdown script.
 1.46.2.1 27-Apr-2004  jdc Pull up revision 1.47 (requested by dbj in ticket #185)

Fix problems related to superblock upgrade issues which may be
experienced by -current users from 2003.
 1.49.2.2 02-Sep-2005  tron Pull up following revision(s) (requested by peter in ticket #717):
usr.sbin/pf/man/man5/pf.boot.conf.5: revision 1.1
usr.sbin/postinstall/postinstall: revision 1.4
etc/rc.d/pf: revision 1.6
etc/rc.d/pf_boot: revision 1.1
usr.sbin/pf/etc/defaults/pf.boot.conf: revision 1.1
usr.sbin/pf/Makefile: revision 1.7
etc/rc.d/Makefile: revision 1.52
etc/mtree/special: revision 1.89
usr.sbin/pf/man/man5/Makefile: revision 1.5
usr.sbin/pf/etc/defaults/Makefile: revision 1.1
pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.
Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.
No objections on: tech-security
 1.49.2.1 20-Apr-2005  tron Pull up revision 1.50 (requested by lukem in ticket #168):
Tweaks for the move of postinstall from /etc to /usr/sbin
 1.60.2.1 07-Sep-2006  tron Pull up following revision(s) (requested by plunky in ticket #81):
usr.sbin/postinstall/postinstall: revision 1.23
distrib/sets/lists/man/mi: revision 1.919
distrib/sets/lists/etc/mi: revision 1.174
usr.sbin/btdevctl/btdevctl.c: revision 1.1
usr.sbin/btdevctl/hid.c: revision 1.1
usr.sbin/Makefile: revision 1.217
usr.sbin/btdevctl/btdevctl.h: revision 1.1
usr.sbin/btdevctl/btdevctl.8: revision 1.1
etc/rc.d/btcontrol: file removal
distrib/sets/lists/comp/mi: revision 1.910
etc/rc.d/Makefile: revision 1.61
usr.sbin/btdevctl/cfg.c: revision 1.1
usr.sbin/btdevctl/dev.c: revision 1.1
share/man/man4/btkbd.4: revision 1.2
share/man/man4/bthidev.4: revision 1.4
usr.sbin/btcontrol/hid.c: file removal
usr.sbin/btdevctl/Makefile: revision 1.1
share/man/man4/btsco.4: revision 1.3
distrib/sets/lists/base/mi: revision 1.644
share/man/man4/btdev.4: revision 1.3
share/man/man4/btms.4: revision 1.2
etc/mtree/special: revision 1.100
share/man/man5/rc.conf.5: revision 1.105
usr.sbin/btcontrol/cfg.c: file removal
etc/rc.d/btdevctl: revision 1.1
etc/defaults/rc.conf: revision 1.80
usr.sbin/btcontrol/btcontrol.h: file removal
usr.sbin/btcontrol/btcontrol.8: file removal
usr.sbin/btcontrol/dev.c: file removal
usr.sbin/btcontrol/btcontrol.c: file removal
usr.sbin/btcontrol/Makefile: file removal
rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.66.12.4 17-Jan-2009  mjf Sync with HEAD.
 1.66.12.3 29-Jun-2008  mjf Sync with HEAD.
 1.66.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.66.12.1 21-Feb-2008  mjf Start where the mjf-devfs branch left off.
 1.66.8.1 18-Feb-2008  mjf Add some devfs code that's been sitting in my local tree for a while.

devfsd(8) is now the first daemon to be started after init(8). It tracks
device insertion (will eventually track removal) and devfs mounts.

Currently, we can mount multiple device file systems and have device
special files pushed into the mounts automatically, though, the device
special files aren't created with the correct major/minor number pairs
yet.

More work to come soon.
 1.67.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.67.2.1 14-Jun-2008  peter add ftp proxy rc.d script.
 1.68.2.4 10-May-2009  snj Pull up following revision(s) (requested by roy in ticket #534):
etc/defaults/rc.conf: revision 1.103
etc/rc.d/Makefile: revision 1.78 via patch
etc/rc.d/dhcpcd: revision 1.1
Add an rc.d script for dhcpcd(8)
 1.68.2.3 06-Feb-2009  snj branches: 1.68.2.3.4;
Pull up following revision(s) (requested by apb in ticket #406):
etc/defaults/rc.conf: revision 1.99
etc/rc.d/Makefile: revision 1.73
etc/rc.d/rndctl: revision 1.1
share/man/man5/rc.conf.5: revision 1.127
* Add etc/rc.d/rndctl script, based on work by Brian A. Seklecki. This
allows you to invoke rndctl(8) during the boot.
* Add rndctl=NO and rndctl_flags="" to /etc/defaults/rc.conf.
* Document rndctl and rndctl_flags variables in rc.conf(5).
 1.68.2.2 22-Jan-2009  snj Pull up following revision(s) (requested by rafal in ticket #297):
distrib/sets/lists/etc/mi: revision 1.203
doc/CHANGES: revision 1.1151 via patch
etc/defaults/rc.conf: revision 1.97
etc/mtree/special: revision 1.123
etc/rc.d/Makefile: revision 1.71
etc/rc.d/httpd: revision 1.1
share/man/man5/rc.conf.5: revision 1.123
usr.sbin/postinstall/postinstall: revision 1.80
Import rc.d/httpd script for httpd(8) daemon control.
See rc.conf(5) for options explanation.
 1.68.2.1 06-Dec-2008  snj Pull up following revision(s) (requested by cube in ticket #168):
etc/rc.d/Makefile: revision 1.70
etc/rc.d/xdm: file removal
etc/rc.d/xfs: file removal
etc/rc.d/xfs.in: revision 1.1
etc/rc.d/xdm.in: revision 1.1
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.68.2.3.4.1 21-Apr-2010  matt sync to netbsd-5
 1.75.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.81.2.2 05-Mar-2011  bouyer Sync with HEAD
 1.81.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.85.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.85.2.1 17-Apr-2012  yamt sync with head
 1.88.6.1 23-Jun-2013  tls resync from head
 1.89.6.2 06-Aug-2015  snj Pull up following revision(s) (requested by skrll in ticket #909):
distrib/sets/lists/etc/mi: revision 1.237
distrib/sets/lists/tests/mi: revision 1.613
distrib/utils/embedded/conf/armv7.conf: revisions 1.1, 1.2
distrib/utils/embedded/conf/beagleboard.conf: delete
distrib/utils/embedded/conf/evbarm.conf: revisions 1.21, 1.22
distrib/utils/embedded/conf/rpi.conf: revisions 1.28, 1.29
distrib/utils/embedded/conf/rpi_inst.conf: revisions 1.7, 1.8
distrib/utils/embedded/conf/usermode.conf: revision 1.5
distrib/utils/embedded/conf/x86.conf: revision 1.5
distrib/utils/embedded/files/resize_disklabel: revision 1.1
distrib/utils/embedded/mkimage: revisions 1.49, 1.55-1.59
etc/defaults/rc.conf: revision 1.133
etc/etc.evbarm/Makefile.inc: revisions 1.72, 1.76
etc/rc.d/Makefile: revision 1.93 via patch
etc/rc.d/resize_root: revisions 1.1-1.3
etc/rc.d/root: revision 1.5
sbin/resize_ffs/Makefile: revision 1.5
sbin/resize_ffs/resize_ffs.8: revisions 1.14-1.16
sbin/resize_ffs/resize_ffs.c: revisions 1.39-1.44
share/man/man5/rc.conf.5: revision 1.158, 1.159
tests/sbin/resize_ffs/Makefile: revision 1.4
tests/sbin/resize_ffs/common.sh: revision 1.14
tests/sbin/resize_ffs/t_check.sh: revision 1.1
tests/sbin/resize_ffs/t_grow.sh: revision 1.9
tests/sbin/resize_ffs/t_grow_swapped.sh: revision 1.3
tests/sbin/resize_ffs/t_shrink.sh: revision 1.8
tests/sbin/resize_ffs/t_shrink_swapped.sh: revision 1.2
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images
--
Make get_dev_size work on regular files too.
--
Use `!= -1' instead of `== 0' out of paranoia.
--
- Add -c to check to see if grow/shrink is required
- Divide by DEV_BSIZE when returning size of file.
- Update manpage
--
New sentence, new line. Sort option descriptions.
--
Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
--
- Add new tests for -c check flag in resize_ffs
--
Bump date for previous.
it's -> its
--
Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().
--
factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.
--
Add support for auto-growing the root partition. Enable it for rpi.img.
--
initialize resize before pulling in board config
--
add KEYWORD: interactive, honour resize_root_flags and
resize_root_postcmd rc vars
--
if the -p flag is specified, display a progress bar while growing the
file-system
--
show resize_ffs progress bar when resizing root partition
--
fix typo in previous; pass -y unconditionally to resize_ffs, not -p
--
Rename beagleboard.img to armv7.img. The new image includes the same
kernels as beagleboard.img plus support for Raspberry Pi 2, ODROID-C1,
Cubieboard2, Cubietruck, Hummingbird A31, and Banana Pi.
--
Properly spell X' name. From X(7):
The X.Org Foundation requests that the following names be
used when
referring to this software:
X
X Window System
X Version 11
X Window System, Version 11
X11
--
Add some documentation:
Tell what this does, and what it expects from conf files
--
Cleanup: make_filesystems is not used any longer, purge remains
--
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.
No more functions from evbarm.conf are used now.
Some variables are still used!
--
define TOOL_MKUBOOTIMAGE for mkimage
--
fix mkubootimage
 1.89.6.1 26-Mar-2015  martin Pull up following revision(s) (requested by jmcneill in ticket #635):
etc/rc.d/Makefile: revision 1.92
distrib/sets/lists/man/mi: revision 1.1497
share/man/man5/Makefile: revision 1.71
etc/defaults/rc.conf: revision 1.132
etc/rc.d/modules: revision 1.1
usr.sbin/postinstall/postinstall: revision 1.190
distrib/sets/lists/etc/mi: revision 1.236
etc/mtree/special: revision 1.152
share/man/man5/modules.conf.5: revision 1.1
Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
 1.94.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.95.6.1 14-May-2019  martin Pull up following revision(s) (requested by maxv in ticket #1265):
etc/rc.d/smtoff: revision 1.1
etc/rc.d/smtoff: revision 1.2
distrib/sets/lists/etc/mi: revision 1.258
etc/rc.d/smtoff: revision 1.3
etc/rc.d/smtoff: revision 1.4
etc/defaults/rc.conf: revision 1.148
etc/rc.d/Makefile: revision 1.103
usr.sbin/postinstall/postinstall: revision 1.226
etc/rc.d/Makefile: revision 1.104
etc/mtree/special: revision 1.167
share/man/man5/rc.conf.5: revision 1.180

Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
install rc.d

No change... Previous log message should have said:
Install rc.d/smtoff

I should know better! Don't rely upon the way the shell implements
pipes. Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)

Remove comment, since there is no parsing anymore.
 1.97.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.97.4.1 10-Jun-2019  christos Sync with HEAD
 1.97.2.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.97.2.1 28-Jul-2018  pgoyette Sync with HEAD
 1.104.2.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.116.2.1 02-Oct-2023  martin Pull up following revision(s) (requested by riastradh in ticket #381):

distrib/utils/embedded/conf/evbarm.conf: revision 1.42
distrib/sets/lists/etc/mi: revision 1.273
etc/rc.d/Makefile: revision 1.118
distrib/utils/embedded/conf/usermode.conf: revision 1.7
etc/rc.d/certctl_init: revision 1.1
distrib/evbarm/liveimage/armimage/rc.conf.armimage: revision 1.2
etc/defaults/rc.conf: revision 1.166
distrib/amd64/liveimage/emuimage/rc.conf.emuimage: revision 1.3
distrib/utils/embedded/conf/x86.conf: revision 1.11
distrib/utils/embedded/conf/evbmips.conf: revision 1.4

/etc/rc.d/cerctl_init: New script for certctl rehash in live images.

This is very limited -- it does not supplant postinstall to rehash
certificates on upgrade; it only runs certctl rehash if
/etc/openssl/certs is an empty directory, as you get in live images
not created with sysinst.

We could also have a more general-purpose way to run postinstall(8)
on first boot of an image, but that has a lot more moving parts to
think about, so let's start with this limited-scope low-risk
approach.

PR install/57629

/etc/rc.d/certctl_init: Default off.
Otherwise in systems without certctl_init=YES, such as systems
installed with sysinst(8) where it's unnecessary because the rehash
has already happened at install time, you'll get spurious warnings.
 1.118.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.3 19-Apr-2001  lukem s/dependancy/dependency/
 1.2 05-Apr-2001  thorpej Add a startup script for altqd(8).
 1.1 26-Jul-2000  lukem branches: 1.1.2;
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.1.2.2 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.1.2.1 26-Jul-2000  lukem file NETWORK was added on branch netbsd-1-5 on 2000-08-09 19:09:38 +0000
 1.2 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.1 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.9 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.8 26-Apr-2001  lukem Treat isdnd interfaces like ppp ones, and REQUIRE isdnd here.
Identified by Patrick Welche on current-users.
 1.7 19-Apr-2001  lukem s/dependancy/dependency/
 1.6 28-Feb-2001  lukem explicitly REQUIRE mountcritremote. sort REQUIRE entries
 1.5 18-Jan-2001  thorpej Depend on "ike".
 1.4 21-Sep-2000  ad Provide the option of running newsyslog at boot time; mainly for laptop
people.
 1.3 06-Aug-2000  thorpej Startup script glue for the Heimdal KDC.
 1.2 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.1 13-Mar-2000  lukem branches: 1.1.4;
* replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1.4.2 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.1.4.1 06-Aug-2000  thorpej Update from trunk:
Startup script glue for the Heimdal KDC.
 1.9 08-Oct-2006  elad PR/31497: Robert Elz: rc.d/accounting should have KEYWORD: shutdown
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.6 29-Apr-2001  lukem kre notes that "echo -n" is superfluous when creating a zero length file
 1.5 25-Apr-2001  lukem - create the default accounting file with a umask of 022.
- set and use $accounting_command (/usr/sbin/accton) and
$accounting_file (/var/account/acct)
- fix spelo in message
 1.4 25-Apr-2001  jdolecek If the accouting file doesn't exist, create it if possible.
Addresses misc/12735 by Robert Elz.
 1.3 19-Sep-2000  lukem - 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
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 02-Oct-2000  lukem pull up rev 1.3 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.3 10-Mar-2003  lukem move altqd slightly later in the boot sequence; as it's in /usr/sbin,
it needs to depend upon mountcritremote, not run before NETWORKING ...
 1.2 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.1 05-Apr-2001  thorpej Add a startup script for altqd(8).
 1.18 01-Mar-2021  christos require NETWORKING otherwise amd can come up before the network is up and
it needs to be able to do DNS.
 1.17 22-Feb-2020  roy Revert unrelated changes to prior
 1.16 22-Feb-2020  roy rc.d/network: improve wording of waiting for DAD to finish
 1.15 25-Feb-2008  tron Don't try to shutdown amd(8) gracefully. It seems to cause problems for
more people than the old (also broken) behavior. This fixes PR bin/36506
and PR bin/38103.
 1.14 23-Apr-2007  tron branches: 1.14.4; 1.14.10; 1.14.12;
Terminate amd(8) gracefully during system shutdown.

This should avoid occasional problems with syncing or unmounting
filesystems on machines which use the automounter. Tested
successfully under NetBSD-i386 3.1_STABLE and 4.0_BETA2.
 1.13 12-Oct-2004  lukem branches: 1.13.2; 1.13.10;
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.12 12-Oct-2004  lukem Implement reload, using "amq -f".
Suggested by Hauke Fath in PR 26589.
 1.11 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.10 29-Apr-2002  lukem branches: 1.10.6;
don't bother warning about obsolete $amd_master; postinstall now does this
 1.9 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.8 17-Jun-2001  lukem Complain if $amd_master is set. This variable was used in 1.5 and prior
releases, but has been ignored since an am-utils update six months ago.
This fixes [misc/11971] submitted by Jun-ichiro itojun Hagino. (Note that
$amd_flags is still supported, contrary to what the PR says).
 1.7 21-Nov-2000  veego The new am-utils use now /etc/amd.conf and no longer the $amd_master file.
Despite that /etc/amd.conf is now the default configuration file, it needs
to be defined if you supply other options when you start amd, so add it here.
 1.6 19-Sep-2000  lukem - 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
 1.5 02-Jun-2000  fvdl branches: 1.5.2;
* Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.4 29-May-2000  tron Call "load_rc_config()" earlier so that configuration variables are read
before command arguments are defined. Fixes PR bin/10220 by Ron Roskens.
 1.3 13-May-2000  lukem branches: 1.3.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 15-Apr-2000  tsarna Death to nfsiod!

It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.2.1 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.10.6.2 09-May-2005  riz Pull up revision 1.13 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.10.6.1 08-May-2005  riz Pull up revision 1.12 (requested by lukem in ticket #1267):
Implement reload, using "amq -f".
Suggested by Hauke Fath in PR 26589.
 1.13.10.2 01-Mar-2008  bouyer Pull up following revision(s) (requested by tron in ticket #1091):
etc/rc.d/amd: revision 1.15
Don't try to shutdown amd(8) gracefully. It seems to cause problems for
more people than the old (also broken) behavior. This fixes PR bin/36506
and PR bin/38103.
 1.13.10.1 28-Apr-2007  bouyer branches: 1.13.10.1.2; 1.13.10.1.4;
Pull up following revision(s) (requested by tron in ticket #590):
etc/rc.d/amd: revision 1.14
Terminate amd(8) gracefully during system shutdown.
This should avoid occasional problems with syncing or unmounting
filesystems on machines which use the automounter. Tested
successfully under NetBSD-i386 3.1_STABLE and 4.0_BETA2.
 1.13.10.1.4.1 01-Mar-2008  bouyer Pull up following revision(s) (requested by tron in ticket #1091):
etc/rc.d/amd: revision 1.15
Don't try to shutdown amd(8) gracefully. It seems to cause problems for
more people than the old (also broken) behavior. This fixes PR bin/36506
and PR bin/38103.
 1.13.10.1.2.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.13.2.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1768):
etc/rc.d/amd: revision 1.14
Terminate amd(8) gracefully during system shutdown.
This should avoid occasional problems with syncing or unmounting
filesystems on machines which use the automounter. Tested
successfully under NetBSD-i386 3.1_STABLE and 4.0_BETA2.
 1.14.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.14.10.1 24-Mar-2008  keiichi sync with head.
 1.14.4.1 23-Mar-2008  matt sync with HEAD
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2 07-Aug-2019  nakayama Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1 09-Jan-2018  christos branches: 1.1.4; 1.1.6;
Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
 1.1.6.1 08-Aug-2019  martin Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 07-Aug-2019  nakayama Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1 09-Jan-2018  christos branches: 1.1.4; 1.1.6;
Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
 1.1.6.1 08-Aug-2019  martin Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 27-Jan-2020  kim Add NetBSD ID
 1.2 07-Aug-2019  nakayama Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1 09-Jan-2018  christos branches: 1.1.4; 1.1.6;
Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
 1.1.6.2 31-Jan-2020  martin Pull up following revision(s) (requested by kim in ticket #675):

etc/rc.d/autounmountd: revision 1.3
etc/rc.d/ip6addrctl: revision 1.4

Add NetBSD ID
 1.1.6.1 08-Aug-2019  martin Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.1.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 25-Dec-2023  kre Clean up obsolete test(1) usage - don't use -o, use sh || instead.

This one was particularly bad:

if [ -z ${dev} -o ${junk} ]; then

was supposed to be validating an entry read from a config file,
dev should be not empty, and junk should be empty (ie: correct
number of fields present). If that test succeeds, the line is
bad, and we error out.

But if dev was empty, and junk was also empty, that turned into

if [ -z -o ]; then

which tests if "-o" is the empty string, which it isn't, so instead
of succeeding, and considering the entry invalid (no dev specified)
the code would just carry on as if all was good.

Because of this, a bunch of quoting fixes were also made (there might
perhaps be more needed).
 1.2 26-Nov-2021  sborrill Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
 1.1 27-May-2011  plunky provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.18 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.17 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.16 04-Jul-2020  skrll Trailing whitespace
 1.15 31-Dec-2012  christos add a sync to make it less likely to boot with /etc pointing to nothing after
a crash.
 1.14 01-Nov-2010  christos branches: 1.14.6; 1.14.12;
From Anon Ymous:
Send the SIGALRM to the correct process when we timeout. See the note
in src/etc/rc regarding RC_PID.

The former code would leave you with a root shell when the prompt
timed out (if the tty is marked secure) while continuing the boot
process in another shell. This was easily hidden if you started
xdm(1) at boot, while the root shell remains on another tty
(accessible with CTL-ALT-F1).
 1.13 12-Sep-2009  apb It's print_rc_metadata, not rc_print_metadata.
 1.12 11-Sep-2009  apb Adapt /etc/rc.d/bootconf.sh script to the new /etc/rc:
Add "KEYWORD: interactive" so that the script's prompts work,
and use rc_print_metadata to add a message to the log.

Part of the /etc/rc silent changes requested in PR 41946
and proposed in tech-userlevel.
 1.11 06-Sep-2009  apb Delete a line that was accidentally included from work in progress.
 1.10 05-Sep-2009  apb Use functions from rc.subr.
 1.9 23-Apr-2006  hubertf When switching the /etc/etc.current symlink, make it relative to /etc,
not absolute.

This affects an update with sysinst, which will try to look at
/targetroot/etc/fstab, which points to /etc/etc.whatever, which is
not there during the upgrade, and results in all (/targetroot)/etc
files getting nuked!
 1.8 11-Oct-2004  christos Use new style command substitution.
 1.7 03-Apr-2003  is Variable substitution happens at trap installation time, not at trap
execution time - so it used to print "Using default configuration of
/etc/passwd".
 1.6 05-Dec-2002  wiz Handle links to absolute paths too. Closes my PR 19125.
 1.5 25-Mar-2002  wiz branches: 1.5.2;
Fix typo in last (which broke the script).
 1.4 24-Mar-2002  lukem - Add sanity checks recommended by Robert Elz in [bin/13871] (with slight mods)
- Use symbolic trap names
 1.3 09-Oct-2000  nisimura Avoid extra command invocation as possible, and use smart variable
substitution instead.
 1.2 21-Aug-2000  lukem `REQUIRE bootconf' in lkm1 rather than `BEFORE beforenetlkm' in bootconf.sh
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem branches: 1.1.1.1.4;
rc.d scripts derived from /etc/rc
 1.1.1.1.4.1 23-Aug-2000  lukem pull up rev 1.2:
`REQUIRE bootconf' in lkm1 rather than `BEFORE beforenetlkm'
in bootconf.sh

approved: thorpej
 1.5.2.1 15-Jun-2003  tron Pull up revision 1.7 (requested by is in ticket #1242):
Variable substitution happens at trap installation time, not at trap
execution time - so it used to print "Using default configuration of
/etc/passwd".
 1.14.12.1 25-Feb-2013  tls resync with head
 1.14.6.1 23-Jan-2013  yamt sync with head
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 19-Sep-2000  lukem - 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
 1.4 02-Jun-2000  fvdl branches: 1.4.2;
* Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.3 13-May-2000  lukem branches: 1.3.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3 18-Jun-2011  plunky remove empty files
 1.2 27-May-2011  plunky branches: 1.2.2;
provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.1 15-Apr-2008  plunky branches: 1.1.6;
some changes to serial bluetooth host controller interfaces

btuartd(8) should be named btattach(8) for consistency
with other parts of NetBSD

make btattach(8) a single-use tool for less complexity

device specicific initialisation (from btuart(4)) is carried
out prior to activating the line discipline (in btattach(8)),
which simplifies the API somewhat and means that the user
tool and the kernel do not need to be kept in sync.

btuart(4) driver is much reduced; naming is made consistent
and all tsleep() and delay() are removed to userland
 1.1.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.1 15-Apr-2008  mjf file btattach was added on branch mjf-devfs2 on 2008-06-02 13:21:20 +0000
 1.2.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3 18-Jun-2011  plunky remove empty files
 1.2 27-May-2011  plunky branches: 1.2.2;
provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.1 19-Jun-2006  gdamore Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.2.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2 13-Aug-2006  plunky rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.1 26-Jul-2006  tron branches: 1.1.2;
Bluetooth fixes by Iain Hibbert:
Create "/etc/rc.d/btcontrol" to attach bluetooth devices at boot.
 1.1.2.1 07-Sep-2006  tron Pull up following revision(s) (requested by plunky in ticket #81):
usr.sbin/postinstall/postinstall: revision 1.23
distrib/sets/lists/man/mi: revision 1.919
distrib/sets/lists/etc/mi: revision 1.174
usr.sbin/btdevctl/btdevctl.c: revision 1.1
usr.sbin/btdevctl/hid.c: revision 1.1
usr.sbin/Makefile: revision 1.217
usr.sbin/btdevctl/btdevctl.h: revision 1.1
usr.sbin/btdevctl/btdevctl.8: revision 1.1
etc/rc.d/btcontrol: file removal
distrib/sets/lists/comp/mi: revision 1.910
etc/rc.d/Makefile: revision 1.61
usr.sbin/btdevctl/cfg.c: revision 1.1
usr.sbin/btdevctl/dev.c: revision 1.1
share/man/man4/btkbd.4: revision 1.2
share/man/man4/bthidev.4: revision 1.4
usr.sbin/btcontrol/hid.c: file removal
usr.sbin/btdevctl/Makefile: revision 1.1
share/man/man4/btsco.4: revision 1.3
distrib/sets/lists/base/mi: revision 1.644
share/man/man4/btdev.4: revision 1.3
share/man/man4/btms.4: revision 1.2
etc/mtree/special: revision 1.100
share/man/man5/rc.conf.5: revision 1.105
usr.sbin/btcontrol/cfg.c: file removal
etc/rc.d/btdevctl: revision 1.1
etc/defaults/rc.conf: revision 1.80
usr.sbin/btcontrol/btcontrol.h: file removal
usr.sbin/btcontrol/btcontrol.8: file removal
usr.sbin/btcontrol/dev.c: file removal
usr.sbin/btcontrol/btcontrol.c: file removal
usr.sbin/btcontrol/Makefile: file removal
rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.6 18-Jun-2011  plunky remove empty files
 1.5 27-May-2011  plunky branches: 1.5.2;
provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.4 23-Jul-2007  plunky branches: 1.4.18;
add requirement for bthcid since devices may need to authenticate
 1.3 10-Sep-2006  plunky branches: 1.3.2; 1.3.4;
update to bluetooth device attachment:

remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
 1.2 14-Aug-2006  plunky branches: 1.2.2;
Fix typo in variable name
 1.1 13-Aug-2006  plunky rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.2.2.2 14-Sep-2006  riz Pull up following revision(s) (requested by plunky in ticket #161):
sys/dev/bluetooth/btdev.h: revision 1.4
distrib/sets/lists/comp/mi: revision 1.922
usr.sbin/postinstall/postinstall: revision 1.25
sys/netbt/hci_unit.c: revision 1.3
sys/netbt/hci_ioctl.c: revision 1.4
usr.sbin/sdpd/profile.c: revision 1.2
usr.sbin/btdevctl/btdevctl.c: revision 1.2
share/man/man4/Makefile: revision 1.405
distrib/sets/lists/man/mi: revision 1.930
distrib/sets/lists/etc/mi: revision 1.176
usr.sbin/sdpd/profile.c: revision 1.3
usr.sbin/btdevctl/btdevctl.c: revision 1.3
etc/MAKEDEV.tmpl: revision 1.62
distrib/sets/lists/base/mi: revision 1.650
usr.sbin/btdevctl/btdevctl.h: revision 1.2
usr.bin/sdpquery/sdpquery.1: revision 1.4
sys/netbt/rfcomm_session.c: revision 1.2
usr.sbin/btdevctl/btdevctl.8: revision 1.3
usr.bin/sdpquery/search.c: revision 1.2
usr.sbin/sdpd/Makefile: revision 1.2
sys/dev/bluetooth/Makefile: revision 1.3
usr.sbin/btdevctl/cfg.c: file removal
sys/netbt/files.netbt: revision 1.4
usr.sbin/btdevctl/sdp.c: revision 1.1
sys/dev/bluetooth/bthidev.c: revision 1.3
etc/bluetooth/Makefile: revision 1.3
sys/dev/pcmcia/files.pcmcia: revision 1.51
sys/dev/bluetooth/bthidev.c: revision 1.4
sys/dev/bluetooth/bthidev.h: revision 1.3
usr.sbin/btdevctl/dev.c: file removal
sys/dev/bluetooth/files.bluetooth: revision 1.10
sys/arch/i386/conf/GENERIC: revision 1.777
share/man/man4/ubt.4: revision 1.6
share/man/man4/bthub.4: revision 1.3
sys/netbt/hci.h: revision 1.5
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.202
lib/libsdp/sdp.h: revision 1.2
usr.sbin/btdevctl/print.c: revision 1.1
share/man/man4/bthidev.4: revision 1.5
share/man/man4/btdev.4: file removal
usr.sbin/btdevctl/print.c: revision 1.2
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.205
usr.sbin/btdevctl/Makefile: revision 1.2
sys/dev/usb/files.usb: revision 1.70
sys/netbt/l2cap_signal.c: revision 1.2
sys/netbt/hci_link.c: revision 1.4
sys/dev/bluetooth/bthub.c: revision 1.3
share/man/man4/btsco.4: revision 1.5
sys/netbt/hci_link.c: revision 1.5
share/man/man4/btdev.4: revision 1.4
sys/dev/bluetooth/btkbd.c: revision 1.3
sys/dev/bluetooth/btdev.c: file removal
sys/netbt/hci_event.c: revision 1.2
sys/dev/bluetooth/btsco.h: revision 1.2
etc/mtree/special: revision 1.101
sys/dev/bluetooth/btsco.c: revision 1.3
sys/conf/majors: revision 1.27
usr.sbin/sdpd/hf.c: revision 1.1
sys/dev/bluetooth/btsco.c: revision 1.4
share/man/man5/rc.conf.5: revision 1.107
sys/dev/bluetooth/btdev.c: revision 1.2
etc/rc.d/btdevctl: revision 1.2
usr.sbin/btdevctl/db.c: revision 1.1
etc/rc.d/btdevctl: revision 1.3
etc/bluetooth/btdevctl.conf: revision 1.1
usr.sbin/btdevctl/hid.c: file removal
sys/arch/i386/conf/GENERIC: revision 1.781
sys/dev/bluetooth/btdev.h: revision 1.3
Make btdev default count explicit
Fix typo in variable name
update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations
add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.
btdevctl(8) and its cache is updated to handle new semantics
etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
also include service name in dictionary being sent to kernel.
(this is not used just yet, but it might be in the future and it will
be easier if we dont have to provide code to handle its absence)
clarify the CAVEAT section somewhat
Add service discovery support for the Handsfree profile
Replace static 'FreeBSD' string with operating system name gleaned
from uname(3)
Halt the callout on detach
btsco.c:
- sco_getopt(..., SO_SCO_MTU, ...) expects the address of a uint16_t,
not an int. So change sc_mtu's type to uint16_t.
- Try a little harder to ensure btsco_round_blocksize() does not
return zero. Prevents a subsequent panic in audio_init_ringbuffer().
from scw@
Endian issues:
hci_event.c:
- Convert memo->response.clock_offset to host-endian.
hci_ioctl.c:
- printf format tweak (size_t)
hci_link.c:
- Convert memo->response.clock_offset from host-endian.
- Tweak a DIAGNOSTIC message.
l2cap_signal.c:
- In l2cap_recv_config_req(), rp->scid is little-endian so make sure
we convert from host-endian.
from scw@
hci_link.c:
- In hci_link_free(), do not unlink items from a LIST queue within
a LIST_FOREACH() iterator.
rfcomm_session.c:
- In rfcomm_session_recv_mcc_nsc(), do not unlink items from a LIST
queue within a LIST_FOREACH() iterator.
from scw@
guard against a possible situation where the list of l2cap channels is changed
when the bluetooth code is not expecting it to be. During a disconnect, we can
detach the channel that is being disconnected, but its not really safe to detach
any others.
Print explicit 64-bit types using the format macros from int_fmtio.h.
Unbreaks the build for our LP64 ports, where "long long" typically is
not 64 bits.
 1.2.2.1 07-Sep-2006  tron Pull up following revision(s) (requested by plunky in ticket #81):
usr.sbin/postinstall/postinstall: revision 1.23
distrib/sets/lists/man/mi: revision 1.919
distrib/sets/lists/etc/mi: revision 1.174
usr.sbin/btdevctl/btdevctl.c: revision 1.1
usr.sbin/btdevctl/hid.c: revision 1.1
usr.sbin/Makefile: revision 1.217
usr.sbin/btdevctl/btdevctl.h: revision 1.1
usr.sbin/btdevctl/btdevctl.8: revision 1.1
etc/rc.d/btcontrol: file removal
distrib/sets/lists/comp/mi: revision 1.910
etc/rc.d/Makefile: revision 1.61
usr.sbin/btdevctl/cfg.c: revision 1.1
usr.sbin/btdevctl/dev.c: revision 1.1
share/man/man4/btkbd.4: revision 1.2
share/man/man4/bthidev.4: revision 1.4
usr.sbin/btcontrol/hid.c: file removal
usr.sbin/btdevctl/Makefile: revision 1.1
share/man/man4/btsco.4: revision 1.3
distrib/sets/lists/base/mi: revision 1.644
share/man/man4/btdev.4: revision 1.3
share/man/man4/btms.4: revision 1.2
etc/mtree/special: revision 1.100
share/man/man5/rc.conf.5: revision 1.105
usr.sbin/btcontrol/cfg.c: file removal
etc/rc.d/btdevctl: revision 1.1
etc/defaults/rc.conf: revision 1.80
usr.sbin/btcontrol/btcontrol.h: file removal
usr.sbin/btcontrol/btcontrol.8: file removal
usr.sbin/btcontrol/dev.c: file removal
usr.sbin/btcontrol/btcontrol.c: file removal
usr.sbin/btcontrol/Makefile: file removal
rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
 1.3.4.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.3.2.1 27-Jul-2007  liamjfoy Pull up following revision(s) (requested by plunky in ticket #796):
etc/rc.d/btdevctl: revision 1.4
add requirement for bthcid since devices may need to authenticate
 1.4.18.2 23-Jul-2007  plunky add requirement for bthcid since devices may need to authenticate
 1.4.18.1 23-Jul-2007  plunky file btdevctl was added on branch matt-mips64 on 2007-07-23 18:06:57 +0000
 1.5.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.4 18-Jun-2011  plunky remove empty files
 1.3 27-May-2011  plunky branches: 1.3.2;
provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.2 01-Jun-2010  wiz Fix typo in sdpd, reported by Jukka Salmi in PR 43401.
This also affected bthcid, so I also fixed it there.
 1.1 19-Jun-2006  gdamore Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.3.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2 15-Apr-2008  plunky some changes to serial bluetooth host controller interfaces

btuartd(8) should be named btattach(8) for consistency
with other parts of NetBSD

make btattach(8) a single-use tool for less complexity

device specicific initialisation (from btuart(4)) is carried
out prior to activating the line discipline (in btattach(8)),
which simplifies the API somewhat and means that the user
tool and the kernel do not need to be kept in sync.

btuart(4) driver is much reduced; naming is made consistent
and all tsleep() and delay() are removed to userland
 1.1 20-Feb-2007  kiyohara branches: 1.1.12;
Supprot Bluetooth HCI UART (H4) driver and daemon.
 1.1.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.8 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.7 05-Apr-2011  enami Unconfigure on shutdown so that component deivces are closed.
 1.6 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.5 13-Aug-2004  mycroft branches: 1.5.36;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 19-Mar-2003  wiz Allow ccd autoconfiguration to be turned off (by setting ccd=NO in
/etc/rc.conf; default is YES.)
Suggested by elric, ok'ed by lukem.
 1.3 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 26-Apr-2000  thorpej Make ccd and raidframe provide `disks', and make swap1 and fsck
depend on `disks', rather than `ccd' and `raidframe'.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3 25-Dec-2023  kre Whitespace: 8 spaces -> tab
 1.2 25-Dec-2023  kre No longer use obsolete test(1) -a option/operator, use sh && instead.

While here a couple of minor formatting improvements - in general it
is always a good idea to surround sh operator chars (like '>' '(' ...)
with white space, to guard against thet possibility that some other (or
later enhanced) sh might have additional operators which happen to be
the character string used.

I don't understand while the final part of the condition for not doing
anything needs to run in a subshell, but that can stay for now.
 1.1 27-Sep-2023  riastradh branches: 1.1.2;
/etc/rc.d/cerctl_init: New script for certctl rehash in live images.

This is very limited -- it does not supplant postinstall to rehash
certificates on upgrade; it only runs certctl rehash if
/etc/openssl/certs is an empty directory, as you get in live images
not created with sysinst.

We could also have a more general-purpose way to run postinstall(8)
on first boot of an image, but that has a lot more moving parts to
think about, so let's start with this limited-scope low-risk
approach.

PR install/57629

XXX pullup-10
 1.1.2.2 02-Oct-2023  martin Pull up following revision(s) (requested by riastradh in ticket #381):

distrib/utils/embedded/conf/evbarm.conf: revision 1.42
distrib/sets/lists/etc/mi: revision 1.273
etc/rc.d/Makefile: revision 1.118
distrib/utils/embedded/conf/usermode.conf: revision 1.7
etc/rc.d/certctl_init: revision 1.1
distrib/evbarm/liveimage/armimage/rc.conf.armimage: revision 1.2
etc/defaults/rc.conf: revision 1.166
distrib/amd64/liveimage/emuimage/rc.conf.emuimage: revision 1.3
distrib/utils/embedded/conf/x86.conf: revision 1.11
distrib/utils/embedded/conf/evbmips.conf: revision 1.4

/etc/rc.d/cerctl_init: New script for certctl rehash in live images.

This is very limited -- it does not supplant postinstall to rehash
certificates on upgrade; it only runs certctl rehash if
/etc/openssl/certs is an empty directory, as you get in live images
not created with sysinst.

We could also have a more general-purpose way to run postinstall(8)
on first boot of an image, but that has a lot more moving parts to
think about, so let's start with this limited-scope low-risk
approach.

PR install/57629

/etc/rc.d/certctl_init: Default off.
Otherwise in systems without certctl_init=YES, such as systems
installed with sysinst(8) where it's unnecessary because the rehash
has already happened at install time, you'll get spurious warnings.
 1.1.2.1 27-Sep-2023  martin file certctl_init was added on branch netbsd-10 on 2023-10-02 13:26:04 +0000
 1.9 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.8 01-Nov-2010  christos add a cgd_stop function
 1.7 11-Sep-2009  apb Adapt /etc/rc.d/cgd script to the new /etc/rc:
Add "KEYWORD: interactive" so that prompting for passwords work, and
use print_rc_normal to print a message that could safely be suppressed.

Part of the /etc/rc silent changes requested in PR 41946
and proposed in tech-userlevel.
 1.6 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.5 02-Mar-2005  tv branches: 1.5.36;
Revert previous, for now. We don't umount filesystems in the shutdown
process (we're -- probably inappropriately -- waiting for the kernel to do
that at the end), so cgdconfig -U won't do much until that situation changes.
 1.4 02-Mar-2005  tv Unconfigure cgd devices on shutdown, so that underlying layers (i.e.,
RAIDframe) are happier.
 1.3 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 19-Mar-2003  wiz Allow cgd configuration to be skipped (by setting cgd=NO, defaults to YES).
Closes my PR/20766. Based on a suggestion by lukem.
 1.1 09-Oct-2002  elric Added cgd rc.d script and put it in the appropriate postinstall and
mtree files.
 1.5.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.2 08-Sep-2020  martin Make it work with empty /var
 1.1 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.13 30-Sep-2018  martin Discussed some years ago but never commited: add an option to have a
single tmpfs (on /tmp) and use that for /var/shm as well (via a symlink
created after the tmpfs on /tmp has been mounted)
 1.12 03-Jul-2015  dholland branches: 1.12.14; 1.12.16;
/usr/sbin/chown -> /sbin/chown
(not sure why these need explicit paths at all, but whatevs)
 1.11 24-Oct-2012  apb Avoid using glob patterns that might match enough files to give
"Arg list too long" errors. Change the "find" command to use
"-exec ... +" instead of "-exec ... \;" to make it more efficient.
 1.10 04-Dec-2007  mjf branches: 1.10.4; 1.10.30; 1.10.36;
Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
 1.9 15-Feb-2007  xtraeme branches: 1.9.4;
* Use checkyesno rather than using a harcoded value.
* If per_user_tmp is disabled and /tmp equals to ${per_user_tmp_dir}/@uid,
remove it and recreate it with proper permissions (1777).

This fixes the problem when per_user_tmp is enabled and will put /tmp
on its original state when it's disabled.
 1.8 04-Feb-2007  elad Add support for per-user /tmp.

Enabled via per_user_tmp in /etc/rc.conf (default off).

See security(8) and rc.conf(5) for more details.

Lots of input from thorpej@ & christos@, thanks!
 1.7 07-Oct-2006  elad Back out previous. This was a dup of PR/29144 that was fixed differently.

Thanks to pavel@ for pointing out, okay oster@.
 1.6 07-Oct-2006  elad PR/22340: Benedikt Meurer: cleartmp should honor ifile on LFS
Patch applied, thanks!
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.3 19-Sep-2000  lukem - 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
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 02-Oct-2000  lukem pull up rev 1.3 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.9.4.1 09-Jan-2008  matt sync with HEAD
 1.10.36.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.30.1 30-Oct-2012  yamt sync with head
 1.10.4.2 04-Dec-2007  mjf Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
 1.10.4.1 04-Dec-2007  mjf file cleartmp was added on branch mjf-devfs on 2007-12-04 22:09:02 +0000
 1.12.16.1 10-Jun-2019  christos Sync with HEAD
 1.12.14.1 20-Oct-2018  pgoyette Sync with head
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 19-Sep-2000  lukem - 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
 1.4 17-Jul-2000  lukem add '# KEYWORD: shutdown' so that these scripts get run at shutdown time.
now, only scripts with the keyword `shutdown' will be run by /etc/rc.shutdown,
which speeds up shutdown and makes it more robust.
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.2 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.1 18-Feb-2008  mjf branches: 1.1.2; 1.1.6;
file devfsd was initially added on branch mjf-devfs.
 1.1.6.1 21-Feb-2008  mjf Start where the mjf-devfs branch left off.
 1.1.2.1 18-Feb-2008  mjf Add some devfs code that's been sitting in my local tree for a while.

devfsd(8) is now the first daemon to be started after init(8). It tracks
device insertion (will eventually track removal) and devfs mounts.

Currently, we can mount multiple device file systems and have device
special files pushed into the mounts automatically, though, the device
special files aren't created with the correct major/minor number pairs
yet.

More work to come soon.
 1.3 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.2 31-Jul-2021  mlelstv Run devpubd before volume managers and pseudo disks.
 1.1 06-Sep-2011  riz Create and install an rc.d file for devpubd - a daemon to listen
on drvctl and autocreate device nodes in /dev for those which don't have any.
Set the default to "NO" for now.
 1.10 29-Jun-2018  roy Remove dhclient from the base system.

Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
 1.9 13-Aug-2004  mycroft branches: 1.9.92; 1.9.94;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 19-Sep-2000  lukem - 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
 1.6 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.5 26-May-2000  hubertf branches: 1.5.4;
/etc/dhclient.conf is *not* required for dhclient to run.
 1.4 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 06-Apr-2000  thorpej dhclient does not, in fact, require /var/db/dhclient.leases to exist.
 1.2 15-Mar-2000  fvdl dhclient lives in /sbin, not /usr/sbin
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5.4.2 02-Oct-2000  lukem pull up rev 1.7 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.5.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.9.94.1 10-Jun-2019  christos Sync with HEAD
 1.9.92.1 28-Jul-2018  pgoyette Sync with HEAD
 1.11 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.10 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.9 31-May-2020  roy dhcpcd: Empty the chroot

While here, set correct optional hooks.
 1.8 02-Apr-2020  roy Add chroot support for dhcpcd
 1.7 22-Feb-2020  roy Revert unrelated changes to prior
 1.6 22-Feb-2020  roy rc.d/network: improve wording of waiting for DAD to finish
 1.5 07-Jan-2016  roy branches: 1.5.16;
Use the new -P option to work out which pidfile dhcpcd will use.
 1.4 16-Oct-2015  roy Fix the problem of just having a valid interface name in dhcpcd_flags.
 1.3 06-Apr-2014  khorben branches: 1.3.2;
Allow the extra command "reload" to dhcpcd's rc script, letting it reload
its configuration and rebind directly via the script.

LGTM roy@
 1.2 25-Jun-2013  roy branches: 1.2.4;
Add a hack to fix the dhcpcd rc.d script to work with a single
interface specified in dhcpcd_flags in rc.conf(5).
Fixes PR bin/43490
 1.1 28-Apr-2009  roy branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.18;
Add an rc.d script for dhcpcd(8)
 1.1.18.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.2 21-Apr-2010  matt sync to netbsd-5
 1.1.6.1 28-Apr-2009  matt file dhcpcd was added on branch matt-nb5-mips64 on 2010-04-21 05:21:24 +0000
 1.1.4.2 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.4.1 28-Apr-2009  jym file dhcpcd was added on branch jym-xensuspend on 2009-05-13 19:18:03 +0000
 1.1.2.2 10-May-2009  snj Pull up following revision(s) (requested by roy in ticket #534):
etc/defaults/rc.conf: revision 1.103
etc/rc.d/Makefile: revision 1.78 via patch
etc/rc.d/dhcpcd: revision 1.1
Add an rc.d script for dhcpcd(8)
 1.1.2.1 28-Apr-2009  snj file dhcpcd was added on branch netbsd-5 on 2009-05-10 21:32:57 +0000
 1.2.4.1 10-Aug-2014  tls Rebase.
 1.3.2.1 27-Jul-2018  martin Pull up following revision(s) (requested by roy in ticket #1621):

external/bsd/dhcpcd/dist/compat/crypt/sha256.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/crypt/md5.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/crypt/md5.h up to 1.1.1.2
external/bsd/dhcpcd/dist/compat/crypt/sha256.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/crypt/hmac.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/crypt/hmac.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/_strtoi.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/arc4random.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/arc4random.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/arc4random_uniform.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/arc4random_uniform.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/bitops.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/dprintf.c up to 1.1.1.2
external/bsd/dhcpcd/dist/compat/dprintf.h up to 1.1.1.2
external/bsd/dhcpcd/dist/compat/endian.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/pidfile.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/pidfile.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/queue.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/reallocarray.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/reallocarray.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/strtoi.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/strtoi.h up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/strtou.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/strlcpy.c up to 1.1.1.1
external/bsd/dhcpcd/dist/compat/strlcpy.h up to 1.1.1.1
external/bsd/dhcpcd/dist/config-null.mk up to 1.1.1.1
external/bsd/dhcpcd/dist/configure up to 1.1.1.8
external/bsd/dhcpcd/dist/iconfig.mk up to 1.1.1.1
external/bsd/dhcpcd/dist/hooks/01-test up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/02-dump up to 1.1.1.1
external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/15-timezone up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/20-resolv.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/29-lookup-hostname up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/30-hostname up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-dhcpcd-compat up to 1.1.1.1
external/bsd/dhcpcd/dist/hooks/50-ntp.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-yp.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-ypbind.in up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/Makefile up to 1.1.1.1
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in up to 1.1.1.4
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.1.1.4
external/bsd/dhcpcd/dist/src/GNUmakefile up to 1.1.1.1
external/bsd/dhcpcd/dist/src/Makefile up to 1.1.1.4
external/bsd/dhcpcd/dist/src/arp.c up to 1.1.1.7
external/bsd/dhcpcd/dist/src/arp.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/auth.c up to 1.1.1.5
external/bsd/dhcpcd/dist/src/auth.h up to 1.1.1.3
external/bsd/dhcpcd/dist/src/bpf.c up to 1.7
external/bsd/dhcpcd/dist/src/bpf.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/common.c up to 1.1.1.5
external/bsd/dhcpcd/dist/src/common.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/control.c up to 1.1.1.3
external/bsd/dhcpcd/dist/src/control.h up to 1.1.1.2
external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.15
external/bsd/dhcpcd/dist/src/dev.c up to 1.1.1.3
external/bsd/dhcpcd/dist/src/dev.h up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcp-common.c up to 1.1.1.4
external/bsd/dhcpcd/dist/src/dhcp-common.h up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.11
external/bsd/dhcpcd/dist/src/dhcp.h up to 1.1.1.6
external/bsd/dhcpcd/dist/src/dhcp6.c up to 1.1.1.12
external/bsd/dhcpcd/dist/src/dhcp6.h up to 1.1.1.6
external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcpcd.8.in up to 1.1.1.10
external/bsd/dhcpcd/dist/src/dhcpcd.c up to 1.13
external/bsd/dhcpcd/dist/src/dhcpcd.conf up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in up to 1.1.1.10
external/bsd/dhcpcd/dist/src/dhcpcd.h up to 1.1.1.5
external/bsd/dhcpcd/dist/src/duid.c up to 1.1.1.3
external/bsd/dhcpcd/dist/src/duid.h up to 1.1.1.1
external/bsd/dhcpcd/dist/src/eloop.c up to 1.1.1.5
external/bsd/dhcpcd/dist/src/eloop.h up to 1.1.1.3
external/bsd/dhcpcd/dist/src/genembedc up to 1.1.1.1
external/bsd/dhcpcd/dist/src/genembedh up to 1.1.1.1
external/bsd/dhcpcd/dist/src/if-bsd.c up to 1.1.1.8
external/bsd/dhcpcd/dist/src/if-linux-wext.c up to 1.1.1.2
external/bsd/dhcpcd/dist/src/if-linux.c up to 1.1.1.10
external/bsd/dhcpcd/dist/src/if-options.c up to 1.10
external/bsd/dhcpcd/dist/src/if-options.h up to 1.1.1.7
external/bsd/dhcpcd/dist/src/if-sun.c up to 1.1.1.4
external/bsd/dhcpcd/dist/src/if.c up to 1.1.1.8
external/bsd/dhcpcd/dist/src/if.h up to 1.1.1.5
external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.9
external/bsd/dhcpcd/dist/src/ipv4.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/ipv4ll.c up to 1.1.1.4
external/bsd/dhcpcd/dist/src/ipv4ll.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.1.1.11
external/bsd/dhcpcd/dist/src/ipv6.h up to 1.1.1.7
external/bsd/dhcpcd/dist/src/ipv6nd.c up to 1.1.1.8
external/bsd/dhcpcd/dist/src/ipv6nd.h up to 1.1.1.6
external/bsd/dhcpcd/dist/src/logerr.c up to 1.1.1.2
external/bsd/dhcpcd/dist/src/logerr.h up to 1.1.1.3
external/bsd/dhcpcd/dist/src/route.c up to 1.1.1.8
external/bsd/dhcpcd/dist/src/route.h up to 1.1.1.4
external/bsd/dhcpcd/dist/src/sa.c up to 1.1.1.3
external/bsd/dhcpcd/dist/src/sa.h up to 1.1.1.2
external/bsd/dhcpcd/dist/src/script.c up to 1.1.1.4
external/bsd/dhcpcd/dist/src/script.h up to 1.1.1.2
external/bsd/dhcpcd/dist/src/dev/Makefile up to 1.1.1.1
external/bsd/dhcpcd/dist/src/dev/udev.c up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/crypt/.gitignore up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/crypt/GNUmakefile up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/crypt/Makefile up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/crypt/README.md up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/crypt/run-test.c up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/crypt/test.h up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/crypt/test_hmac_md5.c up to 1.1.1.3
external/bsd/dhcpcd/dist/tests/Makefile up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/eloop-bench/.gitignore up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/eloop-bench/Makefile up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/eloop-bench/README.md up to 1.1.1.1
external/bsd/dhcpcd/dist/tests/eloop-bench/eloop-bench.c up to 1.1.1.3
external/bsd/dhcpcd/dist/.arcconfig up to 1.1.1.1
external/bsd/dhcpcd/dist/.gitignore up to 1.4
external/bsd/dhcpcd/dist/BUILDING.md up to 1.1.1.2
external/bsd/dhcpcd/dist/LICENSE up to 1.1.1.2
external/bsd/dhcpcd/dist/Makefile up to 1.1.1.5
external/bsd/dhcpcd/dist/Makefile.inc up to 1.1.1.2
external/bsd/dhcpcd/dist/README.md up to 1.1.1.3
external/bsd/dhcpcd/dist/bpf-filter.h delete
external/bsd/dhcpcd/dist/common.c delete
external/bsd/dhcpcd/dist/arp.c delete
external/bsd/dhcpcd/dist/arp.h delete
external/bsd/dhcpcd/dist/auth.c delete
external/bsd/dhcpcd/dist/auth.h delete
external/bsd/dhcpcd/dist/dhcpcd.c delete
external/bsd/dhcpcd/dist/control.c delete
external/bsd/dhcpcd/dist/common.h delete
external/bsd/dhcpcd/dist/config.h delete
external/bsd/dhcpcd/dist/dhcp-common.c delete
external/bsd/dhcpcd/dist/control.h delete
external/bsd/dhcpcd/dist/defs.h delete
external/bsd/dhcpcd/dist/dev.h delete
external/bsd/dhcpcd/dist/dhcpcd-definitions.conf delete
external/bsd/dhcpcd/dist/dhcp-common.h delete
external/bsd/dhcpcd/dist/dhcp.c delete
external/bsd/dhcpcd/dist/dhcp.h delete
external/bsd/dhcpcd/dist/dhcp6.c delete
external/bsd/dhcpcd/dist/dhcp6.h delete
external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in delete
external/bsd/dhcpcd/dist/dhcpcd-embedded.c delete
external/bsd/dhcpcd/dist/dhcpcd.8.in delete
external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in delete
external/bsd/dhcpcd/dist/dhcpcd-embedded.h delete
external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in delete
external/bsd/dhcpcd/dist/ipv4.c delete
external/bsd/dhcpcd/dist/if.c delete
external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in delete
external/bsd/dhcpcd/dist/dhcpcd.h delete
external/bsd/dhcpcd/dist/dhcpcd.conf delete
external/bsd/dhcpcd/dist/dhcpcd.conf.5.in delete
external/bsd/dhcpcd/dist/duid.c delete
external/bsd/dhcpcd/dist/duid.h delete
external/bsd/dhcpcd/dist/eloop.c delete
external/bsd/dhcpcd/dist/eloop.h delete
external/bsd/dhcpcd/dist/if-bsd.c delete
external/bsd/dhcpcd/dist/if-options.c delete
external/bsd/dhcpcd/dist/if-options.h delete
external/bsd/dhcpcd/dist/if.h delete
external/bsd/dhcpcd/dist/crypt/hmac_md5.c delete
external/bsd/dhcpcd/dist/crypt/crypt.h delete
external/bsd/dhcpcd/dist/ipv4.h delete
external/bsd/dhcpcd/dist/ipv4ll.c delete
external/bsd/dhcpcd/dist/ipv6.c delete
external/bsd/dhcpcd/dist/ipv4ll.h delete
external/bsd/dhcpcd/dist/ipv6.h delete
external/bsd/dhcpcd/dist/ipv6nd.c delete
external/bsd/dhcpcd/dist/ipv6nd.h delete
external/bsd/dhcpcd/dist/script.c delete
external/bsd/dhcpcd/dist/script.h delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf delete
external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind delete
usr.sbin/postinstall/postinstall: revision 1.211-1.213
etc/rc.d/dhcpcd upto 1.5
doc/3RDPARTY manual edit

Import dhcpcd-7.0.7.
Adjust postinstal and rc file.
 1.5.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7 17-Jul-2014  spz Create the dhcpd.leases file if it doesn't exist already, don't just
warn about it not being there.
Closes PR misc/48868
 1.6 13-Aug-2004  mycroft branches: 1.6.56; 1.6.70;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.70.1 10-Aug-2014  tls Rebase.
 1.6.56.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1 29-Dec-2017  is Add startup file for dhcp v6 with builtin isc-dhcp. Alas, this needs to
be a seperate process. On the positive side: this can't break the dhcpd
for IPv4 when tested.
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.9 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.6 25-Apr-2001  lukem wrap file creation operation in: ( umask 022 ; <command...> )
 1.5 19-Sep-2000  lukem - 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
 1.4 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 30-Apr-2000  lukem remove /var/run/dmesg.boot before attempting to write to it
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.2 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.6 05-Sep-2009  apb * Use functions from rc.subr, and indent the code.
* Add "KEYWORD: nostart", so /etc/rc doesn't try to run this (it would
have been harmless anyway).
 1.5 11-Oct-2004  christos Use new style command substitution.
 1.4 16-Aug-2002  martin Avoid exit(0) to play more nicely with rc_fast_and_loose.
Noted by Greywolf on tech-userlevel.
 1.3 18-Apr-2002  lukem add a PROVIDE line
 1.2 04-Sep-2001  martin Make this work without parameters (i.e. manual invocation)
 1.1 04-Sep-2001  martin Add support to down some interfaces before shutting down the system. All
pppoe* interfaces are automatically shut down by this script, others may be
added to the force_down_interfaces variable in /etc/rc.conf.
 1.1 10-Jan-2021  riastradh Various entropy integration improvements.

- New /etc/security check for entropy in daily security report.

- New /etc/rc.d/entropy script runs (after random_seed and rndctl) to
check for entropy at boot -- in rc.conf, you can:

. set `entropy=check' to halt multiuser boot and enter single-user
mode if not enough entropy

. set `entropy=wait' to make multiuser boot wait until enough entropy

Default is to always boot without waiting -- and rely on other
channels like security report to alert the operator if there's a
problem.

- New man page entropy(7) discussing the higher-level concepts and
system integration with cross-references.

- New paragraph in afterboot(8) about entropy citing entropy(7) for
more details.

This change addresses many of the issues discussed in security/55659.
This is a first draft; happy to take improvements to the man pages and
scripted messages to improve clarity.

I considered changing motd to include an entropy warning with a
reference to the entropy(7) man page, but it's a little trickier:
- Not sure it's appropriate for all users to see at login rather than
users who have power to affect the entropy estimate (maybe it is,
just haven't decided).
- We only have a mechanism for changing once at boot; the message would
remain until next boot even if an operator adds enough entropy.
- The mechanism isn't really conducive to making a message appear
conditionally from boot to boot.
 1.5 26-Nov-2021  sborrill Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
 1.4 07-Oct-2007  xtraeme Only print the message if the command ran successfully.
 1.3 07-Oct-2007  xtraeme Update for the new configuration file format for envstat(8)
and the envsys framework.

The rc.d has been simplified vastly... the configuration file now
is more powerful than ever!
 1.2 25-Jul-2007  xtraeme branches: 1.2.4; 1.2.6;
- Ignore lines with desc at start/stop time, this target must be used
manually.
- Ignore lines with rfact at stop time, they cannot be stopped.

Reported by wiz@.
 1.1 01-Jul-2007  xtraeme Add the /etc/rc.d/envsys script required by envsys2.
 1.2.6.2 25-Jul-2007  xtraeme - Ignore lines with desc at start/stop time, this target must be used
manually.
- Ignore lines with rfact at stop time, they cannot be stopped.

Reported by wiz@.
 1.2.6.1 25-Jul-2007  xtraeme file envsys was added on branch matt-mips64 on 2007-07-25 12:47:45 +0000
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.5 26-Nov-2021  sborrill Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
 1.4 04-Jul-2020  skrll Trailing whitespace
 1.3 07-Feb-2012  mbalmer For the sake of consistency with other scripts, output a full stop after the
word 'done'. releng ok.
 1.2 15-Jun-2011  hans branches: 1.2.2;
remove -q argument, it is useless with Xorg and fails with XFree
 1.1 18-Feb-2011  jmcneill branches: 1.1.2; 1.1.4;
Add rc.d script to make sure the system fontconfig cache is up to date.
 1.1.4.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.1.2.2 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.1 18-Feb-2011  bouyer file fccache.in was added on branch bouyer-quota2 on 2011-03-05 15:08:43 +0000
 1.2.2.1 17-Apr-2012  yamt sync with head
 1.14 14-Jul-2007  ad fixsb has done its job.
 1.13 06-Apr-2007  apb * Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.12 30-Dec-2004  dsainty Add a missing space in a comment
 1.11 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.10 23-Apr-2004  keihan branches: 1.10.2;
s/netbsd.org/NetBSD.org/
 1.9 21-Apr-2004  christos Whitespace fixes, some code re-factoring, and a bit more verbose messages.
 1.8 21-Apr-2004  dbj simply logic and flow of check_part function
 1.7 21-Apr-2004  dbj abstract superblock field reading into shell function
 1.6 21-Apr-2004  dbj add function for reporting verbose messages
 1.5 21-Apr-2004  dbj tweak return value of check_part function
 1.4 21-Apr-2004  dbj some minor shell programming tweaks recommended by christos
use [ -n ] instead of [ ! -z ]
use $() instead of ``
use just "$@" instead ${1+"$@"}
 1.3 21-Apr-2004  dbj use shell constructs and cat instead of sed since
sed may not be available early in the rc.d sequence
 1.2 18-Apr-2004  dbj add support for turning off fixsb in rc.conf
default is fixsb=YES
 1.1 16-Apr-2004  dbj This rc.d script attempts to correct problems
which may have been introduced by booting a netbsd-current kernel
from between April of 2003 and January 2004. For more information
see <http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html>
This script was developed as a response to NetBSD pr install/25138

This should not be added to the Makefile or the default install until
it has been further tested
 1.10.2.2 27-Apr-2004  jdc Pull up revisions 1.1-1.10 (requested by dbj in ticket #185)

Fix problems related to superblock upgrade issues which may be
experienced by -current users from 2003.
 1.10.2.1 23-Apr-2004  jdc file fixsb was added on branch netbsd-2-0 on 2004-04-27 17:54:49 +0000
 1.11 17-Feb-2010  christos Exclude root, since that is done in fsck_root.
 1.10 10-Jul-2009  christos 1. centralize the fsck error handling
2. don't check if root is on nfs
3. reboot -n if root was modified as the manual page suggests
 1.9 02-Mar-2008  tron Print out a message explaining why the system is rebooting if the root
filesystem is modified by fsck(8).
 1.8 24-Feb-2008  christos cleanup fsck error handling:
1. explain what each error means
2. remove 130 (128 + 2) which was presumably there because fsck_msdos did
not handle SIGINT properly
 1.7 06-Apr-2007  apb branches: 1.7.4; 1.7.10; 1.7.12;
* Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.6 07-Oct-2006  riz Trap SIGINT so that if fsck is interrupted by ^C, we drop into single-user
mode. Fixes misc/29822 from der Mouse, fix from Arnaud Lacombe with
comment rework by me.
 1.5 13-Aug-2004  mycroft branches: 1.5.2;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 20-Oct-2003  christos branches: 1.4.4;
set fsck_flags=-p in /etc/defaults/rc.conf instead of checking if it is
empty in /etc/rc.d/fsck. From Bernd Ernesti.
 1.3 15-Oct-2003  christos Allow overrides via fsck_flags
 1.2 18-Jun-2001  lukem branches: 1.2.2;
Now that "fsck -p" skips file systems that are mounted read-write,
always perform the disk check (unless /fastboot exists). Previously
this would only occur when booting directly to multi-user, so the
fsck wouldn't happen after a single user boot going into multi-user.
 1.1 21-Aug-2000  lukem branches: 1.1.2;
convert fsck.sh -> fsck (using kill -TERM $$ to stop autoboot).
 1.1.2.2 23-Aug-2000  lukem pull up the following:
etc/rc.d/Makefile 1.12
etc/rc.d/fsck 1.1
etc/rc.d/fsck.sh REMOVE
replace fsck.sh with fsck (using kill -TERM $$ to stop autoboot).

approved: thorpej
 1.1.2.1 21-Aug-2000  lukem file fsck was added on branch netbsd-1-5 on 2000-08-23 12:32:17 +0000
 1.2.2.1 27-Oct-2003  jmc Pullup revs 1.3-1.4 (requested by martti in ticket #1543)

Allow custom fsck options via fsck_flags.
 1.4.4.1 08-Oct-2006  bouyer Pull up following revision(s) (requested by riz in ticket #10704):
etc/rc.d/fsck: revision 1.6
Trap SIGINT so that if fsck is interrupted by ^C, we drop into single-user
mode. Fixes misc/29822 from der Mouse, fix from Arnaud Lacombe with
comment rework by me.
 1.5.2.1 07-Oct-2006  ghen Pull up following revision(s) (requested by riz in ticket #1542):
etc/rc.d/fsck: revision 1.6
Trap SIGINT so that if fsck is interrupted by ^C, we drop into single-user
mode. Fixes misc/29822 from der Mouse, fix from Arnaud Lacombe with
comment rework by me.
 1.7.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.10.1 24-Mar-2008  keiichi sync with head.
 1.7.4.1 23-Mar-2008  matt sync with HEAD
 1.3 21-Aug-2000  lukem convert fsck.sh -> fsck (using kill -TERM $$ to stop autoboot).
 1.2 26-Apr-2000  thorpej branches: 1.2.4;
Make ccd and raidframe provide `disks', and make swap1 and fsck
depend on `disks', rather than `ccd' and `raidframe'.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 23-Aug-2000  lukem pull up the following:
etc/rc.d/Makefile 1.12
etc/rc.d/fsck 1.1
etc/rc.d/fsck.sh REMOVE
replace fsck.sh with fsck (using kill -TERM $$ to stop autoboot).

approved: thorpej
 1.6 20-Sep-2011  apb Don't try to fsck root device if "/" is not mentioned in fstab.
Also don't assume that all network mounts are "nfs".
 1.5 25-Sep-2010  bad Treat empty or missing fs_passno field like it has a value of 0 as fstab(5)
specifies.
Related to PR misc/43905 but does not fix the underlying issues.
 1.4 16-Feb-2010  mrg only fsck / if we find it in /etc/fstab. diskless systems don't need
a / entry.

XXX: still get an error from "mount /" in etc/rc.d/root itself.
 1.3 10-Jul-2009  christos 1. centralize the fsck error handling
2. don't check if root is on nfs
3. reboot -n if root was modified as the manual page suggests
 1.2 28-Apr-2009  apb branches: 1.2.2;
Do nothing if root file system has fs_passno=0 in /etc/fstab.
(It might be better to change fsck(8) so that "fsck -p" always checks
fs_passno, whether or not file systems are specified on the command
line.)
 1.1 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.2.2.2 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.2.1 28-Apr-2009  jym file fsck_root was added on branch jym-xensuspend on 2009-05-13 19:18:03 +0000
 1.2 18-Jun-2008  yamt branches: 1.2.2;
merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@. requested by core@
 1.1 13-Jun-2008  peter branches: 1.1.2;
file ftp_proxy was initially added on branch yamt-pf42.
 1.1.2.1 13-Jun-2008  peter rc.d script for starting ftp proxy.
 1.2.2.2 23-Jun-2008  wrstuden Add files to branch that were added on -current.

After this, all that's left of update is to merge some changes
that had conflicts.
 1.2.2.1 18-Jun-2008  wrstuden file ftp_proxy was added on branch wrstuden-revivesa on 2008-06-23 05:02:08 +0000
 1.3 09-Aug-2005  peter Add command_args="-D" to the ftpd rc.d script. This flag is always needed
when running ftpd as daemon and it will now automatically be appended to the
command line, even if ftpd_flags doesn't have it.

Suggested by Alan Barrett and Luke Mewburn, thanks.
 1.2 08-Aug-2005  peter Add a note telling that ftpd_flags should always contain "-D".
Suggested by lukem@.
 1.1 04-Aug-2005  peter Add rc.d support for standalone ftpd, suggested by perry@.
 1.5 05-Apr-2001  wiz Don't install /etc/rc.d/gated any longer, since gated isn't in the
base system.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2 30-Apr-2022  brad Like /etc/rc.d/network, add the ability to put a '!' character as the
first character in /etc/gpio.conf and have the rest evaluated in a
shell. It is useful to be able to do actions after setting up gpio
pins or attaching gpioiic(4).
 1.1 25-Jul-2009  mbalmer Document recent gpio(4) changes and introduce a new config file for GPIO.
Integrate with the startup scripts in /etc/rc.d. Introduce new variable
"gpio" for /etc/rc.conf.
 1.4 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.3 02-Jun-2006  rpaulo branches: 1.3.20;
s/mountall/mountcritremote/
Noticed by Jukka Salmi.
 1.2 30-Apr-2006  rpaulo Remove wrong comment.
 1.1 30-Apr-2006  rpaulo rc script to control hostapd.
 1.3.20.1 17-Jan-2009  mjf Sync with HEAD.
 1.1 11-Dec-2008  mishka branches: 1.1.2; 1.1.4;
Import rc.d/httpd script for httpd(8) daemon control.
See rc.conf(5) for options explanation.
 1.1.4.2 22-Jan-2009  snj Pull up following revision(s) (requested by rafal in ticket #297):
distrib/sets/lists/etc/mi: revision 1.203
doc/CHANGES: revision 1.1151 via patch
etc/defaults/rc.conf: revision 1.97
etc/mtree/special: revision 1.123
etc/rc.d/Makefile: revision 1.71
etc/rc.d/httpd: revision 1.1
share/man/man5/rc.conf.5: revision 1.123
usr.sbin/postinstall/postinstall: revision 1.80
Import rc.d/httpd script for httpd(8) daemon control.
See rc.conf(5) for options explanation.
 1.1.4.1 11-Dec-2008  snj file httpd was added on branch netbsd-5 on 2009-01-22 21:28:26 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 11-Dec-2008  mjf file httpd was added on branch mjf-devfs2 on 2009-01-17 20:43:44 +0000
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 31-Jan-2004  christos new identd script
 1.4 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.3 24-Jun-2003  martin Ifwatchd now uses syslog, so require syslogd.
 1.2 14-Mar-2003  martin Make it start before "SERVERS" and remove redundant dependency on
"network". This brings it in line with the altqd script, which has
very similar requirements.
 1.1 10-Dec-2001  martin Add rc.d support for ifwatchd (used to run ip-up/ip-down scripts for
in-kernel pppoe interfaces).
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 19-Sep-2000  lukem - 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
 1.5 17-Jul-2000  lukem add '# KEYWORD: shutdown' so that these scripts get run at shutdown time.
now, only scripts with the keyword `shutdown' will be run by /etc/rc.shutdown,
which speeds up shutdown and makes it more robust.
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.2 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8 25-Dec-2023  kre Don't use obsolete test(1) -a option/operator - use sh && instead.
 1.7 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.6 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.5 14-Feb-2020  kim Use the configured IP6ADDRCTL_CMD for stopping also.
 1.4 27-Jan-2020  kim Add NetBSD ID
 1.3 07-Aug-2019  nakayama Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.2 23-Dec-2015  christos branches: 1.2.16; 1.2.18;
remove some stuff we don't have; rename rc command variable.
 1.1 13-Dec-2015  christos Add ip6addrctl
 1.2.18.2 31-Jan-2020  martin Pull up following revision(s) (requested by kim in ticket #675):

etc/rc.d/autounmountd: revision 1.3
etc/rc.d/ip6addrctl: revision 1.4

Add NetBSD ID
 1.2.18.1 08-Aug-2019  martin Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.
 1.2.16.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.21 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.20 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.19 04-Jul-2020  skrll Trailing whitespace
 1.18 23-Mar-2009  hannken Add flags to rc.d/ipfilter. Use it from rc.conf like

ipfilter=YES ipfilter_flags="-T fr_statemax=18963,fr_statesize=27091"

Ok: Christos Zoulas <christos@netbsd.org>
 1.17 22-Nov-2008  tsutsui branches: 1.17.2;
Add "bootconf" to REQUIRE: lines which had beforenetlkm
since removed beforenetlkm required bootconf.
 1.16 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.15 06-Apr-2007  apb branches: 1.15.12; 1.15.20;
* Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.14 23-Dec-2004  lukem * Conditionalize flushing of IPv4 vs IPv6 rules based on the existance
of the appropriate configuration file.
Based on PR 28757 from Jason White.

* Add comments explaining why we flush separately from the reload
(backwards compat with older ipf(8) binaries).
 1.13 08-Nov-2004  lukem Redo previous (rev 1.12) in a manner that allows this rc.d script to operate
correctly on ipf(8) from prior to 4.1.3 (where -Fa flushes both protocols)
and 4.1.3 (where -Fa only flushes the current protocol).
Fix from Kimmo Suominen, per private discussion.
 1.12 09-Sep-2004  lukem Explicitly flush (-Fa) rules when loading or reloading IPv4 and IPv6 rules,
rather than relying upon running "ipf -Fa" beforehand (which only flushes IPv4)
Should fix PR 26885 and PR 26857.
 1.11 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.10 28-Feb-2001  lukem branches: 1.10.4;
support `resync' (ipf -y).
suggested by Johnny C. Lam in [misc/12300]
 1.9 09-Oct-2000  nisimura Use && and || for logical concatenations instead of -a/-o test operators.
 1.8 01-Oct-2000  lukem support loading ipf6.conf as well as ipf.conf.
inspired by [misc/11033] by Gregory McGarry <g.mcgarry@ieee.org>
 1.7 19-Sep-2000  lukem - 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
 1.6 21-Jul-2000  lukem if ipf.conf isn't readable and the system is booting directly to multiuser,
send SIGTERM to the parent (/etc/rc) so that init(8) aborts the boot.
 1.5 17-Jul-2000  lukem * add support for `status'
* remove bogus comment about aborting the boot if ipf fails; this hasn't
been supported since the rc.d migration and is too messy to resolve...
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 11-Mar-2000  veego Add missing checkyesno's.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.3 27-Dec-2001  he Pull up revisions 1.9-1.10 (requested by jlam):
Use && and || for logical concatenations instead of -a/-o operators,
and support ``resync'' (ipf -y).
 1.4.4.2 02-Oct-2000  lukem pull up rev 1.7-1.8 (approved by thorpej):
- support loading ipf6.conf as well as ipf.conf
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4.4.1 09-Aug-2000  lukem pull up revs 1.5-1.6
approved by: thorpej

* add support for `status'
* if ipf.conf isn't readable and the system is booting directly to multiuser,
send SIGTERM to the parent (/etc/rc) so that init(8) aborts the boot.
 1.10.4.2 12-Nov-2004  jmc Pullup rev 1.13 (requested by lukem in ticket #963)

Redo previous (rev 1.12) in a manner that allows this rc.d script to operate
correctly on ipf(8) from prior to 4.1.3 (where -Fa flushes both protocols)
and 4.1.3 (where -Fa only flushes the current protocol).
 1.10.4.1 21-Sep-2004  tron Pull up revision 1.12 (requested by martti in ticket #866):
Explicitly flush (-Fa) rules when loading or reloading IPv4 and IPv6 rules,
rather than relying upon running "ipf -Fa" beforehand (which only flushes IPv4)
Should fix PR 26885 and PR 26857.
 1.15.20.1 26-Mar-2009  snj Pull up following revision(s) (requested by hannken in ticket #606):
etc/defaults/rc.conf: revision 1.101
etc/rc.d/ipfilter: revision 1.18
Add flags to rc.d/ipfilter. Use it from rc.conf like
ipfilter=YES ipfilter_flags="-T fr_statemax=18963,fr_statesize=27091"
Ok: Christos Zoulas <christos@netbsd.org>
 1.15.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.17.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9 25-Dec-2023  kre Clean up obsolete test(1) usage, use sh && rather than test's old -a
(and while here prefer sh's ! operator over test's - it simplifies
things for test).
 1.8 23-Sep-2018  maxv Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
 1.7 13-Aug-2004  mycroft branches: 1.7.92; 1.7.94;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 05-Jul-2004  lukem * Add BEFORE: SERVERS, so state is restored much earlier in the boot sequence.
* REQUIRE: isdnd, so this will be shutdown before that, to prevent
future problem if isdnd eve gets an explicit "shutdown" keyword.

Per discussion with Martin Husemann.
 1.5 05-Jul-2004  martin Make sure "downinterfaces" comes first - this means on shutdown this
script will run before downinterfaces destroys all state we try to
save here.
 1.4 22-Mar-2002  lukem branches: 1.4.4;
- Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.3 11-Feb-2002  lukem branches: 1.3.2;
- Remove previous hack; rc.subr warns about the variable not being set
for a reason, which is usually ``your /etc/defaults/rc.conf is not up
to date''.
- Consolidate `rm's into one line.
 1.2 11-Feb-2002  martti Don't try to execute this script if ipfs is not set to YES. Otherwise
you'll see the following message:

# /etc/rc.d/ipfs stop
/etc/rc.d/ipfs: WARNING: $ipfs is not set properly.

This horrible change is needed because of the "shutdown" keyword.
 1.1 11-Feb-2002  martti ipfs allows state information created for NAT entries and rules using
keep state to be locked (modification prevented) and then saved to disk,
allowing for the system to experience a reboot, followed by the restoration
of that information, resulting in connections not being interrupted.

To activate this feature, set ipfs=YES in /etc/rc.conf
 1.3.2.2 06-Mar-2002  he Pull up revisions 1.1-1.3 (new, requested by martti):
Added ipfs to save state tables. Use -D for ipmon.
 1.3.2.1 11-Feb-2002  he file ipfs was added on branch netbsd-1-5 on 2002-03-06 22:24:23 +0000
 1.4.4.1 05-Jul-2004  he Pull up revisions 1.5-1.6 (requested by martin in ticket #600):
Make sure ipfs gets to save state before the state is
destroyed either by interfaces being brought down or isdnd
being shut down (on general shutdown), and restore any state
by having it run before any servers are started.
 1.7.94.1 10-Jun-2019  christos Sync with HEAD
 1.7.92.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.12 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.11 04-Apr-2004  mrg move ipmon's "-D" argument from "command_args" to "ipmon_flags" so that
passing an (optional) filename argument (that must come last) works fine
from $ipmon_flags. from PR#25006.
 1.10 21-Oct-2002  lukem branches: 1.10.2;
ipmon -D writes a pidfile; use it
 1.9 18-Apr-2002  lukem branches: 1.9.2;
Revert previous:
+ it was not discussed first
+ it is not consistent with the rest of the rc.d system. everything else:
- has defaults & example configuration in /etc/defaults/rc.conf
- uses lower-case variable names, including ipmon itself

Similar functionality added by the change I'm backing out may be
reintroduced in the future once it's been changed to meet our de-facto
rc.d standards, as opposed to something that appears to have been
lifted from a non-NetBSD source (HP/UX ?) ...
 1.8 17-Apr-2002  darrenr load_rc_config needs to be called earlier to pickup the variables from the
config file so they can be used in the rc script itself.
 1.7 17-Apr-2002  darrenr Modify the script to use variable names provided by the ipmon conf file to
enable/disable "key" features.
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 28-Feb-2002  lukem ipmon: set -D via command_args rather than the default ipmon_flags.
resolves [install/15753]
 1.4 05-Jul-2001  tron Start "ipmon" with option "D" for daemon mode instead of starting it
in a subshell.
 1.3 19-Sep-2000  lukem - 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
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.2 06-Mar-2002  he Pull up revisions 1.4-1.5 (requested by martti):
Added ipfs to save state tables. Use -D for ipmon.
 1.2.4.1 02-Oct-2000  lukem pull up rev 1.3 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.9.2.2 09-Apr-2004  tron Pull up revision 1.11 (requested by mrg in ticket #1663):
move ipmon's "-D" argument from "command_args" to "ipmon_flags" so that
passing an (optional) filename argument (that must come last) works fine
from $ipmon_flags. from PR#25006.
 1.9.2.1 09-Apr-2004  tron Pull up revision 1.10 (requested by mrg in ticket #1662):
ipmon -D writes a pidfile; use it
 1.10.2.1 06-Apr-2004  jmc Pullup rev 1.11 (requested by mrg in ticket #66)

Move ipmon's "-D" argument from "command_args" to "ipmon_flags" so that
passing an (optional) filename argument (that must come last) works fine
from $ipmon_flags. PR#25006
 1.13 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.12 11-Oct-2004  christos Use new style command substitution.
 1.11 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.10 22-Aug-2003  mrg branches: 1.10.4;
ipnat needs to be before SERVERS - one may need NAT for servers to work
(eg, ntpdate).
 1.9 16-Feb-2003  grant change behaviour of 'reload' to only reload the NAT rules and NOT flush
the state table, making it much more useful.

The behaviour of 'restart' is unchanged (flush state table and reload
rules), but is now done slightly more elegantly.

ok'd by lukem.
 1.8 24-Sep-2002  martti Print a warning message if IP forwarding is not activated (PR#10295).
 1.7 22-Mar-2002  thorpej branches: 1.7.2;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.6 19-Sep-2000  lukem - 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
 1.5 21-Aug-2000  lukem needs to run after mountcritremote, since ipnat is in /usr/sbin
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 12-Mar-2000  thorpej Rearrange so the ouput of this is a bit more cosmetic.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.2 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4.4.1 23-Aug-2000  lukem pull up rev 1.5:
needs to run after mountcritremote, since ipnat is in /usr/sbin

approved: thorpej
 1.7.2.3 27-Aug-2003  tron Pull up revision 1.10 (requested by martti in ticket #1442):
ipnat needs to be before SERVERS - one may need NAT for servers to work
(eg, ntpdate).
 1.7.2.2 19-Jun-2003  msaitoh Pull up revision 1.9 (requested by grant in ticket #1321):
Change behaviour of 'reload' to only reload the NAT rules and NOT flush
the state table, making it much more useful.
 1.7.2.1 24-Oct-2002  lukem Pull up upgrade to IPfilter 3.4.29 (requested by martti in ticket #905).
Affected files & revisions:

dist/ipf/HISTORY 1.14
dist/ipf/fils.c 1.17-1.21
dist/ipf/ipf.c 1.11-1.13
dist/ipf/ipfs.c 1.8-1.10
dist/ipf/ipft_ef.c 1.6-1.7
dist/ipf/ipft_td.c 1.6-1.7
dist/ipf/ipft_tx.c 1.7-1.8
dist/ipf/ipmon.c 1.12-1.17
dist/ipf/ipnat.c 1.11-1.12
dist/ipf/ipsend/ip_var.h 1.2
dist/ipf/ipsend/ipsend.c 1.8
dist/ipf/ipsend/iptests.c 1.5
dist/ipf/ipt.c 1.8-1.10
dist/ipf/kmem.c 1.8-1.10
dist/ipf/man/ipf.4 1.10
dist/ipf/man/ipf.5 1.8
dist/ipf/man/ipftest.1 1.3
dist/ipf/man/ipmon.8 1.10
dist/ipf/man/ipnat.5 1.9-1.10
dist/ipf/man/ipnat.8 1.4
dist/ipf/misc.c 1.7
dist/ipf/natparse.c 1.10
dist/ipf/parse.c 1.13
dist/ipf/printnat.c 1.8-1.10
dist/ipf/relay.c 1.5-1.6
dist/ipf/rules/example.9 1.2
etc/rc.d/ipnat 1.8
regress/sys/kern/ipf/Makefile 1.3-1.4
regress/sys/kern/ipf/dotest6 1.2
regress/sys/kern/ipf/expected/f13 1.1.1.2
regress/sys/kern/ipf/expected/i12 1.1.1.1
regress/sys/kern/ipf/expected/ni3 1.1.1.1
regress/sys/kern/ipf/expected/ni5 1.2
regress/sys/kern/ipf/input/f13 1.1.1.2
regress/sys/kern/ipf/input/ipv6.1 1.1.1.1
regress/sys/kern/ipf/input/ni3 1.1.1.1
regress/sys/kern/ipf/regress/i12 1.1.1.1
regress/sys/kern/ipf/regress/ipv6.1 1.1.1.1
regress/sys/kern/ipf/regress/ni3.ipf 1.1.1.1
regress/sys/kern/ipf/regress/ni3.nat 1.1.1.1
sys/arch/alpha/conf/ALPHA 1.169,1.171
sys/arch/amiga/conf/GENERIC 1.185-1.186
sys/arch/arc/conf/GENERIC 1.71-1.72
sys/arch/atari/conf/GENERIC.in 1.24-1.25
sys/arch/cats/conf/GENERIC 1.31-1.32
sys/arch/cobalt/conf/GENERIC 1.34-1.35
sys/arch/hp300/conf/GENERIC 1.83-1.84
sys/arch/i386/conf/CARDBUS 1.66-1.67
sys/arch/i386/conf/GENERIC 1.510,1.512
sys/arch/i386/conf/GENERIC_LAPTOP 1.58-1.59
sys/arch/i386/conf/GENERIC_PS2TINY 1.19-1.20
sys/arch/i386/conf/GENERIC_TINY 1.47-1.48
sys/arch/luna68k/conf/GENERIC 1.33-1.33
sys/arch/mac68k/conf/GENERIC 1.130-1.131
sys/arch/mac68k/conf/GENERICSBC 1.21-1.22
sys/arch/mac68k/conf/SMALLRAM 1.4-1.5
sys/arch/macppc/conf/GENERIC 1.142-1.143
sys/arch/mipsco/conf/GENERIC 1.21-1.22
sys/arch/mmeye/conf/GENERIC 1.44-1.45
sys/arch/news68k/conf/GENERIC 1.36-1.37
sys/arch/news68k/conf/GENERIC_TINY 1.18-1.19
sys/arch/newsmips/conf/GENERIC 1.50-1.51
sys/arch/ofppc/conf/GENERIC 1.56-1.57
sys/arch/pmax/conf/GENERIC 1.103-1.104
sys/arch/prep/conf/GENERIC 1.55-1.56
sys/arch/sbmips/conf/GENERIC 1.11-1.12
sys/arch/sgimips/conf/GENERIC 1.7-1.8
sys/arch/sparc/conf/GENERIC 1.138-1.139
sys/arch/sparc64/conf/GENERIC32 1.46-1.47
sys/arch/vax/conf/GENERIC 1.102-1.103
sys/arch/x68k/conf/ALL 1.55-1.56
sys/arch/x68k/conf/GENERIC 1.80-1.81
sys/lkm/netinet/if_ipl/mln_ipl.c 1.29
sys/netinet/fil.c 1.57-1.58
sys/netinet/ip_auth.c 1.29-1.30
sys/netinet/ip_compat.h 1.30-1.31
sys/netinet/ip_fil.c 1.81-1.86
sys/netinet/ip_fil.h 1.46-1.49
sys/netinet/ip_frag.c 1.33-1.34
sys/netinet/ip_frag.h 1.18
sys/netinet/ip_ftp_pxy.c 1.25-1.26
sys/netinet/ip_h323_pxy.c 1.5-1.6
sys/netinet/ip_log.c 1.22-1.23
sys/netinet/ip_nat.c 1.51-1.53
sys/netinet/ip_nat.h 1.27
sys/netinet/ip_netbios_pxy.c 1.4
sys/netinet/ip_proxy.c 1.35-1.36
sys/netinet/ip_proxy.h 1.18
sys/netinet/ip_state.c 1.41-1.42
sys/netinet/ip_state.h 1.23
sys/netinet/ipl.h 1.14
 1.10.4.1 09-May-2005  riz Pull up revision 1.13 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.18 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.17 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.16 27-Jan-2020  kim Skip inet6 addresses that begin with fe80: (not just exact match).
 1.15 13-Aug-2018  christos branches: 1.15.2;
handle v6 addresses
 1.14 19-Oct-2016  christos branches: 1.14.12; 1.14.14;
Adjust for new ifconfig address/mask output.
 1.13 12-Sep-2013  christos branches: 1.13.8;
wait until our local address is available before configuring.
 1.12 14-Jun-2013  christos if ipsec_flags is given, treat it as an interface name and change @LOCAL_ADDR@
to the IP address for it. This makes dynamic addresses work during autoconf.
Also while here in restart, re-use start and stop instead of duplicating them.
 1.11 22-Nov-2008  tsutsui branches: 1.11.8; 1.11.14;
Add "bootconf" to REQUIRE: lines which had beforenetlkm
since removed beforenetlkm required bootconf.
 1.10 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.9 06-Apr-2007  apb branches: 1.9.12;
* Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.6 19-Sep-2000  lukem - 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
 1.5 21-Jul-2000  lukem - fix typo; the first ipsec_start() should be ipsec_prestart()
- if ipsec.conf isn't readable and the system is booting directly to multiuser,
send SIGTERM to the parent (/etc/rc) so that init(8) aborts the boot.
 1.4 17-Jul-2000  lukem * remove bogus comment about aborting the boot if ipsec.conf doesn't exist;
this hasn't really worked and is probably too messy to resolve...
 1.3 14-Jun-2000  itojun branches: 1.3.2; 1.3.4;
typo
 1.2 13-Jun-2000  itojun TODO; should check /etc/ipsec.conf owner/permission,
while we don't have find(1).
 1.1 13-Jun-2000  itojun add rc.d/ipsec for ipsec configuration. when enabled, it will inject
/etc/ipsec.conf into "setkey -f". PR 9609.
 1.3.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 14-Jun-2000  minoura file ipsec was added on branch minoura-xpg4dl on 2000-06-23 15:46:02 +0000
 1.3.2.2 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.2.1 09-Aug-2000  lukem pull up revs 1.4-1.5
approved by: thorpej

- if ipsec.conf isn't readable and the system is booting directly to multiuser,
send SIGTERM to the parent (/etc/rc) so that init(8) aborts the boot.
- fix typo; the first ipsec_start() should be ipsec_prestart()
 1.9.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.11.14.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.14.1 23-Jun-2013  tls resync from head
 1.11.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.8.1 04-Nov-2016  pgoyette Sync with HEAD
 1.14.14.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.14.14.1 10-Jun-2019  christos Sync with HEAD
 1.14.12.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.15.2.1 31-Jan-2020  martin Pull up following revision(s) (requested by kim in ticket #676):

etc/rc.d/ipsec: revision 1.16

Skip inet6 addresses that begin with fe80: (not just exact match).
 1.1 30-Apr-2006  rpaulo Add a script to start irdaattach on boot.
 1.2 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.1 08-Feb-2006  agc branches: 1.1.20;
Add distribution entries and supporting files for the iSCSI target.
 1.1.20.1 17-Jan-2009  mjf Sync with HEAD.
 1.3 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.2 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.1 21-Feb-2015  joerg Add rc script for /sbin/iscsid.
 1.5 25-Dec-2023  kre Clean up obsolere test(1) -a option/operator - use sh && instead.
Take the opportunity to do a little sh formatting cleanups, the \
line continuation can ususually be avoided by placing sh operators at
the appropriate places.

Note the [ x"$var" = x"$other" ] usage no longer needs the 'x',
avoiding that kind of nonsense is partly why test was much more
precisely specified, and a lot of the unnecessary stuff made obsolete.
Those however I did not remove (they're harmless).
 1.4 22-Jul-2023  mlelstv Don't specify a volume alias if none is given instead of using a default
name. Otherwise iscsictl fails for using non-unique names if more than
one volume is used.
 1.3 18-Feb-2023  mlelstv Handle missing auth file.
Skip empty lines.
 1.2 06-Feb-2023  martin If /etc/iscsi/volumes does not exist, explicitly exit with 0 status
 1.1 03-Feb-2023  mlelstv Add start script to attach iscsi volumes at boot.

The default is to execute the script (iscsid_volumes=YES), so if you have
any volumes defined, you should also start iscsid (iscsid=YES) to avoid
error messages.
 1.11 23-Sep-2018  maxv Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
 1.10 13-Aug-2004  mycroft branches: 1.10.92; 1.10.94;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.9 10-Apr-2002  martin Now that isdnd does auto-UP/DOWN itself, remove it from the rc.d script.
Remove all related rc.conf options as well, we now have fine-grained
controll in /etc/isdn/isdnd.rc.
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.6 16-Mar-2002  martin Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
 1.5 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.4 26-Apr-2001  lukem minor cleanup. add note to why syslogd is here (a la note in ppp)
 1.3 08-Jan-2001  martin Supply enough rope to let the user disable or override all interface
up/down magic.
 1.2 07-Jan-2001  martin Don't fiddle with any isdn interface if the isdnd variable is set to NO
in rc.conf.

Actually do install the isdnd script.
 1.1 07-Jan-2001  martin Add startup script for isdnd.
 1.10.94.1 10-Jun-2019  christos Sync with HEAD
 1.10.92.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.1 17-Dec-2011  tsutsui branches: 1.1.4;
Add an rc.d(8) script for isibootd(8). Taken from ndbootd(8).
 1.1.4.2 17-Apr-2012  yamt sync with head
 1.1.4.1 17-Dec-2011  yamt file isibootd was added on branch yamt-pagecache on 2012-04-17 00:02:59 +0000
 1.7 16-Jan-2008  lukem branches: 1.7.2;
Ensure kdc starts after syslogd and ntpdate.
 1.6 13-Aug-2004  mycroft branches: 1.6.16;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.3 18-Jan-2001  thorpej The KDC requires only the network. Anyone running a KDC with
the binary on NFS deserves to lose.
 1.2 19-Sep-2000  lukem - 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
 1.1 06-Aug-2000  thorpej branches: 1.1.2;
Startup script glue for the Heimdal KDC.
 1.1.2.3 02-Oct-2000  lukem pull up rev 1.2 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.1.2.2 06-Aug-2000  thorpej Update from trunk:
Startup script glue for the Heimdal KDC.
 1.1.2.1 06-Aug-2000  thorpej file kdc was added on branch netbsd-1-5 on 2000-08-06 21:39:04 +0000
 1.6.16.1 23-Mar-2008  matt sync with HEAD
 1.7.2.2 16-Jan-2008  lukem Ensure kdc starts after syslogd and ntpdate.
 1.7.2.1 16-Jan-2008  lukem file kdc was added on branch mjf-devfs on 2008-01-16 23:58:27 +0000
 1.5 06-Aug-2000  thorpej Startup script glue for the Heimdal KDC.
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.1 06-Aug-2000  thorpej Update from trunk:
Startup script glue for the Heimdal KDC.
 1.9 26-Nov-2021  sborrill Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 03-Jun-2004  abs add rcvar
 1.6 08-Jan-2003  jhawk branches: 1.6.2;
Run ldconfig with ${rc_flags} so you can set ldconfig_flags in rc.conf
to specify additional a.out directories to merge into the runtime link
cache.
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 25-Apr-2001  lukem store path to ldconfig in a variable and reference that
 1.3 29-Sep-2000  fvdl Mention "a.out" in the start message to be clear about the purpose of
this script.
 1.2 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.6.2.1 07-Jun-2004  tron Pull up revision 1.7 (requested by abs in ticket #455):
add rcvar
 1.1 13-Jan-2011  kefren add ldpd rc script
 1.9 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.8 13-Aug-2004  mycroft branches: 1.8.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 08-Oct-2002  atatat Reorganize the sysdb script so that lkm{1,2,3} can request that the
dev database be rebuilt after loading modules. Loading modules might
create new nodes in /dev, but the dev database is being initialized
too soon for lkm2 and lkm3. This means that, eg, /dev/xf86 (typically
marked AFTERMOUNT and loaded by lkm2) will show up properly. Reviewed
by lukem.
 1.6 09-Oct-2000  nisimura Use && and || for logical concatenations instead of -a/-o test operators.
 1.5 19-Sep-2000  lukem - 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
 1.4 21-Aug-2000  lukem `REQUIRE bootconf' in lkm1 rather than `BEFORE beforenetlkm' in bootconf.sh
 1.3 15-Jul-2000  lukem share the same load_rc_config between the lkm* scripts
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.3 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2.4.2 23-Aug-2000  lukem pull up rev 1.4
`REQUIRE bootconf' in lkm1 rather than `BEFORE beforenetlkm'
in bootconf.sh

approved: thorpej
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.7 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.6 13-Aug-2004  mycroft branches: 1.6.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 08-Oct-2002  atatat Reorganize the sysdb script so that lkm{1,2,3} can request that the
dev database be rebuilt after loading modules. Loading modules might
create new nodes in /dev, but the dev database is being initialized
too soon for lkm2 and lkm3. This means that, eg, /dev/xf86 (typically
marked AFTERMOUNT and loaded by lkm2) will show up properly. Reviewed
by lukem.
 1.4 19-Sep-2000  lukem - 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
 1.3 15-Jul-2000  lukem share the same load_rc_config between the lkm* scripts
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.2 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.6.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.9 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.8 13-Aug-2004  mycroft branches: 1.8.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 08-Oct-2002  atatat Reorganize the sysdb script so that lkm{1,2,3} can request that the
dev database be rebuilt after loading modules. Loading modules might
create new nodes in /dev, but the dev database is being initialized
too soon for lkm2 and lkm3. This means that, eg, /dev/xf86 (typically
marked AFTERMOUNT and loaded by lkm2) will show up properly. Reviewed
by lukem.
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 19-Sep-2000  lukem - 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
 1.4 15-Jul-2000  lukem share the same load_rc_config between the lkm* scripts
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 11-Mar-2000  veego Add missing checkyesno's.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.2 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.3 26-Jan-2021  martin Rename etc/rc.d/llvmlockdir to lvmlockdir - it has nothing to do with LLVM,
the name probably was a freudian slip of my fingers when I split that
fragment out of another rc.d script.
 1.2 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.1 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 21-Aug-2000  lukem support running /etc/rc.shutdown.local
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 13-Apr-2000  lukem as this script is primarily for compatibility (with people's
rc.local), call it in a way that is compatible with the old behaviour:
* remove the stop case
* don't set $1="start" in the start case

xxx: it's debatable if this script should even exist, but i digress ;-)
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.1 23-Aug-2000  lukem pull up rev 1.5:
support running /etc/rc.shutdown.local

approved: thorpej
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.8 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.7 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.6 04-Jul-2020  skrll Trailing whitespace
 1.5 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.4 13-Apr-2009  haad We need writable /dev to get lvm working otherwise lvm devices can't be created.
 1.3 05-Mar-2009  haad When setting LV_LIST variable do not use $LV_LIST.
 1.2 20-Jan-2009  haad branches: 1.2.2;
Rework lvm rc.d script. Check active flag for selected LV not for the first
one. Remove dmtest function.

Most changes are based on feedback from salo@.
 1.1 14-Jan-2009  haad branches: 1.1.2;
Add lvm rc script for starting LV's during boot. starting lvm is turn off
by default, until MKLVM is enabled by default. This script can be used
without /usr/bin.
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 14-Jan-2009  mjf file lvm was added on branch mjf-devfs2 on 2009-01-17 20:43:44 +0000
 1.2.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1 26-Jan-2021  martin Rename etc/rc.d/llvmlockdir to lvmlockdir - it has nothing to do with LLVM,
the name probably was a freudian slip of my fingers when I split that
fragment out of another rc.d script.
 1.4 29-Aug-2012  wiz Use new makemandb -Q flag to be really quiet.
 1.3 17-Jun-2012  isaki Remove unnecessary checkyesno which I commited before.
${rcvar}_start is skipped if rcvar is not set to YES.
Pointed out by joerg@ and tsutsui@.
Should be pulled up to netbsd-6.
 1.2 12-Jun-2012  isaki Allows you to disable it if makemandb=NO in rc.conf.
Thanks tsutsui@ and Yasushi Oshima.
 1.1 07-Feb-2012  joerg branches: 1.1.2; 1.1.4;
Import the new apropos/whatis.

This code has been developed by Abhinav Upadhyay as part of Google's Summer
of Code 2011. It uses libmandoc to parse man pages and builds a Full
Text Index in a SQLite database. The combination of indexing the full
manual page, filtering out stop words and ranking individual matches
based on the section gives a much improved user experience.

The old makewhatis and friends are kept under MKMAKEMANDB=no for now.
 1.1.4.3 30-Oct-2012  yamt sync with head
 1.1.4.2 17-Apr-2012  yamt sync with head
 1.1.4.1 07-Feb-2012  yamt file makemandb was added on branch yamt-pagecache on 2012-04-17 00:02:59 +0000
 1.1.2.2 20-Nov-2012  riz Pull up following revision(s) (requested by tron in ticket #676):
usr.sbin/makemandb/apropos.c: revision 1.7
usr.sbin/makemandb/makemandb.8: revision 1.3
usr.sbin/makemandb/makemandb.8: revision 1.4
usr.sbin/makemandb/makemandb.8: revision 1.5
etc/rc.d/makemandb: revision 1.4
etc/weekly: revision 1.29
usr.sbin/makemandb/makemandb.c: revision 1.10
usr.sbin/makemandb/makemandb.c: revision 1.11
usr.sbin/makemandb/makemandb.c: revision 1.12
usr.sbin/makemandb/makemandb.c: revision 1.13
usr.sbin/makemandb/makemandb.c: revision 1.14
usr.sbin/makemandb/apropos.1: revision 1.5
etc/daily: revision 1.87
Add HISTORY section. From Abhinav Upadhyay in private mail.
Sync with reality, From Abhinav Upadhyay in private mail.
Fix typo in a message.
Bug fix for PR 46733:
> makemandb always reports the same number for "Total Number of new or
> updated pages enountered" and "Total number of (hard or symbolic)
> links found".
Patch from Abhinav Upadhyay.
Sort options in SYNOPSIS.
Sync usage with manpage.
Add -Q flag:
Print only fatal error messages (i.e., when the database is left in
an inconsistent state and needs manual intervention).
From Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
Use new makemandb -Q flag to be really quiet.
Fix usage, from Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
Use emalloc in one more place, like the rest of the code does.
From Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
 1.1.2.1 24-Jun-2012  jdc Pull up revisions:
src/etc/rc.d/makemandb revisions 1.2,1.3
(requested by isaki in ticket #350).

Allows you to disable it if makemandb=NO in rc.conf.
Thanks tsutsui@ and Yasushi Oshima.

Remove unnecessary checkyesno which I commited before.
${rcvar}_start is skipped if rcvar is not set to YES.
Pointed out by joerg@ and tsutsui@.
 1.6 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.5 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.4 04-Jul-2020  skrll Trailing whitespace
 1.3 15-Oct-2015  roy Make mdnsd start before NETWORKING and require staticroute, mountcritlocal
and networking.
Fixes PR install/43313.
 1.2 23-Jan-2010  drochner fix an obvious typo in directory check
 1.1 29-Sep-2009  tsarna Multicast DNS ("Bonjour") support, based on Apple's mDNSResponder.
 1.10 16-Mar-2007  abs Ignore comment (starting with #) lines in mixerctl.conf
 1.9 11-Oct-2004  christos branches: 1.9.10;
Use new style command substitution.
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 11-Jan-2004  uebayasi Set an rcvar so that this can really be configurable by the rcvar. (This
means that it has long been not be able to do so!)
 1.6 18-Aug-2003  tron Don't use depricated "-f" option to mixerctl(1). Patch supplied by
Bruce J.A. Nourish in PR misc/22524.
 1.5 12-Oct-2002  kent /etc/rc.d/mixerctl: Add capability to save and restore mixer settings.
Thanks to Julio Merino.
 1.4 16-Jul-2002  rafal Skip blank lines in the input file (mixerctl.conf).
 1.3 11-Jun-2002  lukem - at least require mountcritremote (mixerctl is in /usr)
- read from < mixerctl.conf instead of piping output of cat...
 1.2 02-Jun-2002  jmcneill Fix typo.
 1.1 02-Jun-2002  jmcneill Add boot script to load mixer settings from /etc/mixerctl.conf, if present.
This allows one to preserve mixer settings across reboots by running:
mixerctl -a >/etc/mixerctl.conf
 1.9.10.1 31-Mar-2007  bouyer Pull up following revision(s) (requested by abs in ticket #525):
etc/rc.d/mixerctl: revision 1.10
Ignore comment (starting with #) lines in mixerctl.conf
 1.2 06-Apr-2015  mlelstv Parse config file like ifconfig.if(5).
First word is always the module name, followed by options.
Load modules right after root filesystem is checked and before it
becomes writable.
 1.1 21-Mar-2015  jmcneill branches: 1.1.2;
Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
 1.1.2.3 16-May-2015  snj Pull up following revision(s) (requested by mlelstv in ticket #779):
etc/rc.d/modules: revision 1.2
Parse config file like ifconfig.if(5).
First word is always the module name, followed by options.
Load modules right after root filesystem is checked and before it
becomes writable.
 1.1.2.2 26-Mar-2015  martin Pull up following revision(s) (requested by jmcneill in ticket #635):
etc/rc.d/Makefile: revision 1.92
distrib/sets/lists/man/mi: revision 1.1497
share/man/man5/Makefile: revision 1.71
etc/defaults/rc.conf: revision 1.132
etc/rc.d/modules: revision 1.1
usr.sbin/postinstall/postinstall: revision 1.190
distrib/sets/lists/etc/mi: revision 1.236
etc/mtree/special: revision 1.152
share/man/man5/modules.conf.5: revision 1.1
Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
 1.1.2.1 21-Mar-2015  martin file modules was added on branch netbsd-7 on 2015-03-26 10:54:35 +0000
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.11 11-Sep-2020  kim Make a ": " suffix a fixed part of the release info tag

This results in correct updates to /etc/motd even when the value of
motd_release_tag is changed (a likely event).

Add safe quoting to outputting the read kernel version.

Thanks to kre@ for the feedback.
 1.10 11-Sep-2020  kim Add optional release info in /etc/motd

My personal preferencese for /etc/rc.conf:

update_motd_release=YES
motd_release_tag='Binaries: '

This provides an explanation to users about the second version in motd.
 1.9 13-Aug-2004  mycroft branches: 1.9.86; 1.9.96;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 25-Apr-2001  lukem wrap file creation operation in: ( umask 022 ; <command...> )
 1.6 09-Oct-2000  nisimura - Remove extra 'rm -f' since file redirect safely clobbers existing files.
- Remove one sed invocation replacing it with shell internal construct.
 1.5 19-Sep-2000  lukem - 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
 1.4 31-Jul-2000  chuck if update_motd is set, do not gratuitously force it to have an empty line
in it. also be a bit smarter about deleting stuff from motd during
update. it is now possible to have a one line motd just like in SunOS.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.3 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2.4.2 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2.4.1 01-Aug-2000  chuck pull up 1.3->1.4 changes (approved by thorpej)
 1.9.96.1 13-Sep-2020  martin Pull up following revision(s) (requested by kim in ticket #1080):

etc/rc.d/motd: revision 1.10
etc/rc.d/motd: revision 1.11
share/man/man5/rc.conf.5: revision 1.186
share/man/man5/rc.conf.5: revision 1.187
etc/defaults/rc.conf: revision 1.159

Add optional release info in /etc/motd

My personal preferencese for /etc/rc.conf:

update_motd_release=YES
motd_release_tag='Binaries: '

This provides an explanation to users about the second version in motd.

Document update_motd_release and motd_release_tag

New sentence, new line.

Make a ": " suffix a fixed part of the release info tag

This results in correct updates to /etc/motd even when the value of
motd_release_tag is changed (a likely event).

Add safe quoting to outputting the read kernel version.

Thanks to kre@ for the feedback.
 1.9.86.1 13-Sep-2020  martin Pull up following revision(s) (requested by kim in ticket #1603):

etc/rc.d/motd: revision 1.10
etc/rc.d/motd: revision 1.11
share/man/man5/rc.conf.5: revision 1.186
share/man/man5/rc.conf.5: revision 1.187
etc/defaults/rc.conf: revision 1.159

Add optional release info in /etc/motd

My personal preferencese for /etc/rc.conf:

update_motd_release=YES
motd_release_tag='Binaries: '

This provides an explanation to users about the second version in motd.

Document update_motd_release and motd_release_tag

New sentence, new line.

Make a ": " suffix a fixed part of the release info tag

This results in correct updates to /etc/motd even when the value of
motd_release_tag is changed (a likely event).

Add safe quoting to outputting the read kernel version.

Thanks to kre@ for the feedback.
 1.15 09-Mar-2021  sborrill Need to explicitly load value of zfs variable as zfs=YES may be set in
/etc/rc.conf.d/zfs, not /etc/rc.conf.
 1.14 16-Feb-2021  hannken Enable "/etc/zfs/exports" from "zfs share" in rc.d/mountd and rc.d/mountall.
 1.13 01-Mar-2020  roy mountall: Mount ZFS filesystems before fstab

This allows null mounts in fstab to reference fstab mounts.
It's highly unlikely ZFS mounts would reference anything outside of ZFS.
 1.12 23-Feb-2020  riastradh If zfs=YES, unconditioally do zfs mount/unmount -a.

If you set zfs=YES, presumably you positively want the automatic rc.d
actions, so if there's no /sbin/zfs or if zfs can't find pools with
/etc/zfs/zpool.cache, presumably you would like feedback about that
in rc.log.
 1.11 15-Sep-2019  brad Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.10 08-Jun-2018  sevan branches: 1.10.2; 1.10.4;
Prior to ZFSv15, volinit was an undocumented command which could be used to
populate /dev with zvol device nodes.
Following on with the recent ZFS/DTrace update, this is no longer a valid option
and causes the mountall script to barf zfs usage() following from
unrecognized command 'volinit' error.
 1.9 22-Jul-2014  wiz branches: 1.9.22;
'file system' for consistency with documentation (instead of 'filesystem').
 1.8 18-Oct-2009  haad branches: 1.8.12; 1.8.24;
Add zfs volinit command, suggested by tnn@ this will initialize all zvols
defined in a system. So they can be mounted from fstab as regular block
devices.
 1.7 05-Oct-2009  haad Add support for mounting zfs filesystems to mountall script. ZFS configuration
is stored in /etc/zpool.cache and it is automatically loaded to kernel from
filesystem. Filesystems are then configured accordingly to their properties
loaded from cache file.
 1.6 01-Dec-2008  tsutsui /etc/rc.d/mountall should obviously REQUIRE mountcritremote, and
may also REQUIRE named and ypbind for NFS hostname in fstab(5).
 1.5 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.4 13-Aug-2004  mycroft branches: 1.4.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.3 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 27-Apr-2000  veego Use the stop_cmd to unmount the filesystems with 'umount -a'.
This helps to fix the unclean reboots (at least on my system).
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.24.1 10-Aug-2014  tls Rebase.
 1.8.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.22.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10.4.3 09-Mar-2021  martin Pull up following revision(s) (requested by sborrill in ticket #1230):

etc/rc.d/mountall: revision 1.15

Need to explicitly load value of zfs variable as zfs=YES may be set in
/etc/rc.conf.d/zfs, not /etc/rc.conf.
 1.10.4.2 25-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #725):

etc/rc.d/mountall: revision 1.12
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.59
external/cddl/osnet/sys/kern/misc.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.5
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.6
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.60
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.61

Define VOP_STRATEGY on zfs device nodes too.
Fixes eternal hangs in attempts to do I/O on device nodes on zfs.
XXX pullup

Teach zfs spec nodes to VOP_BWRITE too.
Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.
XXX pullup

Teach device nodes on zfs to handle fsync by calling spec_fsync too.
If zfs=YES, unconditioally do zfs mount/unmount -a.

If you set zfs=YES, presumably you positively want the automatic rc.d
actions, so if there's no /sbin/zfs or if zfs can't find pools with
/etc/zfs/zpool.cache, presumably you would like feedback about that
in rc.log.

Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!

Mark previous #ifdef __NetBSD__, per request from hannken.
 1.10.4.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.10.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.17 20-Feb-2022  alnsn Enable critical_filesystems_zfs.
 1.16 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.15 23-Jul-2016  kre Cause rc to abort if mounting any of the critical local filesystems fails
rather than just ignoring the error.

Don't bother attempting to clear the contents of /var/run if /var/run
does not exist.

In that case the mkdir of /var/run/lvm would have failed - correct that
by using mkdir -p (which as a side effect will ensure /var/run exists
and is available for later scripts to use if for some reason it did not exist.)
 1.14 22-Jul-2014  wiz branches: 1.14.6;
'file system' for consistency with documentation (instead of 'filesystem').
 1.13 13-Jan-2011  haad branches: 1.13.12; 1.13.24;
Use chown now when it's available without /usr mounted.
 1.12 08-Jan-2011  haad Use /rescue/chown not chown from /usr/sbin which might not be available in
time of running this script.

XXX. Why is chown in /usr/sbin ? it should be moved to /sbin
 1.11 05-Jan-2011  haad Allow operator to use lvm in read-only mode. Switch LVM lock dir to
/var/run/lvm and create it in rc.d/mountcritlocal. Fix dm control device
permissions to allow rw for operator.

Test if we are running lvm commands as operator and if that it's true do not
create vg backups and do not print confusing warning.
 1.10 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.9 12-Nov-2006  christos branches: 1.9.28;
goodbye uucp
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 29-Apr-2002  lukem don't bother warning or supporting obsolete $critical_filesystems_beforenet
or $critical_filesystems; postinstall now checks for these
 1.6 27-Mar-2002  lukem Replace $critical_filesystems_beforenet with $critical_filesystems_local .
Replace $critical_filesystems with $critical_filesystems_remote .

The new names are now consistent with the type argument that
mount_critical_filesystems() is called with, and allows for other types to
be easily supported by that function.

For backwards compatibility purposes, if the now obsolete variable is defined
(even empty), it takes precedence over the new form, and you will be warned.
If you want to stop the warnings, update your rc.conf(5) settings!
 1.5 28-Feb-2001  lukem clarify purposes
 1.4 27-Jul-2000  lukem move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.9.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.13.24.1 10-Aug-2014  tls Rebase.
 1.13.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.6.1 26-Jul-2016  pgoyette Sync with HEAD
 1.11 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.10 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.9 22-Jul-2014  wiz 'file system' for consistency with documentation (instead of 'filesystem').
 1.8 13-Aug-2004  mycroft branches: 1.8.56; 1.8.70;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 29-Apr-2002  lukem don't bother warning or supporting obsolete $critical_filesystems_beforenet
or $critical_filesystems; postinstall now checks for these
 1.6 27-Mar-2002  lukem Replace $critical_filesystems_beforenet with $critical_filesystems_local .
Replace $critical_filesystems with $critical_filesystems_remote .

The new names are now consistent with the type argument that
mount_critical_filesystems() is called with, and allows for other types to
be easily supported by that function.

For backwards compatibility purposes, if the now obsolete variable is defined
(even empty), it takes precedence over the new form, and you will be warned.
If you want to stop the warnings, update your rc.conf(5) settings!
 1.5 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.4 28-Feb-2001  lukem clarify purposes
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.70.1 10-Aug-2014  tls Rebase.
 1.8.56.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14 16-Feb-2021  hannken Enable "/etc/zfs/exports" from "zfs share" in rc.d/mountd and rc.d/mountall.
 1.13 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.12 13-Aug-2004  mycroft branches: 1.12.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.11 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.10 16-Jun-2001  lukem change mountd to use its own $mountd variable (instead of $nfs_server).
nfsd will complain if mountd isn't set. from [misc/13135] by Johnny C. Lam.
 1.9 29-Apr-2001  lukem kre notes that "echo -n" is superfluous when creating a zero length file
 1.8 25-Apr-2001  lukem wrap file creation operation in: ( umask 022 ; <command...> )
 1.7 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.6 02-Jun-2000  fvdl branches: 1.6.2;
* Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.5 29-May-2000  bouyer Depends on quota; when quotached runs while NFS clients are writing,
bad things happens.
 1.4 13-May-2000  lukem branches: 1.4.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 11-Mar-2000  veego mountd requires mountall.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.12.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 29-Oct-2001  augustss Add moused, default off.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 19-Sep-2000  lukem - 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
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.29 10-Jul-2024  christos account for filter-aaaa.so rename and move
 1.28 25-Dec-2023  kre branches: 1.28.2;

Clean up obsolete test(1) usage - use sh's || instead of test's obsolete -o,
and sh's && instead of test's obsolete -a.

Minor formatting cleanups, including removing unneeded \ line continuations.

The somewhat bizarre way that named_migrate() was made to work in a
subshell (which of itself is fine, and looks needed) has been made more
rational. Because of that, the need to use local vars is no longer there,
(subshells can't affect the parent) and "local" in that func could be deleted
(but hasn't been).
 1.27 31-Mar-2021  christos handle copying of plugins to the chroot
 1.26 04-Jul-2020  skrll Trailing whitespace
 1.25 13-Jul-2014  tls Make named and the rest of BIND seed their RNG from /dev/urandom, not /dev/random. Better would be to rip the enormous gonkulating RNG machinery out of libisc entirely. Later.
 1.24 08-Jul-2014  spz create /etc/rndc.key on start if it doesn't already exist
 1.23 01-Oct-2012  christos branches: 1.23.8;
PR/47024: Taylor R Campbell: handle "keys" directory and directory
permissions in general
 1.22 03-Aug-2009  perry branches: 1.22.6; 1.22.8; 1.22.10; 1.22.12;
ntpdate can't work without named because a modern ntp.conf has dns
names in it. We therefore now depend on it.

However, this would have then created a circular dependency because named
depended on "SERVERS", and racoon was before SERVERS and required kdc,
and kdc needs the time to be right and thus depended on ntp.

Instead, have named depend on NETWORKING (so that there is a network
there), mountcritremote (so we know that named has a directory to work
from) and syslogd (so that named has some place to spew information).

I'm not sure this is perfect, but it is certainly a big improvement
over constantly failing ntpdate runs during boot.
 1.21 25-Apr-2009  christos handle new directory structure.
 1.20 24-Apr-2009  christos PR/41273: Martin Mersberger: missing '/' in /etc/rc.d/named in section
named_migrate
 1.19 22-Apr-2009  christos Adjust for new default location of the pid file.
 1.18 29-Nov-2005  christos branches: 1.18.28; 1.18.30; 1.18.32; 1.18.34;
fix migration problems:
1. missing slash created namedb127 files in the dest dir.
2. /etc/named.conf was not getting migrated.
 1.17 17-Jul-2005  christos Improve on the migration bit. Check if files are different, and if not,
remove the source and leave a symlink behind. Otherwise, let the user know.
 1.16 17-Jul-2005  christos Copy and link files to allow a chrooted named to start-up automatically.
 1.15 17-Mar-2005  tron Replace hardcoded "/var/run/named.pid" with ${pidfile}.
 1.14 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.13 21-May-2004  christos create /dev/random when chrooted.
 1.12 18-Dec-2003  christos prepare for bind 9.
 1.11 18-Jun-2002  lukem Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.10 22-Mar-2002  thorpej branches: 1.10.2;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.9 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.8 11-Oct-2001  lukem if named_chrootdir is set, always repoint the /var/run/named.pid and
/var/run/ndc symlinks, because named_chrootdir might change between
restarts and the symlinks weren't getting updated correctly in the old code.
 1.7 12-Mar-2001  lukem if $named_chrootdir != "", ensure that the following files, devices,
and links exist:
${named_chrootdir}/usr/libexec/named-xfer
${named_chrootdir}/dev/null
${named_chrootdir}/etc/localtime
/var/run/named.pid -> ${named_chrootdir}/var/run/named.pid
/var/run/ndc -> ${named_chrootdir}/var/run/ndc
and then start named with the appropriate options to run chroot(2)ed
under $named_chrootdir as user named group named.

to take advantage of this, an admin should copy /etc/namedb ->
${named_chrootdir}/etc/namedb, and set named_chrootdir in /etc/rc.conf.

[dev/null & etc/localtime setup inspired by openbsd. i already had the rest]
 1.6 19-Sep-2000  lukem - 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
 1.5 13-May-2000  lukem branches: 1.5.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.4 13-May-2000  lukem only support reload as an extra command; there's too much special case
code that needs to be implemented to make this script totally replicate
what /usr/sbin/ndc does.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5.4.1 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.10.2.1 18-Jun-2002  lukem Pull up revision 1.11 (requested by lukem in ticket #316):
Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.18.34.1 21-Apr-2010  matt sync to netbsd-5
 1.18.32.1 10-Jan-2011  riz Pull up following revision(s) (requested by tron in ticket #1519):
etc/rc.d/named: revision 1.21
etc/rc.d/named: revision 1.19
Adjust for new default location of the pid file.
handle new directory structure.
 1.18.30.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.18.28.2 07-Jan-2011  riz Pull up following revision(s) (requested by tron in ticket #1519):
etc/rc.d/named: revision 1.21
etc/rc.d/named: revision 1.19
Adjust for new default location of the pid file.
handle new directory structure.
 1.18.28.1 15-Nov-2009  snj branches: 1.18.28.1.2;
Pull up following revision(s) (requested by dholland in ticket #1146):
etc/rc.d/named: revision 1.20
PR/41273: Martin Mersberger: missing '/' in /etc/rc.d/named in section
named_migrate
 1.18.28.1.2.1 09-Jan-2011  riz Pull up following revision(s) (requested by tron in ticket #1519):
etc/rc.d/named: revision 1.21
etc/rc.d/named: revision 1.19
Adjust for new default location of the pid file.
handle new directory structure.
 1.22.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.10.1 01-Nov-2012  matt sync with netbsd-6-0-RELEASE.
 1.22.8.1 09-Oct-2012  riz Pull up following revision(s) (requested by christos in ticket #587):
etc/rc.d/named: revision 1.23
PR/47024: Taylor R Campbell: handle "keys" directory and directory
permissions in general
 1.22.6.1 30-Oct-2012  yamt sync with head
 1.23.8.1 10-Aug-2014  tls Rebase.
 1.28.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 22-May-2001  fredette sunndd has been renamed to ndbootd.
 1.85 16-Oct-2020  kim network: Update rtsol options

- Use "-6" instead of "--noipv4" as it seems more appropriate based on
the dhcpcd(8) manual page.
- Remove "-f /dev/null" as it seems unnecessary with "-6".
- Remove "--persistent" as it is in the default /etc/dhcpcd.conf,
and this way the user can change it, if they would like to (either
through dhcpcd_flags or by editing /etc/dhcpcd.conf).

The "-b" (or "--background") option is needed to avoid a timeout error
message (and a delay in booting), so it is still left in place.
 1.84 15-Oct-2020  kim Update "rtsol" keyword: leave IPv6 autoconf on

There is no need to turn off ipv6_autoconf or dhcp6 in dhcpcd to match
the previous behaviour with in-kernel RA processing.
 1.83 11-Oct-2020  kim Make "rtsol" functional again.
 1.82 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.81 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.80 04-Jul-2020  skrll Trailing whitespace
 1.79 12-Jun-2020  roy Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).
 1.78 15-Apr-2020  kim Add an "rtsol" keyword to ifconfig.if for enabling IPv6 RS/RA
 1.77 22-Feb-2020  roy rc.d/network: improve wording of waiting for DAD to finish
 1.76 23-Oct-2018  mrg branches: 1.76.2;
only flush routes in stop routine if flushroutes is true, same as
the start up.
 1.75 27-Jul-2018  roy Allow rc.conf to setup resolv.conf via resolvconf(8).
This allows all static network config to be in rc.conf rather than
spread across files.
 1.74 29-Jun-2018  roy Remove dhclient from the base system.

Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
 1.73 06-Jul-2017  kre branches: 1.73.4; 1.73.6;

Revert previous - not a typo, even though it looks like one
 1.72 06-Jul-2017  kre PR misc/52370

Correct typo.

XXX pullup 8, pullup 7
 1.71 06-Mar-2016  christos branches: 1.71.8;
use kat, a version of cat that strips comments
 1.70 07-Jan-2016  roy Instead of waiting for a duration based in IPv6 DAD count sysctl,
wait for 15 seconds for tentative flags to clear allowing 5 seconds
for detached flags to clear as well from configured addresses.

This is now protocol independant and allows time for the interfaces to
work out if they have a carrier or not.
 1.69 14-Oct-2014  christos fix syntax error
 1.68 21-Sep-2014  roy Use checkyesnox to test rtsol as it has been removed including its
default configuration which we should not warn about.
 1.67 11-Sep-2014  roy Remove rtsol(8) and rtsold(8) as their functionality is in dhcpcd(8).
Remove rtsol(8) from rc.d/network.
Add -w seconds command to ifconfig to wait for N seconds for until DAD
has finished on all addresses.
Use ifconfig -w in rc.d/network instead of a forced sleep.

As discussed on tech-net@
 1.66 29-Apr-2014  uebayasi Indent.
 1.65 29-Apr-2014  uebayasi Refactor a little to remove huge indents.
 1.64 29-Apr-2014  uebayasi Split huge monolithic functions for readability.
 1.63 20-Apr-2013  christos branches: 1.63.6;
don't attempt to create interfaces that exist and don't hide errors.
 1.62 02-Nov-2012  yamt print something before sleeping so that a user like me can see
what the mysterious pause is.
 1.61 26-Sep-2010  apb branches: 1.61.6; 1.61.12;
Collapse <abckslash><newline> sequences in /etc/ifconfig.xxx files read
by /etc/rc.d/network. Fixes PR 41662 by Christoph Badura, which was
also reported independently by Jeremy C. Reed.
 1.60 11-Sep-2009  cegger backout rev. 1.59. Will be re-done differently.
 1.59 08-Sep-2009  cegger Do not flush routes if root file system is nfs mounted.
Fixes boot problem when the nfs server is in a different subnet.
 1.58 14-May-2009  roy Only start dhcpcd per interface if not running the full dhcpcd daemon.
Only stop dhcpcd pre interface if it's running for the interface.

Fixes PR bin/40320
 1.57 11-Oct-2008  christos branches: 1.57.2; 1.57.8;
eval arguments one more time so that quoting works.
 1.56 26-Sep-2008  apb Move default route configuration after interface alias address
configuration, in case people have default routes over aliased
addresses.
 1.55 20-Sep-2008  apb remove an unecessary "eval"
 1.54 20-Sep-2008  apb * Allow multiple commands in $ifconfig_xxN variables in rc.conf(5).
This may be done either by embedding newlines in the value,
or by using semicolons to represent line breaks (but not both at once).
* Allow shell quoting insode $ifconfig_xxN variables or /etc/ifconfig.xxN
files. This allows something like ifconfig_wi0="ssid 'my network'; dhcp"
 1.53 24-Jul-2008  reed Use absolute path for various /sbin tools.
This is consistent with several other rc.d scripts
and fixes problem with /sbin not in PATH.

(Tested several times for over three weeks, but not all
parts of this code were used by me.)
 1.52 29-May-2008  joerg Allow per-interface DHCP configuration using dhcpcd via
ifconfig_xxN=dhcp or a dhcp line in /etc/ifconfig.xxN.
 1.51 10-Feb-2007  reed branches: 1.51.12; 1.51.14; 1.51.16;
Fix typo/mispelling in comment.
 1.50 24-Nov-2005  rpaulo RFC 3879 deprecated the IPv6 site-local prefix (fec0::/10):
* remove all references to $ip6sitelocal and output a warning
message if the variable is defined.
* introduce $ip6uniquelocal (defaults to 'NO') that will control the
behaviour of the system when $ip6mode is ``router'' (i.e. fc00::/7
will not be routed if the variable is ``NO'') as per RFC 4193.

Thanks to Jonathan A. Kollasch for pointing this out in PR 32152.
 1.49 28-Jun-2005  symka PR/29317: ifconfig.if does not allow parameters with spaces

OKeyd by christos@
 1.48 26-Apr-2005  cjs Make ifaliases_lo0 in rc.conf work just like other interfaces (instead of
being ignored). Also, when configuring aliases set as ifaliases_xxN,
print out the interface name and the alias address.
 1.47 12-Oct-2004  lukem branches: 1.47.2;
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.46 11-Oct-2004  christos Use new style command substitution.
 1.45 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.44 12-Oct-2003  jdc branches: 1.44.4;
Allow an IPv6 default route to be set from /etc/mygate6 or $defaultroute6.
Approved by itojun@.
 1.43 09-Jan-2003  christos revert previous; luke and matt want this as a separate script.
 1.42 09-Jan-2003  christos Add /etc/route.conf processing to add static routes. Removes one more
reason for netstart.local.
 1.41 07-Jan-2003  tron Revert last change for now. It causes hangs during system shutdown when
NFS filesystems are mounted.
 1.40 06-Jan-2003  tron Add keyword "shutdown" so that this script is really executed on system
shutdown to delete clone interfaces.
 1.39 05-Oct-2002  tron Automatically create and destroy cloning interfaces and sync IP Filter
immediately afterwards before bringing the interface up. This avoids
a small security gap existing in the previous scheme where IP Filter
was synced after all cloning interfaces were created and brought up.
 1.38 04-May-2002  tron branches: 1.38.2;
Sync ipf(4) after starting or stopping. This is necesarry to make filter
rules for dynamically created interfaces like pppoe(4) effective.
 1.37 29-Apr-2002  lukem don't bother warning or supporting obsolete $ip6forwarding;
postinstall now checks for this
 1.36 27-Mar-2002  lukem clean up warning
 1.35 24-Mar-2002  sommerfeld Improve information density of output -- add the dozen -reject routes
with "route -q" since they are always the same and convey no useful
information.

While we're here, use sysctl -qw instead of sysctl -w >/dev/null
 1.34 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.33 22-Jul-2001  wiz seperate -> separate
 1.32 08-Jul-2001  lukem After itojun's recent RTF_CLONED and other changes, it's not necessary to
add a route from an alias address to 127.0.0.1, so remove that code.
It's still necessary to configure lo0 -> 127.0.0.1 though, so emphasize that.
 1.31 02-Mar-2001  itojun comment correction: 127/8 must not leave the node (RFC1122)
 1.30 13-Jan-2001  itojun move IPv6 mode/route configuration upwards, so that !rtsol in
/etc/ifconfig.* is meaningful.
 1.29 11-Jan-2001  itojun extend /etc/ifconfig.xxN, for comment lines (#) and shell script
fragment (!). inspired by openbsd /etc/hostname.xxN.
 1.28 03-Jan-2001  itojun add $ip6sitelocal, to control installation of reject route for fec0::/10.
 1.27 26-Nov-2000  nisimura More cautious about undefined hostname check in terms of what hostname(1)
returns.
 1.26 22-Nov-2000  nisimura I believe in that the facy nested quotes was intended to skip blank
lines, but am not sure it is allowed as a standard practice of the
/etc/ifconfig.xxN file.
 1.25 21-Nov-2000  wiz un-break.
 1.24 21-Nov-2000  lukem minor typo in previous
 1.23 21-Nov-2000  nisimura Shell programming police for sophistication; take #2. Handle the
case when the filename expansion results in no match more gracefully.
Far less costy than invoking a new process.
 1.22 21-Nov-2000  nisimura Shell programming police for sophistication. It's not necessary
to enclose `prog` backquote command substitution with double quotes
as it produces a quoted string. Other changes are pending this time.
 1.21 17-Nov-2000  lukem - replace `IFS='.'; set -- $int; echo $2` with ${int##*.}
- can't use $configured_interfaces in network_stop(), so use `ifconfig -lu`
instead
 1.20 09-Oct-2000  nisimura - avoid -a or -o logical operator of test command as possible. They would
introduce syntaxical ambiguousity, and having concatenation with && or
|| costs nothing because our sh(1) has test(1) builtin.
- use elif construct to avoid dungling else-ifs.
- while-read construct does not need enclosed by a sub-shell.
- variable detection could be done in eval args=\$ifconfig_$int
- smart variable substitution occationally saves lines and extra command
invocations.
 1.19 21-Aug-2000  lukem REQUIRE ipfilter and ipsec
 1.18 02-Aug-2000  itojun fix comment on DAD wait
 1.17 01-Aug-2000  itojun we need to sleep for IPv6 DAD period, before and after rtsol.
(they are for stability in boot-time configuration)
comment from perry.
 1.16 25-Jul-2000  jdolecek the format without netmask is supported for compatibility only and not
specifying it is discouradged, actually
also add comments about this fact to etc/rc.d/network, for people who
don't read manpages :)
 1.15 20-Jul-2000  thorpej Build a list of cloning network interfaces to configure, as well
as normal interfaces.
 1.14 17-Jul-2000  lukem reenable stop_cmd now that network doesn't get run at shutdown
 1.13 20-Jun-2000  itojun remove ip6defaultif configuration. because:
- ndp is in /usr/sbin, chokes on NFS-mounted /usr installation
- the option is just for IPv6 specification geek, not for normal users
 1.12 20-Jun-2000  enami Don't warn that $hostname isn't set if the hostname is already set.
 1.11 13-May-2000  lukem branches: 1.11.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.10 09-May-2000  itojun do not let 127.0.0.0/8 leave the node. based on RFC1122.
 1.9 29-Apr-2000  veego Fix the last change so it doesn't fail due too a missing '; then'.
 1.8 28-Apr-2000  thorpej Don't warn about $hostname not being set if $dhclient == YES; it's quite
likely that we'll be getting the hostname via DHCP when it runs.
 1.7 20-Apr-2000  itojun rtsol is not a daemon. rtsol.d should have been killed by rc.d/rtsold.
(correct me if i'm wrong)
 1.6 11-Apr-2000  lukem make `stop' a no-op, so that the network doesn't disappear at an
inconvenient time during boot.

this may be fixed a different way in the long term... (not that the old
rc.shutdown supported stopping the network, or could i really see a
practical use for allowing it at this stage, but in the future someone
might want the functionality i've just disabled).
 1.5 08-Apr-2000  tsarna The file /etc/sysctl.conf is now run with sysctl -f at boot time.
This replaces the previous /etc/rc.d/sysctl. Also, the variables are now
set earlier, between ipf/ipnat and the network coming up.

The rc.conf defcorename and securelevel variables are no more. You can
set them directly in sysctl.conf now.
 1.4 17-Mar-2000  itojun correct reject route installations for IPv6. improve comments.
 1.3 12-Mar-2000  itojun disallow packets to malicious 6to4 prefix, based on
http://playground.iijlab.net/i-d/draft-itojun-ipv6-transition-abuse-00.txt
 1.2 11-Mar-2000  veego Fix the network_stop function so it doesn't fails due to missing ]['s.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.11.4.7 02-May-2001  he Pull up revisions 1.29-1.30 (via patch, requested by itojun):
Add support for "!" and "#" syntax in /etc/ifconfig.*.
 1.11.4.6 20-Mar-2001  he Pull up revision 1.15 (requested by bouyer):
Add support for cloning network devices (e.g. vlan). Fixes
PR#12398.
 1.11.4.5 23-Aug-2000  lukem pull up rev 1.19:
REQUIRE ipfilter and ipsec

approved: thorpej
 1.11.4.4 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.11.4.3 03-Aug-2000  itojun pullup 1.16 -> 1.18 (approved by releng-1-5)

> we need to sleep for IPv6 DAD period, before and after rtsol.
> (they are for stability in boot-time configuration)
> comment from perry.
 1.11.4.2 25-Jul-2000  jdolecek pullup rev. 1.16 from trunk (approved by thorpej):
for ifaliases, add some comments about format without netmask beeing supported
for compatibility only
 1.11.4.1 20-Jun-2000  itojun remove ip6defaultif configuration, which is not for common installation.
approved by: releng-1-5
 1.38.2.2 05-Jun-2004  jmc Pullup rev 1.44 (requested by itojun in ticket #1704)

Allow an IPv6 default route to be set from /etc/mygate6 or $defaultroute6.
 1.38.2.1 23-Oct-2002  lukem Pull up revision 1.39 (requested by tron in ticket #901):
Automatically create and destroy cloning interfaces and sync IP Filter
immediately afterwards before bringing the interface up. This avoids
a small security gap existing in the previous scheme where IP Filter
was synced after all cloning interfaces were created and brought up.
 1.44.4.2 05-Jul-2005  riz Pull up revision 1.49 (requested by symka in ticket #2038):
PR/29317: ifconfig.if does not allow parameters with spaces
OKeyd by christos@
 1.44.4.1 09-May-2005  riz Pull up revision 1.47 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.47.2.1 02-Jul-2005  tron Pull up revision 1.49 (requested by symka in ticket #511):
PR/29317: ifconfig.if does not allow parameters with spaces
OKeyd by christos@
 1.51.16.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.51.16.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.51.14.1 04-Jun-2008  yamt sync with head
 1.51.12.3 17-Jan-2009  mjf Sync with HEAD.
 1.51.12.2 05-Oct-2008  mjf Sync with HEAD.
 1.51.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.57.8.1 21-Apr-2010  matt sync to netbsd-5
 1.57.2.2 07-Jan-2011  riz Pull up following revision(s) (requested by enami in ticket #1504):
share/man/man8/rc.subr.8: revision 1.27
etc/rc.subr: revision 1.86
share/man/man5/ifconfig.if.5: revision 1.14
etc/rc.d/network: revision 1.61
Add a collapse_backslash_newline function to rc.subr.
Collapse <abckslash><newline> sequences in /etc/ifconfig.xxx files read
by /etc/rc.d/network. Fixes PR 41662 by Christoph Badura, which was
also reported independently by Jeremy C. Reed.
 1.57.2.1 18-May-2009  bouyer Pull up following revision(s) (requested by roy in ticket #757):
etc/rc.d/network: revision 1.58
Only start dhcpcd per interface if not running the full dhcpcd daemon.
Only stop dhcpcd pre interface if it's running for the interface.
Fixes PR bin/40320
 1.61.12.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.61.12.2 23-Jun-2013  tls resync from head
 1.61.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.61.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.61.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.63.6.1 10-Aug-2014  tls Rebase.
 1.71.8.2 23-Apr-2020  martin Pull up following revision(s) (requested by kim in ticket #1538):

usr.sbin/rtsold/rtsold.8: revision 1.37
usr.sbin/rtsold/rtsold.8: revision 1.38
usr.sbin/rtsold/rtsold.8: revision 1.39
share/man/man5/ifconfig.if.5: revision 1.20
etc/rc.d/network: revision 1.77
etc/rc.d/network: revision 1.78 (plus patch)
usr.sbin/rtsold/rtsold.8: revision 1.40
usr.sbin/rtsold/rtsold.8: revision 1.41
usr.sbin/rtsold/rtsold.8: revision 1.42
share/man/man5/ifconfig.if.5: revision 1.19

Add rtsol to the NAME section as well

rc.d/network: improve wording of waiting for DAD to finish

Revert unrelated changes to prior

Use .Dl for one line literal display. Add SEE ALSO.

Remove trailing dot in SEE ALSO.

Add an "rtsol" keyword to ifconfig.if for enabling IPv6 RS/RA

Sort SEE ALSO.

Update date
 1.71.8.1 23-Apr-2020  martin Pull up following revision(s) (requested by kim in ticket #1537):

share/man/man5/rc.conf.5: revision 1.172
etc/rc.d/network: revision 1.75

Allow rc.conf to setup resolv.conf via resolvconf(8).

This allows all static network config to be in rc.conf rather than
spread across files.
 1.73.6.3 21-Apr-2020  martin Sync with HEAD
 1.73.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.73.6.1 10-Jun-2019  christos Sync with HEAD
 1.73.4.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.73.4.1 28-Jul-2018  pgoyette Sync with HEAD
 1.76.2.1 22-Apr-2020  martin Pull up following revision(s) (requested by kim in ticket #838):

share/man/man5/ifconfig.if.5: revision 1.20
etc/rc.d/network: revision 1.78 (plus patch)
usr.sbin/rtsold/rtsold.8: revision 1.42

Add an "rtsol" keyword to ifconfig.if for enabling IPv6 RS/RA

Sort SEE ALSO.
Update date
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 24-Mar-2002  lukem remove unnecessary precmd
 1.4 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.3 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.2 18-Aug-2001  ad Make newsyslog at boot optional, as it should have been.
 1.1 21-Sep-2000  ad Provide the option of running newsyslog at boot time; mainly for laptop
people.
 1.7 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.6 11-Oct-2004  lukem Explicitly REQUIRE: rpcbind since these services directly use RPC...
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 16-Jun-2001  lukem branches: 1.4.6;
change mountd to use its own $mountd variable (instead of $nfs_server).
nfsd will complain if mountd isn't set. from [misc/13135] by Johnny C. Lam.
 1.3 02-Jun-2000  fvdl * Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.2 13-May-2000  lukem branches: 1.2.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.6.1 09-May-2005  riz Pull up revision 1.7 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.2 15-Apr-2000  tsarna Death to nfsiod!

It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.8 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 24-Mar-2002  lukem branches: 1.6.6;
also check $rc_force != "" to determine if operation should occur
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 15-Apr-2000  tsarna Death to nfsiod!

It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.6.1 09-May-2005  riz Pull up revision 1.8 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.8 05-Oct-2023  abs Add support to npf_rules to rc.conf

- Allows overriding default from /etc/npf.conf
- Indicate rules file used in output
- Drop check for file presence in script - rely on npf exiting with error
 1.7 08-Sep-2020  martin branches: 1.7.6;
Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.6 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.5 04-Jul-2020  skrll Trailing whitespace
 1.4 19-Apr-2019  leot Do not start npf again at reboot (it is started via npf_boot)
 1.3 01-Nov-2012  mrg branches: 1.3.32;
catch up with npfctl moving to /sbin.
untested, but i guess so was the move itself ;)
 1.2 07-Mar-2011  jmcneill branches: 1.2.4; 1.2.6; 1.2.10;
put a : in an otherwise empty function, makes this script work with bash
 1.1 02-Feb-2011  rmind branches: 1.1.2;
NPF checkpoint:
- Add libnpf(3) - a library to control NPF (configuration, ruleset, etc).
- Add NPF support for ftp-proxy(8).
- Add rc.d script for NPF.
- Convert npfctl(8) to use libnpf(3) and thus make it less depressive.
Note: next clean-up step should be a parser, once dholland@ will finish it.
- Add more documentation.
- Various fixes.
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 02-Feb-2011  bouyer file npf was added on branch bouyer-quota2 on 2011-02-08 16:18:50 +0000
 1.2.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.6.1 29-Nov-2012  riz Pull up following revision(s) (requested by rmind in ticket #726):
etc/rc.d/npf: revision 1.3
distrib/sets/lists/base/mi: revision 1.1010
usr.sbin/npf/npfctl/Makefile: revision 1.9
distrib/sets/lists/comp/mi: revision 1.1785
put in /sbin
catch up with npfctl moving to /sbin.
untested, but i guess so was the move itself ;)
mv npfctl from /usr/sbin to /sbin so it is available before /usr is mounted.
 1.2.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.3.32.1 10-Jun-2019  christos Sync with HEAD
 1.7.6.1 13-Oct-2023  martin Pull up following revision(s) (requested by abs in ticket #404):

etc/rc.d/npf: revision 1.8
etc/defaults/rc.conf: revision 1.167

Add support to npf_rules to rc.conf
- Allows overriding default from /etc/npf.conf
- Indicate rules file used in output
- Drop check for file presence in script - rely on npf exiting with error
 1.6 30-Nov-2021  sborrill Revert previous. Explicitly load the value of npf or pf
 1.5 26-Nov-2021  sborrill Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.
For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.
 1.4 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.3 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.2 05-Oct-2019  sevan No need to empose the script to be runnable during boot time, it prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by <pgoyette> for NPF but the issue is there in PF too.
 1.1 02-Apr-2019  sevan branches: 1.1.2; 1.1.4;
Add an initial ruleset and rc script for NPF to protect host during early stage
of boot, similar to what is currently available for PF.
 1.1.4.3 26-Nov-2021  martin Backout previous pullup from ticket #1377:

etc/rc.d/npf_boot: revision 1.5
etc/rc.d/pf_boot: revision 1.8
 1.1.4.2 26-Nov-2021  martin Pull up following revision(s) (requested by sborrill in ticket #1377):

etc/rc.d/npf_boot: revision 1.5
etc/rc.d/pf_boot: revision 1.8

Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.

For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist
Then:
/etc/rc.d/npf_boot rcvar
outputs:
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES
Then:
/etc/rc.d/npf_boot rcvar
outputs:
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.
 1.1.4.1 06-Oct-2019  martin Pull up following revision(s) (requested by sevan in ticket #288):

etc/rc.d/npf_boot: revision 1.2
etc/rc.d/pf_boot: revision 1.5

No need to empose the script to be runnable during boot time, it
prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by <pgoyette> for NPF but the issue is there in PF too.
 1.1.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.2.2 10-Jun-2019  christos Sync with HEAD
 1.1.2.1 02-Apr-2019  christos file npf_boot was added on branch phil-wifi on 2019-06-10 21:42:45 +0000
 1.2 05-Jun-2020  christos Add support for npfd_flags
 1.1 05-Jan-2017  christos branches: 1.1.2;
add scripts for npfd
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 05-Jan-2017  pgoyette file npfd was added on branch pgoyette-localcount on 2017-01-07 08:53:48 +0000
 1.17 04-Jul-2020  skrll Trailing whitespace
 1.16 23-Nov-2015  christos PR/49380: KAMADA Ken'ichi: ntpd_chrootdir does not work on NetBSD 7.0_BETA
Provide /etc/resolv.conf so that it can resolve names. This is needed because
of deferred name resolution.
XXX: pullup -7
 1.15 25-Dec-2014  spz new ntpd wants to be able to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot
 1.14 04-Dec-2012  prlw1 branches: 1.14.10;
Make sure that ntpd creates a pid file for the rc machinery to work.
http://mail-index.netbsd.org/current-users/2012/11/19/msg021518.html
 1.13 13-Aug-2004  mycroft branches: 1.13.34; 1.13.42; 1.13.50; 1.13.52; 1.13.56; 1.13.58; 1.13.60; 1.13.62;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.12 31-Mar-2004  fredb Backout last change. I failed to note that the problem described in
PR bin/24653 had already been fixed with revision 1.9 of this file.
 1.11 31-Mar-2004  fredb Take account of the fact that "ntpd" writes it's pidfile after chroot().
Closes PR bin/24653.
 1.10 02-Jul-2002  itohy Check for /dev/clockctl availability and print appropriate diagnosis if not.
 1.9 18-Jun-2002  lukem Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.8 17-Jun-2002  lukem ntpd_chrootdir needs /dev/clockctl as well
 1.7 15-Jun-2002  lukem $ntpd_chroot requires "pseudo-device clockctl" in the kernel
 1.6 22-Mar-2002  thorpej branches: 1.6.2;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.4 18-Jan-2002  lukem if $ntpd_chrootdir != "", ensure that the following files, devices,
and links exist:
${ntpd_chrootdir}/dev/clockctl
/var/db/ntp.drift -> ${ntpd_chrootdir}/var/db/ntp.drift
and then start ntpd with the appropriate options to run chroot(2)ed
under $ntpd_chrootdir as user ntpd group ntpd.

to take advantage of this, set ntpd_chrootdir in /etc/rc.conf.

[this is based on similar work i did for rc.d/named]
 1.3 19-Sep-2000  lukem - 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
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 02-May-2000  simonb Out with the old, in with the new.
 1.2.4.1 02-Oct-2000  lukem pull up rev 1.3 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.2.3 18-Jun-2002  lukem Pull up revision 1.9 (requested by lukem in ticket #316):
Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.6.2.2 18-Jun-2002  lukem Pull up revision 1.8 (requested by lukem in ticket #294):
ntpd_chrootdir needs /dev/clockctl as well
 1.6.2.1 15-Jun-2002  lukem Pull up revision 1.7 (requested by lukem in ticket #277):
$ntpd_chroot requires "pseudo-device clockctl" in the kernel
 1.13.62.1 28-Dec-2014  he The new ntpd wants to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot.
[mlelstv, ticket 1223]
 1.13.60.1 07-Jan-2015  msaitoh Pull up following revision(s) (requested by he in ticket #1940):
etc/rc.d/ntpd: revision 1.15
new ntpd wants to be able to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot
 1.13.58.1 28-Dec-2014  he The new ntpd wants to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot.
[mlelstv, ticket 1223]
 1.13.56.1 25-Feb-2013  tls resync with head
 1.13.52.1 28-Dec-2014  he The new ntpd wants to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot.
[mlelstv, ticket 1223]
 1.13.50.1 16-Jan-2013  yamt sync with (a bit old) head
 1.13.42.1 07-Jan-2015  msaitoh Pull up following revision(s) (requested by he in ticket #1940):
etc/rc.d/ntpd: revision 1.15
new ntpd wants to be able to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot
 1.13.34.1 07-Jan-2015  msaitoh Pull up following revision(s) (requested by he in ticket #1940):
etc/rc.d/ntpd: revision 1.15
new ntpd wants to be able to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot
 1.14.10.1 29-Dec-2014  martin Pull up following revision(s) (requested by mlelstv in ticket #355):
etc/rc.d/ntpd: revision 1.15
new ntpd wants to be able to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot
 1.21 25-Dec-2020  martin Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.
 1.20 03-Aug-2009  perry branches: 1.20.40; 1.20.50;
Explicitly set a BEFORE on ntpd, as this can't run while ntpd is
running.

Apparently it is rare for rcorder to place it after ntpd but there was
previously nothing actually preventing it.

Fixes PR 40707 by Ondrej Tuma
 1.19 03-Aug-2009  perry ntpdate can't work without named because a modern ntp.conf has dns
names in it. We therefore now depend on it.

However, this would have then created a circular dependency because named
depended on "SERVERS", and racoon was before SERVERS and required kdc,
and kdc needs the time to be right and thus depended on ntp.

Instead, have named depend on NETWORKING (so that there is a network
there), mountcritremote (so we know that named has a directory to work
from) and syslogd (so that named has some place to spew information).

I'm not sure this is perfect, but it is certainly a big improvement
over constantly failing ntpdate runs during boot.
 1.18 15-Mar-2005  lukem Explicitly REQUIRE mountcritremote, since this uses awk.
 1.17 11-Oct-2004  christos Use new style command substitution.
 1.16 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.15 04-Dec-2003  drochner ntpdate to a multicastclient address doesn't work
 1.14 29-Oct-2003  fredb Make the ntp.conf parsing more specific, and therefore more robust. Closes
PR bin/23305.
 1.13 20-Oct-2003  fredb Supply the usual default setting of $commmand. Omission pointed out by
Launey Thomas in private mail.
 1.12 19-Oct-2003  fredb Allow for a syntax extension for "ntp.conf" with ntp 4.2.0.
 1.11 19-Oct-2003  fredb Use "$command", instead of hard-coded "ntpdate", so that the user can
override the path using the usual mechanisms.
 1.10 27-Jun-2003  lukem Support "multicastclient" directives in ntp.conf.
Based on [bin/17930] from Stoned Elipot.
 1.9 19-Jul-2002  bad Ignore "peer" statements for local clocks too when selecting hosts from
ntp.conf.
 1.8 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.7 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.6 19-Sep-2000  lukem - 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
 1.5 21-Aug-2000  abs Move options into ntp_flags, to make it possible to add '-u' without
modifying rc.d/ntpdate
 1.4 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 11-Mar-2000  veego Add missing checkyesno's.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.3 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.4.2 21-Aug-2000  abs Move options into 'ntp_flags', to make it possible to add '-u'
without having to modify rc.d/ntpdate
Pullup, approved by thorpej:
etc/rc.conf 1.93
etc/rc.d/ntpdate 1.5
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.20.50.1 28-Dec-2020  snj Pull up following revision(s) (requested by martin in ticket #1164):

etc/rc.d/ntpdate: revision 1.21

Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.
 1.20.40.1 28-Dec-2020  snj Pull up following revision(s) (requested by martin in ticket #1643):

etc/rc.d/ntpdate: revision 1.21

Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.
 1.8 03-Jul-2015  dholland /usr/sbin/chown -> /sbin/chown
(not sure why these need explicit paths at all, but whatevs)
 1.7 04-Dec-2007  mjf branches: 1.7.4;
Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
 1.6 15-Feb-2007  tron branches: 1.6.4;
Remove unnessary "if [ X"$foo" ... ]" hack which is not necessary if
you quote things properly which this script does.
 1.5 15-Feb-2007  xtraeme Add missing quotes in readlink to compare with ${per_user_tmp_dir}/@uid,
to avoid an error about missing operator.
 1.4 06-Feb-2007  elad Use 0555 for the real tmp dir for now.
 1.3 05-Feb-2007  elad Only override /tmp if needed. From perry@.
 1.2 04-Feb-2007  xtraeme Use mkdir -p to create ${per_user_tmp_dir}, otherwise if /private (this is
the default) doesn't exist there won't be any error.
 1.1 04-Feb-2007  elad Add support for per-user /tmp.

Enabled via per_user_tmp in /etc/rc.conf (default off).

See security(8) and rc.conf(5) for more details.

Lots of input from thorpej@ & christos@, thanks!
 1.6.4.1 09-Jan-2008  matt sync with HEAD
 1.7.4.2 04-Dec-2007  mjf Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
 1.7.4.1 04-Dec-2007  mjf file perusertmp was added on branch mjf-devfs on 2007-12-04 22:09:02 +0000
 1.14 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.13 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.12 04-Jul-2020  skrll Trailing whitespace
 1.11 29-Jun-2018  roy Remove dhclient from the base system.

Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
 1.10 21-Nov-2011  darcy branches: 1.10.40; 1.10.42;
Allow pf flags to be specified in rc.conf.
Add default to defaults/rc.d as suggested by lukem@
 1.9 22-Nov-2008  tsutsui branches: 1.9.8;
Add "bootconf" to REQUIRE: lines which had beforenetlkm
since removed beforenetlkm required bootconf.
 1.8 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.7 06-Apr-2007  apb branches: 1.7.12;
* Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.6 23-Aug-2005  peter pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.

Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.

No objections on: tech-security
 1.5 10-Aug-2005  peter Changes suggested by lukem:

1. Order pf to start before the network is configured.

2. If the pf_rules cannot be found at boot time, abort the boot (from the
ipfilter script).
 1.4 07-Aug-2005  peter Allow to change the location of the pf ruleset with the variable $pf_rules.
 1.3 15-Mar-2005  peter branches: 1.3.2;
Do a "flush all" when disabling pf. This also changes the restart case
to do a "flush all", while the reload case will only reload the rules without
flushing anything.

Suggested by Miles Nordin.
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 29-Jun-2004  itojun rc.d fragment for PF. Peter Postma
 1.3.2.3 02-Sep-2005  tron Pull up following revision(s) (requested by peter in ticket #717):
usr.sbin/pf/man/man5/pf.boot.conf.5: revision 1.1
usr.sbin/postinstall/postinstall: revision 1.4
etc/rc.d/pf: revision 1.6
etc/rc.d/pf_boot: revision 1.1
usr.sbin/pf/etc/defaults/pf.boot.conf: revision 1.1
usr.sbin/pf/Makefile: revision 1.7
etc/rc.d/Makefile: revision 1.52
etc/mtree/special: revision 1.89
usr.sbin/pf/man/man5/Makefile: revision 1.5
usr.sbin/pf/etc/defaults/Makefile: revision 1.1
pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.
Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.
No objections on: tech-security
 1.3.2.2 02-Sep-2005  tron Pull up following revision(s) (requested by peter in ticket #717):
etc/rc.d/pf: revision 1.5
Changes suggested by lukem:
1. Order pf to start before the network is configured.
2. If the pf_rules cannot be found at boot time, abort the boot (from the
ipfilter script).
 1.3.2.1 15-Aug-2005  tron Pull up revision 1.4 (requested by peter in ticket #660):
Allow to change the location of the pf ruleset with the variable $pf_rules.
 1.7.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.8.1 17-Apr-2012  yamt sync with head
 1.10.42.1 10-Jun-2019  christos Sync with HEAD
 1.10.40.1 28-Jul-2018  pgoyette Sync with HEAD
 1.9 30-Nov-2021  sborrill Revert previous. Explicitly load the value of npf or pf
 1.8 26-Nov-2021  sborrill Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.
For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.
 1.7 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.6 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.5 05-Oct-2019  sevan No need to empose the script to be runnable during boot time, it prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by <pgoyette> for NPF but the issue is there in PF too.
 1.4 22-Nov-2008  tsutsui branches: 1.4.50; 1.4.52;
Add "bootconf" to REQUIRE: lines which had beforenetlkm
since removed beforenetlkm required bootconf.
 1.3 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.2 06-Apr-2007  apb branches: 1.2.12;
* Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process. The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
 1.1 23-Aug-2005  peter branches: 1.1.2;
pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.

Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.

No objections on: tech-security
 1.1.2.2 02-Sep-2005  tron Pull up following revision(s) (requested by peter in ticket #717):
usr.sbin/pf/man/man5/pf.boot.conf.5: revision 1.1
usr.sbin/postinstall/postinstall: revision 1.4
etc/rc.d/pf: revision 1.6
etc/rc.d/pf_boot: revision 1.1
usr.sbin/pf/etc/defaults/pf.boot.conf: revision 1.1
usr.sbin/pf/Makefile: revision 1.7
etc/rc.d/Makefile: revision 1.52
etc/mtree/special: revision 1.89
usr.sbin/pf/man/man5/Makefile: revision 1.5
usr.sbin/pf/etc/defaults/Makefile: revision 1.1
pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.
Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.
No objections on: tech-security
 1.1.2.1 23-Aug-2005  tron file pf_boot was added on branch netbsd-3 on 2005-09-02 12:29:37 +0000
 1.2.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.52.3 26-Nov-2021  martin Backout previous pullup from ticket #1377:

etc/rc.d/npf_boot: revision 1.5
etc/rc.d/pf_boot: revision 1.8
 1.4.52.2 26-Nov-2021  martin Pull up following revision(s) (requested by sborrill in ticket #1377):

etc/rc.d/npf_boot: revision 1.5
etc/rc.d/pf_boot: revision 1.8

Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.

For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist
Then:
/etc/rc.d/npf_boot rcvar
outputs:
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES
Then:
/etc/rc.d/npf_boot rcvar
outputs:
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.
 1.4.52.1 06-Oct-2019  martin Pull up following revision(s) (requested by sevan in ticket #288):

etc/rc.d/npf_boot: revision 1.2
etc/rc.d/pf_boot: revision 1.5

No need to empose the script to be runnable during boot time, it
prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by <pgoyette> for NPF but the issue is there in PF too.
 1.4.50.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 18-Jun-2008  yamt merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@. requested by core@
 1.2 13-Aug-2004  mycroft branches: 1.2.26; 1.2.28; 1.2.30;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 29-Jun-2004  itojun rc.d fragment for PF. Peter Postma
 1.2.30.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.28.2 05-Jun-2008  peter Create pflog0 only when it doesn't exist.
 1.2.28.1 31-May-2008  peter The pflog(4) device is a cloning device now and thus pflog0 doesn't exist
automatically anymore. Create pflog0 before starting pflogd.
 1.2.26.1 29-Jun-2008  mjf Sync with HEAD.
 1.3 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.2 13-Aug-2004  mycroft branches: 1.2.26;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 14-Jan-2001  minoura Add /etc/rc.d/poffd, for x68k power management deamon.
 1.2.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.3 02-Jun-2000  fvdl * Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.2 13-May-2000  lukem branches: 1.2.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20 25-Dec-2023  kre Do away with the obsolete text(1) -a operator, use sh && instead.
Prefer sh ! operator over test's ! (less question what it means).
A few minor formatting changes.
 1.19 09-Aug-2019  rin little bit verbose for slow machines
 1.18 30-Oct-2016  riastradh branches: 1.18.14; 1.18.16;
Handle variable expansion and comma/space separators in postconf.

From Timo Buhrmester:
https://mail-index.netbsd.org/tech-userlevel/2016/08/20/msg010301.html
 1.17 23-Jul-2015  riz branches: 1.17.2;
Implement "status" command for postfix - makes tools like ansible
happier.
 1.16 15-Apr-2009  perry un-uppercase pseudodependency for the moment so as not to break pkgsrc
 1.15 15-Apr-2009  perry uppercase pseudodependency
 1.14 27-Aug-2007  pavel branches: 1.14.18;
Add some magic (similar to the one in rc.d/sendmail introduced with 2.0
release) to not start postfix if $postfix is not explicitely set and
another mailer is selected in /etc/mailer.conf. Also print a warning if it
happens because the mailer in rc.conf is the removed sendmail.

This prevents starting two MTAs at once if one uses a custom MTA.

As proposed on tech-userlevel, approved by martin.
 1.13 07-Sep-2006  christos branches: 1.13.2; 1.13.4;
make postconf configurable
 1.12 07-Sep-2006  christos - find the correct newaliases program from postconf
(suggested by Geert Hendrickx)
- only check for hash files.
 1.11 05-Sep-2006  christos Find the alias file name from the postfix configuration. From our anonymous
user.
 1.10 18-Jun-2006  christos PR/33760: dieter roelants: a default install can't send mail due to
missing aliases.db
 1.9 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 08-Apr-2004  lukem Store the full path to the /usr/sbin/postfix in $postfix_command
and use the latter postfix_op() to implement start/stop/reload.
(We generally use full paths in rc.d scripts.) Problem noted by Bill Squier.
 1.7 31-Jan-2003  lukem Implement start_cmd as:
start_cmd="${name} "'${rc_arg}'
and stop_cmd & reload_cmd as:
stop_cmd=$start_cmd
reload_cmd=$start_cmd
(Just to be tricky)
 1.6 12-Feb-2002  lukem populate /var/spool/postfix/etc with /etc/{localtime,resolv.conf,services}.
per suggestion from perry.
 1.5 19-Sep-2000  lukem - 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
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem - use checkyesno in $start_precmd and change start_cmd to `postfix start'
- use $extra_commands instead of passing "reload" to run_rc_command
 1.2 27-Apr-2000  veego You need to add a xxx_precmd with a checkyesno yyy if you use a xxx_cmd
in an rc.d script.
 1.1 26-Apr-2000  thorpej Provide rc.d support for the Postfix mail system. Committed to the
base because there is no support for packages in rc.d, and Postfix
is supposed to become part of the base system anyhow.
 1.4.4.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.13.4.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.13.2.1 28-Aug-2007  ghen Pull up following revision(s) (requested by pavel in ticket #845):
etc/rc.d/postfix: revision 1.14
etc/defaults/rc.conf: revision 1.90
Add some magic (similar to the one in rc.d/sendmail introduced with 2.0
release) to not start postfix if $postfix is not explicitely set and
another mailer is selected in /etc/mailer.conf. Also print a warning if it
happens because the mailer in rc.conf is the removed sendmail.
This prevents starting two MTAs at once if one uses a custom MTA.
As proposed on tech-userlevel, approved by martin.
 1.14.18.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.17.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.18.16.1 20-Jun-2020  martin Pull up following revision(s) (requested by rin in ticket #966):

etc/rc.d/postfix: revision 1.19

little bit verbose for slow machines
 1.18.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 18-Apr-2003  thorpej Add an rc script for powerd(8).
 1.11 13-Jan-2013  prlw1 Add ppp=YES variable. Currently pppd(8) starts automatically if ppp_peers
is not empty. Adding a ppp variable allows the default peer to be set,
and ppp set to NO so that dialing can happen with /etc/rc.d/ppp onestart.
Default set to YES so that old behaviour is preserved.
http://mail-index.netbsd.org/tech-userlevel/2012/08/21/msg006656.html
 1.10 13-Dec-2012  wiz Revert previous.
At the least, it was committed with the wrong commit message.
 1.9 04-Dec-2012  prlw1 Make sure that ntpd creates a pid file for the rc machinery to work.
http://mail-index.netbsd.org/current-users/2012/11/19/msg021518.html
 1.8 11-Oct-2004  christos branches: 1.8.50; 1.8.56;
Use new style command substitution.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 11-Feb-2001  fredb Add "hup" and "stop" commands. Closes PR bin/12135.
 1.4 02-Aug-2000  hubertf Adjust comment to what's actually being done
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.2 13-Mar-2001  he Pull up revision 1.5 (requested by fredb):
Add ``stop'' and ``hup'' commands.
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.56.1 25-Feb-2013  tls resync with head
 1.8.50.2 23-Jan-2013  yamt sync with head
 1.8.50.1 16-Jan-2013  yamt sync with (a bit old) head
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.6 26-Nov-2021  sborrill Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 03-Jun-2004  abs Add rcvar="quota"
 1.3 22-Mar-2002  thorpej branches: 1.3.4;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.2 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 07-Jun-2004  tron Pull up revision 1.4 (requested by abs in ticket #455):
Add rcvar="quota"
 1.6 23-Sep-2018  maxv Remove the userland part of ISDN. The kernel part is untouched for now.
ipppctl was actually an exact copy of pppoectl; there is no functional
change in pppoectl in this commit.
 1.5 07-Dec-2004  kleink branches: 1.5.92; 1.5.94;
Add the `shutdown' keyword, giving racoon a chance to flush the SAD
upon termination.
 1.4 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.3 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.2 26-Apr-2001  lukem depend upon isdnd as well
 1.1 18-Jan-2001  thorpej Startup script for racoon(8). Racoon provides "ike", and requires
"kdc" (since you might want to use IPsec on your Kerberos server,
and might be using GSSAPI to authenticate Phase 1) and "ppp" (since
racoon(8) needs to know about all of your network interfaces).
 1.5.94.1 10-Jun-2019  christos Sync with HEAD
 1.5.92.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.12 21-Jul-2022  kre Make this better ... Allow config file for raidN to be found
in /etc/conf/raid/raidN (as well as in /etc/raidN.conf) (less
clutter in /etc).

Allow config files to exist for raids that are autoconfigured (just
skip anything autoconfigured) - this allows a (simplistic) recovery
mechanism if autoconf fails, and makes it simpler to enable/disable
autoconf at will, while keeping the raid working.

While here, add sh quoting where it is needed, and remove it from
where it is pointless.
 1.11 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.10 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.9 13-Aug-2004  mycroft branches: 1.9.36;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 10-Sep-2003  wiz Add a knob to turn off automatic configuration (via rc.d) of
non-auto-configured (via kernel) raid devices. oster says ok.
 1.7 03-Sep-2002  abs Split raidframe parity checking/rebuild out into raidframeparity, which is
called after quota so we don't end up with fsck and raidframe parity rebuild
taking forever after a crash/reboot.
While we are here check for raid[0-9].conf & raid[1-9][0-9].conf not
raid[0-9].conf & raid[0-9][0-9].conf
 1.6 27-Jan-2002  lukem branches: 1.6.2;
use the recently added hw.disknames value from sysctl(8) to determine
the list of currently configured disk devices, and start raid parity
rebuilds on devices which match "raid[0-9]*"
 1.5 17-Nov-2000  lukem start all raid[0-9].conf and raid[0-9][0-9].conf, not just raid[0-3].conf.
do in order, so that raidN.conf is started before raidNN.conf.
 1.4 16-May-2000  oster At boot, initiate parity/mirror reconstruction as required.
This operation is backgrounded, and sequentially ordered.
 1.3 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 26-Apr-2000  thorpej Make ccd and raidframe provide `disks', and make swap1 and fsck
depend on `disks', rather than `ccd' and `raidframe'.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.6.2.1 30-Nov-2002  he Pull up revision 1.7 (requested by abs in ticket #772):
Split raidframe parity checking/rebuilding out into
raidframeparity, which is called after quota, so we don't
end up with fsck and raidframe parity rebuild taking forever
after a crash/reboot.
While here, check for raid[0-9].conf and raid[1-9][0-9].conf
and not raid[0-9].conf and raid[0-9][0-9].conf
 1.9.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.4 15-Apr-2009  joerg Add missing PROVIDE.
 1.3 11-Oct-2004  christos branches: 1.3.36;
Use new style command substitution.
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 03-Sep-2002  abs branches: 1.1.2;
Split raidframe parity checking/rebuild out into raidframeparity, which is
called after quota so we don't end up with fsck and raidframe parity rebuild
taking forever after a crash/reboot.
While we are here check for raid[0-9].conf & raid[1-9][0-9].conf not
raid[0-9].conf & raid[0-9][0-9].conf
 1.1.2.2 30-Nov-2002  he Pull up revision 1.1 (requested by abs in ticket #772):
Split raidframe parity checking/rebuilding out into
raidframeparity, which is called after quota, so we don't
end up with fsck and raidframe parity rebuild taking forever
after a crash/reboot.
While here, check for raid[0-9].conf and raid[1-9][0-9].conf
and not raid[0-9].conf and raid[0-9][0-9].conf
 1.1.2.1 03-Sep-2002  he file raidframeparity was added on branch netbsd-1-6 on 2002-11-30 14:15:27 +0000
 1.3.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.15 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.14 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.13 07-May-2020  riastradh If no random seed file exists on boot, create one.

rndctl -S triggers entropy consolidation, so whatever we gathered
during kernel startup -- interrupt timings, autoconf timings, &c. --
will be incorporated into the seed and into subsequent data read from
/dev/urandom, just like if rndctl -L had run at this boot, and the
seed will carry them into the next boot too.

But it still avoids frequently consolidating entropy on any regular
schedule, in order to continue to mitigate iterative-guessing
attacks.
 1.12 07-May-2020  riastradh Omit needless verbiage in error message.
 1.11 07-May-2020  riastradh Pass full pathname to df, and print warning message on failure.

No need to extract dirname; `df -P /var/db/entropy-file' and `df -l
/var/db/entropy-file' work just fine.
 1.10 06-May-2020  riastradh Tweak logic to decide whether a medium is safe for an rndseed.

- Teach rndctl to load the seed, but treat it as zero entropy, if the
medium is read-only or if the update fails.

- Teach rndctl to accept `-i' flag instructing it to ignore the
entropy estimate in the seed.

- Teach /etc/rc.d/random_seed to:
(a) assume nonlocal file systems are unsafe, and use -i, but
(b) assume / is safe, even if it is nonlocal.
If the medium is nonwritable, leave it to rndctl to detect that.
(Could use statvfs and check for ST_LOCAL in rndctl, I guess, but I
already implemented it this way.)

Treating nonlocal / as safe is a compromise: it's up to the operator
to secure the network for (e.g.) nfs mounts, but that's true whether
we're talking entropy or not -- if the adversary has access to the
network that you've mounted / from, they can do a lot more damage
anyway; this reduces warning fatigue for diskless systems, e.g. test
racks.
 1.9 01-May-2020  riastradh Don't delete the random seed before issuing `rndctl -S'.

`rndctl -S' can replace the file just fine, and deleting it ahead of
time adds a window during which we can lose the seed altogether if
the system is interrupted by a crash or power outage.

XXX pullup
 1.8 23-Feb-2020  riastradh Allow random seed on zfs.
 1.7 22-Jul-2014  wiz branches: 1.7.24; 1.7.26;
'file system' for consistency with documentation (instead of 'filesystem').
 1.6 29-Dec-2012  christos branches: 1.6.8;
better messages, more quoting.
 1.5 17-Dec-2012  apb Reinstate the dirname invocations that were recently removed from
rc.d/random_seed. The new dirname shell function provided by rc.subr
will be used, so it should work before the /usr file system is mounted.

This should fix a problem in which the fs_safe shell function failed when
passed the name of a file that did not exist.
 1.4 14-Dec-2012  apb Avoid using programs from /usr/bin. This should fix PR 47326.

- no need for "dirname", because "df -G" can take a file name directly.
- replace use of "awk" with a shell while read loop.
- replace use of "stat -s" with "ls -ldn".
- no need for "tail" now that the use of "stat" has changed.

While here, also add some shell quotes and improve the grammar in a comment.
 1.3 10-Nov-2012  apb Cause /etc/rc.d/random_seed to be the first script to run
after mountcritlocal. Everything else that runs after
mountcritlocal depends directly or indirectly on bootconf, so
making random_seed run before bootconf has the desired result.
 1.2 08-Jul-2012  hans branches: 1.2.2;
It's msdos, not msdosfs.
 1.1 23-Nov-2011  tls branches: 1.1.4;

Load entropy at system boot (only works at securelevel < 1); save
at system shutdown. Disable with random_seed=NO in rc.conf if desired.

Goes to some trouble to never load or save to network filesystems.

Entropy should really be loaded by the boot loader but I am still
sorting out how to pass it to the kernel.
 1.1.4.5 23-Jan-2013  yamt sync with head
 1.1.4.4 16-Jan-2013  yamt sync with (a bit old) head
 1.1.4.3 30-Oct-2012  yamt sync with head
 1.1.4.2 17-Apr-2012  yamt sync with head
 1.1.4.1 23-Nov-2011  yamt file random_seed was added on branch yamt-pagecache on 2012-04-17 00:02:59 +0000
 1.2.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.2.2 25-Feb-2013  tls resync with head
 1.2.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.8.1 10-Aug-2014  tls Rebase.
 1.7.26.2 02-May-2020  martin Pull up following revision(s) (requested by riastradh in ticket #882):

etc/rc.d/random_seed: revision 1.9

Don't delete the random seed before issuing `rndctl -S'.
`rndctl -S' can replace the file just fine, and deleting it ahead of
time adds a window during which we can lose the seed altogether if
the system is interrupted by a crash or power outage.

XXX pullup
 1.7.26.1 01-Mar-2020  martin Pull up following revision(s) (requested by riastradh in ticket #743):

etc/rc.d/random_seed: revision 1.8

Allow random seed on zfs.
 1.7.24.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 19-Sep-2000  lukem - 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
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6 04-Oct-2023  gutteridge resize_root: quote $rootdev consistently in resize_ffs(8) calls
 1.5 24-May-2020  jmcneill Support resizing wedges
 1.4 06-Oct-2018  jmcneill If fs_spec starts with the special string "ROOT.", replace it with a device
path derived from the value of the kern.root_device sysctl.
 1.3 07-Apr-2015  jmcneill branches: 1.3.2; 1.3.16; 1.3.18;
fix typo in previous; pass -y unconditionally to resize_ffs, not -p
 1.2 06-Apr-2015  jmcneill add KEYWORD: interactive, honour resize_root_flags and resize_root_postcmd rc vars
 1.1 30-Mar-2015  chopps Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
 1.3.18.1 10-Jun-2019  christos Sync with HEAD
 1.3.16.1 20-Oct-2018  pgoyette Sync with head
 1.3.2.2 06-Aug-2015  snj Pull up following revision(s) (requested by skrll in ticket #909):
distrib/sets/lists/etc/mi: revision 1.237
distrib/sets/lists/tests/mi: revision 1.613
distrib/utils/embedded/conf/armv7.conf: revisions 1.1, 1.2
distrib/utils/embedded/conf/beagleboard.conf: delete
distrib/utils/embedded/conf/evbarm.conf: revisions 1.21, 1.22
distrib/utils/embedded/conf/rpi.conf: revisions 1.28, 1.29
distrib/utils/embedded/conf/rpi_inst.conf: revisions 1.7, 1.8
distrib/utils/embedded/conf/usermode.conf: revision 1.5
distrib/utils/embedded/conf/x86.conf: revision 1.5
distrib/utils/embedded/files/resize_disklabel: revision 1.1
distrib/utils/embedded/mkimage: revisions 1.49, 1.55-1.59
etc/defaults/rc.conf: revision 1.133
etc/etc.evbarm/Makefile.inc: revisions 1.72, 1.76
etc/rc.d/Makefile: revision 1.93 via patch
etc/rc.d/resize_root: revisions 1.1-1.3
etc/rc.d/root: revision 1.5
sbin/resize_ffs/Makefile: revision 1.5
sbin/resize_ffs/resize_ffs.8: revisions 1.14-1.16
sbin/resize_ffs/resize_ffs.c: revisions 1.39-1.44
share/man/man5/rc.conf.5: revision 1.158, 1.159
tests/sbin/resize_ffs/Makefile: revision 1.4
tests/sbin/resize_ffs/common.sh: revision 1.14
tests/sbin/resize_ffs/t_check.sh: revision 1.1
tests/sbin/resize_ffs/t_grow.sh: revision 1.9
tests/sbin/resize_ffs/t_grow_swapped.sh: revision 1.3
tests/sbin/resize_ffs/t_shrink.sh: revision 1.8
tests/sbin/resize_ffs/t_shrink_swapped.sh: revision 1.2
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images
--
Make get_dev_size work on regular files too.
--
Use `!= -1' instead of `== 0' out of paranoia.
--
- Add -c to check to see if grow/shrink is required
- Divide by DEV_BSIZE when returning size of file.
- Update manpage
--
New sentence, new line. Sort option descriptions.
--
Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
--
- Add new tests for -c check flag in resize_ffs
--
Bump date for previous.
it's -> its
--
Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().
--
factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.
--
Add support for auto-growing the root partition. Enable it for rpi.img.
--
initialize resize before pulling in board config
--
add KEYWORD: interactive, honour resize_root_flags and
resize_root_postcmd rc vars
--
if the -p flag is specified, display a progress bar while growing the
file-system
--
show resize_ffs progress bar when resizing root partition
--
fix typo in previous; pass -y unconditionally to resize_ffs, not -p
--
Rename beagleboard.img to armv7.img. The new image includes the same
kernels as beagleboard.img plus support for Raspberry Pi 2, ODROID-C1,
Cubieboard2, Cubietruck, Hummingbird A31, and Banana Pi.
--
Properly spell X' name. From X(7):
The X.Org Foundation requests that the following names be
used when
referring to this software:
X
X Window System
X Version 11
X Window System, Version 11
X11
--
Add some documentation:
Tell what this does, and what it expects from conf files
--
Cleanup: make_filesystems is not used any longer, purge remains
--
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.
No more functions from evbarm.conf are used now.
Some variables are still used!
--
define TOOL_MKUBOOTIMAGE for mkimage
--
fix mkubootimage
 1.3.2.1 07-Apr-2015  snj file resize_root was added on branch netbsd-7 on 2015-08-06 21:13:44 +0000
 1.3 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.2 02-Feb-2009  apb branches: 1.2.2; 1.2.4;
The -d or -t flag must appear after -c/-C/-e/-E flags, because of the
way we add the device name. after the flags.
Addresses PR 40495 from Ryo HAYASAKA.
 1.1 04-Jan-2009  apb branches: 1.1.2;
* Add etc/rc.d/rndctl script, based on work by Brian A. Seklecki. This
allows you to invoke rndctl(8) during the boot.
* Add rndctl=NO and rndctl_flags="" to /etc/defaults/rc.conf.
* Document rndctl and rndctl_flags variables in rc.conf(5).
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 04-Jan-2009  mjf file rndctl was added on branch mjf-devfs2 on 2009-01-17 20:43:44 +0000
 1.2.4.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.2.3 06-Feb-2009  snj Pull up following revision(s) (requested by apb in ticket #406):
etc/rc.d/rndctl: revision 1.2
The -d or -t flag must appear after -c/-C/-e/-E flags, because of the
way we add the device name. after the flags.
Addresses PR 40495 from Ryo HAYASAKA.
 1.2.2.2 06-Feb-2009  snj Pull up following revision(s) (requested by apb in ticket #406):
etc/defaults/rc.conf: revision 1.99
etc/rc.d/Makefile: revision 1.73
etc/rc.d/rndctl: revision 1.1
share/man/man5/rc.conf.5: revision 1.127
* Add etc/rc.d/rndctl script, based on work by Brian A. Seklecki. This
allows you to invoke rndctl(8) during the boot.
* Add rndctl=NO and rndctl_flags="" to /etc/defaults/rc.conf.
* Document rndctl and rndctl_flags variables in rc.conf(5).
 1.2.2.1 02-Feb-2009  snj file rndctl was added on branch netbsd-5 on 2009-02-06 00:51:42 +0000
 1.5 30-Mar-2015  chopps Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
 1.4 21-Apr-2009  joerg branches: 1.4.26;
Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.3 13-Aug-2004  mycroft branches: 1.3.36;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.4.26.1 06-Aug-2015  snj Pull up following revision(s) (requested by skrll in ticket #909):
distrib/sets/lists/etc/mi: revision 1.237
distrib/sets/lists/tests/mi: revision 1.613
distrib/utils/embedded/conf/armv7.conf: revisions 1.1, 1.2
distrib/utils/embedded/conf/beagleboard.conf: delete
distrib/utils/embedded/conf/evbarm.conf: revisions 1.21, 1.22
distrib/utils/embedded/conf/rpi.conf: revisions 1.28, 1.29
distrib/utils/embedded/conf/rpi_inst.conf: revisions 1.7, 1.8
distrib/utils/embedded/conf/usermode.conf: revision 1.5
distrib/utils/embedded/conf/x86.conf: revision 1.5
distrib/utils/embedded/files/resize_disklabel: revision 1.1
distrib/utils/embedded/mkimage: revisions 1.49, 1.55-1.59
etc/defaults/rc.conf: revision 1.133
etc/etc.evbarm/Makefile.inc: revisions 1.72, 1.76
etc/rc.d/Makefile: revision 1.93 via patch
etc/rc.d/resize_root: revisions 1.1-1.3
etc/rc.d/root: revision 1.5
sbin/resize_ffs/Makefile: revision 1.5
sbin/resize_ffs/resize_ffs.8: revisions 1.14-1.16
sbin/resize_ffs/resize_ffs.c: revisions 1.39-1.44
share/man/man5/rc.conf.5: revision 1.158, 1.159
tests/sbin/resize_ffs/Makefile: revision 1.4
tests/sbin/resize_ffs/common.sh: revision 1.14
tests/sbin/resize_ffs/t_check.sh: revision 1.1
tests/sbin/resize_ffs/t_grow.sh: revision 1.9
tests/sbin/resize_ffs/t_grow_swapped.sh: revision 1.3
tests/sbin/resize_ffs/t_shrink.sh: revision 1.8
tests/sbin/resize_ffs/t_shrink_swapped.sh: revision 1.2
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images
--
Make get_dev_size work on regular files too.
--
Use `!= -1' instead of `== 0' out of paranoia.
--
- Add -c to check to see if grow/shrink is required
- Divide by DEV_BSIZE when returning size of file.
- Update manpage
--
New sentence, new line. Sort option descriptions.
--
Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
--
- Add new tests for -c check flag in resize_ffs
--
Bump date for previous.
it's -> its
--
Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().
--
factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.
--
Add support for auto-growing the root partition. Enable it for rpi.img.
--
initialize resize before pulling in board config
--
add KEYWORD: interactive, honour resize_root_flags and
resize_root_postcmd rc vars
--
if the -p flag is specified, display a progress bar while growing the
file-system
--
show resize_ffs progress bar when resizing root partition
--
fix typo in previous; pass -y unconditionally to resize_ffs, not -p
--
Rename beagleboard.img to armv7.img. The new image includes the same
kernels as beagleboard.img plus support for Raspberry Pi 2, ODROID-C1,
Cubieboard2, Cubietruck, Hummingbird A31, and Banana Pi.
--
Properly spell X' name. From X(7):
The X.Org Foundation requests that the following names be
used when
referring to this software:
X
X Window System
X Version 11
X Window System, Version 11
X11
--
Add some documentation:
Tell what this does, and what it expects from conf files
--
Cleanup: make_filesystems is not used any longer, purge remains
--
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.
No more functions from evbarm.conf are used now.
Some variables are still used!
--
define TOOL_MKUBOOTIMAGE for mkimage
--
fix mkubootimage
 1.11 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.10 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.9 18-Aug-2011  uwe Revert previous as it introduces "Circular dependency on provision
`mountcritremote'".

route6d is "BEFORE: NETWORKING" and was made to "REQUIRE: mountcritremote",
but mountcritremote "REQUIRE: NETWORKING".
 1.8 17-Aug-2011  gdt Make route6d REQUIRE: mountcritremote.

route6d is in /usr/sbin, and thus on systems with separate / and /usr,
/etc/rc.d/route6d can be run before /usr is mounted, resulting in
route6d mysteriously failing to start.
 1.7 21-Apr-2007  tron The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.

This should fix PR misc/36171.
 1.6 13-Aug-2004  mycroft branches: 1.6.2; 1.6.4; 1.6.8; 1.6.10;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.10.1 28-Apr-2007  bouyer Pull up following revision(s) (requested by tron in ticket #588):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.6.8.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.6.4.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.6.2.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.10 21-Apr-2007  tron The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.

This should fix PR misc/36171.
 1.9 12-Oct-2004  lukem branches: 1.9.2; 1.9.4; 1.9.8; 1.9.10;
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.8 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 22-Mar-2002  thorpej branches: 1.7.6;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.6 06-Apr-2001  wiz Remove references to gated, except the conflict check in rc.d/routed.
Noted by Launey Thomas <ljt@alum.mit.edu>.
 1.5 19-Sep-2000  lukem - 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
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 29-Mar-2000  enami routed is live in /sbin, not /usr/sbin. Pointed out by kay@kaynet.or.jp.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.7.6.1 09-May-2005  riz Pull up revision 1.9 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.9.10.1 28-Apr-2007  bouyer Pull up following revision(s) (requested by tron in ticket #588):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.9.8.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.9.4.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.9.2.1 25-Apr-2007  ghen Pull up following revision(s) (requested by tron in ticket #1767):
etc/rc.d/routed: revision 1.10
etc/rc.d/route6d: revision 1.7
The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.
This should fix PR misc/36171.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 31-Jan-2002  lukem Rename NETWORK to NETWORKING, to allow rc.d to be on a case insensitive
file system (prevents conflict with 'network'). PROVIDE both NETWORKING
and NETWORK (the latter for compatibility with 3rd party scripts).
 1.5 19-Sep-2000  lukem - 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
 1.4 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.3 09-Jun-2000  fvdl branches: 1.3.2; 1.3.4;
Use load_rc_config
 1.2 03-Jun-2000  fvdl rpcbind uses a pidfile.
 1.1 02-Jun-2000  fvdl * Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.3.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 09-Jun-2000  minoura file rpcbind was added on branch minoura-xpg4dl on 2000-06-23 15:46:03 +0000
 1.3.2.2 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.2.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.11 04-Jul-2020  skrll Trailing whitespace
 1.10 19-Nov-2016  kre Undo change to a comment made when I thought another change to the
script was needed ... the unnecessary script change was never committed,
but the comment that described it was... No functional change.
 1.9 18-Nov-2016  kre The config file is not required to exist (unless specified via -d).
(reported by rhialto@falu.nl) Don't fail to start if it doesn't.

Make sure the directory for the config file exists inside the chroot before
attempting to copy into it ("confdir" was calculated, but never used...)

While here, fix getopts usage (obviously only ever previously tested when
the -c arg was the first option...) and don't use test(1)'s -o operator
(especially not when one of the other args is an unknown string).
If -c is given (and we will chroot), require filename to be full path.

Misc minor style cleanups.
 1.8 09-Jul-2013  roy branches: 1.8.6; 1.8.8; 1.8.10; 1.8.12;
Add _rtadvd user and group.
Add a chroot dir for the _rtadvd user.
Drop privs to the user _rtadvd after acquiring our socket.
When rc.d/rtadvd starts or reloads, the rtadvd config file is copied
into the chroot before starting or reloading rtadvd itself.
Create a symlink from /var/run/rtadvd.dump to the chroot

Inital idea from OpenBSD patch rtadvd.c r1.36
 1.7 13-Dec-2012  roy Add a pidfile and the reload command.
 1.6 13-Aug-2004  mycroft branches: 1.6.50; 1.6.56;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.56.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.1 25-Feb-2013  tls resync with head
 1.6.50.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.50.1 23-Jan-2013  yamt sync with head
 1.8.12.1 18-Jan-2017  skrll Sync with netbsd-5
 1.8.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.8.8.1 21-Nov-2016  snj Pull up following revision(s) (requested by kre in ticket #1274):
etc/rc.d/rtadvd: revision 1.9
The config file is not required to exist (unless specified via -c).
(reported by rhialto@falu.nl) Don't fail to start if it doesn't.
Make sure the directory for the config file exists inside the chroot before
attempting to copy into it ("confdir" was calculated, but never used...)
While here, fix getopts usage (obviously only ever previously tested when
the -c arg was the first option...) and don't use test(1)'s -o operator
(especially not when one of the other args is an unknown string).
If -c is given (and we will chroot), require filename to be full path.
Misc minor style cleanups.
 1.8.6.1 21-Nov-2016  snj Pull up following revision(s) (requested by kre in ticket #1274):
etc/rc.d/rtadvd: revision 1.9
The config file is not required to exist (unless specified via -c).
(reported by rhialto@falu.nl) Don't fail to start if it doesn't.
Make sure the directory for the config file exists inside the chroot before
attempting to copy into it ("confdir" was calculated, but never used...)
While here, fix getopts usage (obviously only ever previously tested when
the -c arg was the first option...) and don't use test(1)'s -o operator
(especially not when one of the other args is an unknown string).
If -c is given (and we will chroot), require filename to be full path.
Misc minor style cleanups.
 1.9 08-Apr-2009  martin systime() is not needed here - as the man page clearly points out.
Noticed by pooka.
 1.8 08-Apr-2009  martin Awk has strftime() and systime(), so no need to pipe the output of date
into the script - just do it internally.
 1.7 25-Aug-2007  apb branches: 1.7.18;
Back out previous (which worked but made the code harder to understand),
and implement a different method of avoiding a "-0" result.
 1.6 24-Aug-2007  martin Cosmetics: print 0 instead of -0.
From Zafer Aydogan in PR bin/36831.
 1.5 01-Oct-2006  sketch Tidy output so it matches other rc scripts.
 1.4 26-Apr-2006  blymn Fix rtc offset calculation for timezones that are not integral hours.
 1.3 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 25-Apr-2004  schmonz Add RCS Id.
 1.1 27-Dec-2003  martin Add a new /etc/rc.conf option: rtclocaltime=YES adapts the RTC offset
at boot automatically, so a machine dual booting another OS that uses
the RTC at localtime and NetBSD agree on the current time even if daylight
saving started/ended (without recompiling a kernel twice per year).
Awk code by Matt Thomas.
 1.7.18.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.8 11-Sep-2014  roy Remove rtsol(8) and rtsold(8) as their functionality is in dhcpcd(8).
Remove rtsol(8) from rc.d/network.
Add -w seconds command to ifconfig to wait for N seconds for until DAD
has finished on all addresses.
Use ifconfig -w in rc.d/network instead of a forced sleep.

As discussed on tech-net@
 1.7 07-Oct-2006  rpaulo PR 30716: rc.d/ntpd{,ate} precedes rc.d/rtsold. By Ed Hynan.
rc.d/rtsold should be in the same start up line as dhclient.
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.8 14-Sep-2009  apb Check whether a core dump exists before trying to save it. This should
prevent /etc/rc from thinking that /etc/rc.d/savecore failed.
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 15-Jul-2004  atatat Make the directory into which crash dumps are saved into something
that can be controlled via rc.conf. The default is, of course,
/var/crash.
 1.5 22-Mar-2002  thorpej branches: 1.5.4;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.3 19-Sep-2000  lukem - 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
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 02-Oct-2000  lukem pull up rev 1.3 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.5.4.1 15-Jul-2004  he Pull up revision 1.6 (requested by atatat in ticket #660:
Make the directory into which crash dumps are saved into
something that can be controlled via rc.conf. The default
is, of course, /var/crash.
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.5 18-Jun-2011  plunky remove empty files
 1.4 27-May-2011  plunky branches: 1.4.2;
provide a new 'bluetooth' rc.d script, to handle Bluetooth configuration
in a simpler manner. This replaces btattach, btconfig, bthcid, btdevctl
and sdpd scripts, and also should not require any configuration settings
other than "bluetooth=YES", though the full range of configurations is
still possible.
 1.3 01-Jun-2010  wiz Fix typo in sdpd, reported by Jukka Salmi in PR 43401.
This also affected bthcid, so I also fixed it there.
 1.2 18-Mar-2007  plunky For sdpd(8), change default user/group from nobody/nobody to _sdpd/_sdpd
 1.1 19-Jun-2006  gdamore branches: 1.1.4; 1.1.6;
Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.1.6.1 29-Oct-2007  wrstuden Catch up with 4.0 RC3
 1.1.4.1 14-Oct-2007  riz Pull up following revision(s) (requested by xtraeme in ticket #930):
etc/group: revision 1.22
etc/defaults/rc.conf: revision 1.85
etc/master.passwd: revision 1.38
usr.sbin/sdpd/sdpd.8: revision 1.2
usr.sbin/sdpd/sdpd.8: revision 1.3
share/man/man5/rc.conf.5: revision 1.113
etc/rc.d/sdpd: revision 1.2
usr.sbin/sdpd/server.c: revision 1.3
usr.sbin/postinstall/postinstall: revision 1.38
usr.sbin/sdpd/server.h: revision 1.2
usr.sbin/sdpd/main.c: revision 1.2
usr.sbin/sdpd/main.c: revision 1.3
Add an option to permit members of a specific group to register services, in
order to lower the barrier for users of bluetooth devices which may need to
query services on the local host.
change default user/group from nobody/nobody to _sdpd/_sdpd
 1.4.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.9 25-Dec-2023  kre No longer use obsolete test "-a" option - use sh && instead.
 1.8 29-Dec-2009  elad Securelevel might not be present, properly complain instead of printing
error messages from sysctl(8).
 1.7 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.6 11-Oct-2004  christos branches: 1.6.26;
Use new style command substitution.
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.3 01-Mar-2002  mrg clean up a little:
- don't set the securelevel to the same thing
- don't try to lower the securelevel

inspired by PR#13647
 1.2 06-Sep-2000  lukem REQUIRE ipnat and mountd.
fixes PRs [misc/10958] and [misc/10959] by Mike Santos <mike@ethmoid.org>
 1.1 21-Aug-2000  lukem branches: 1.1.2;
migrate raising of securelevel from sysctl to separate securelevel script.
the latter depends upon aftermountlkm (but is required by DAEMON), so that
lkms may be loaded before the securelevel is raised.
noted by Rafal Boni <rafal@mediaone.net> in [bin/10780]
 1.1.2.3 06-Sep-2000  lukem pull up rev 1.2 (approved by thorpej):
REQUIRE ipnat and mountd.
fixes PRs [misc/10958] and [misc/10959] by Mike Santos <mike@ethmoid.org>
 1.1.2.2 23-Aug-2000  lukem pull up rev 1.1 (approved by thorpej):
migrate raising of securelevel from sysctl to separate securelevel
script. the latter depends upon aftermountlkm (but is required by
DAEMON), so that lkms may be loaded before the securelevel is
raised. noted by Rafal Boni <rafal@mediaone.net> in [bin/10780]
 1.1.2.1 21-Aug-2000  lukem file securelevel was added on branch netbsd-1-5 on 2000-08-23 12:08:17 +0000
 1.6.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.22 30-May-2006  christos Remove sendmail (approved by core)
 1.21 19-Aug-2004  atatat Quieten stat(1) with the -q flag.

Addresses PR bin/26711.
 1.20 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.19 08-Aug-2004  atatat Switch the check to see if the corresponding db file needs to be
rebuilt from "newer than" to "not older than". The latter check also
manages to take into account cases where the db file doesn't yet exist
because the source is "not older than" something that doesn't yet
exist.
 1.18 22-Jul-2004  atatat Add one more check to the sendmail auto-start heuristic: check the
value of MTAHost in the submit.cf. If it doesn't indicate localhost,
we probably don't need the sendmail listener.

Addresses PR bin/26391.
 1.17 15-Jul-2004  atatat Change the default settings for sendmail.

(1) The stock sendmail.cf will only listen on the loopback interface.
(2) The stock submit.cf specifally connects to "localhost." which
should be less susceptible to being confused or looking confused.
(3) The smtp listener starts by default, if needed. The setting in
/etc/default/rc.conf is still "no", but rc.d/sendmail detects the
default setting and will change it to yes if need is determined.

Need is defined as "nothing else seems to have been changed about the
mail configuration but we'd like locally originated and locally
destined mail to be delivered". If you change, eg, mailer.conf to
point to postfix or some other MTA, sendmail will not start.
 1.16 02-Apr-2003  atatat branches: 1.16.2;
Reorganize/clarify the configuration checks (and subsequent messages)
that might block startup, and be more permissive in general about
allowing the daemons to start.

Add some descriptive comments to the top of the smmsp script that
describe the purpose of the process.
 1.15 24-Mar-2003  atatat Tweak postinstall to check for (and help out on) the upgrade to
sendmail 8.12.8. Some of the same machinery (in shorter form) is in
the additions to rc.d/sendmail. Also, add a smmsp startup script for
the sendmail client queue runner.
 1.14 12-Feb-2002  lukem improve comment, and clean up a test
 1.13 18-Dec-2000  jmc Patch from Hubert. aliases never get rebuilt if aliases.db is never originally generated.
 1.12 09-Oct-2000  nisimura Use && and || for logical concatenations instead of -a/-o test operators.
 1.11 19-Sep-2000  lukem - 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
 1.10 14-Sep-2000  jdolecek On sendmail start, check modification time of /etc/mail/aliases
and couple of other common map files and regenerate appropriate
*.db files as needed.
Idea taken from RedHat 6.2.
 1.9 13-Jun-2000  itojun branches: 1.9.2;
use ${start_precmd} to check duplicate sendmail.cf.
do not use "err" on failure, it is not that fatal (it's okay if we
don't start sendmail)
 1.8 04-Jun-2000  itojun run sendmail under the following conditions:
- /etc/mail/sendmail.cf exists, no /etc/sendmail.cf
- /etc/mail/sendmail.cf exists, /etc/sendmail.cf same content as
/etc/mail/sendmail.cf
die in other cases. PR 10243.
 1.7 31-May-2000  itojun refer PR 10100 for /etc/sendmail.cf check
 1.6 15-May-2000  tron branches: 1.6.2;
Don't complain about existence of "/etc/sendmail.cf" if "sendmail" is
not set to "YES" in "/etc/rc.conf".
 1.5 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.4 03-May-2000  itojun do not cope with pre-8.10 configuration file. do not start sendmail.
From: hubert
 1.3 03-May-2000  itojun sync with sendmail upgrade.
- sendmail configuration files are in /etc/mail, not /etc.
- src/etc/aliases will be installed into /etc/mail/aliases (confusing)
- rc.d/sendmail warns if /etc/sendmail.cf exists.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.6.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 02-Oct-2000  lukem pull up rev 1.11 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.16.2.4 22-Aug-2004  tron Pull up revision 1.21 (requested by atatat in ticket #773):
Quieten stat(1) with the -q flag.
Addresses PR bin/26711.
 1.16.2.3 12-Aug-2004  jmc Pullup rev 1.19 (requested by atatat in ticket #753)

Switch the check to see if the corresponding db file needs to be
rebuilt from "newer than" to "not older than". The latter check also
manages to take into account cases where the db file doesnt yet exist.
 1.16.2.2 23-Jul-2004  tron Pull up revision 1.18 (requested by atatat in ticket #685):
Add one more check to the sendmail auto-start heuristic: check the
value of MTAHost in the submit.cf. If it doesn't indicate localhost,
we probably don't need the sendmail listener.
Addresses PR bin/26391.
 1.16.2.1 15-Jul-2004  he Pull up revision 1.17 (requested by atatat in ticket #662):
Change the default settings for sendmail:
1) The stock sendmail.cf will only listen on the loopback
interface
2) The stock submit.cf specifically connects to "localhost.",
which should be less susceptible to being confused or
looking confused.
3) The SMTP listener starts by default, if needed. The
setting in /etc/default/rc.conf is still "no", but
rc.d/sendmail detects the default setting and will change
it to "yes" if need is determined.
"Need" is defined as "nothing else seems to have been
changed about the mail configuration but we would like
locally originated and locally destined mail to be delivered".
If you change e.g. mailer.conf to point to postfix or some
other MTA, sendmail will not start.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5 30-May-2006  christos Remove sendmail (approved by core)
 1.4 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.3 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 02-Apr-2003  atatat branches: 1.2.4;
Reorganize/clarify the configuration checks (and subsequent messages)
that might block startup, and be more permissive in general about
allowing the daemons to start.

Add some descriptive comments to the top of the smmsp script that
describe the purpose of the process.
 1.1 24-Mar-2003  atatat Tweak postinstall to check for (and help out on) the upgrade to
sendmail 8.12.8. Some of the same machinery (in shorter form) is in
the additions to rc.d/sendmail. Also, add a smmsp startup script for
the sendmail client queue runner.
 1.2.4.1 09-May-2005  riz Pull up revision 1.4 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.6 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.5 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.4 13-May-2019  maxv branches: 1.4.2; 1.4.4;
Remove comment, since there is no parsing anymore.
 1.3 12-May-2019  kre I should know better! Don't rely upon the way the shell implements
pipes. Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)
 1.2 12-May-2019  kre Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
 1.1 11-May-2019  maxv Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
 1.4.4.2 10-Jun-2019  christos Sync with HEAD
 1.4.4.1 13-May-2019  christos file smtoff was added on branch phil-wifi on 2019-06-10 21:42:45 +0000
 1.4.2.2 14-May-2019  martin Pull up following revision(s) (requested by maxv in ticket #1265):
etc/rc.d/smtoff: revision 1.1
etc/rc.d/smtoff: revision 1.2
distrib/sets/lists/etc/mi: revision 1.258
etc/rc.d/smtoff: revision 1.3
etc/rc.d/smtoff: revision 1.4
etc/defaults/rc.conf: revision 1.148
etc/rc.d/Makefile: revision 1.103
usr.sbin/postinstall/postinstall: revision 1.226
etc/rc.d/Makefile: revision 1.104
etc/mtree/special: revision 1.167
share/man/man5/rc.conf.5: revision 1.180

Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
install rc.d

No change... Previous log message should have said:
Install rc.d/smtoff

I should know better! Don't rely upon the way the shell implements
pipes. Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)

Remove comment, since there is no parsing anymore.
 1.4.2.1 13-May-2019  martin file smtoff was added on branch netbsd-8 on 2019-05-14 11:33:42 +0000
 1.37 22-Jul-2023  kim Remove backwards compat.
 1.36 10-Jun-2023  kim Add some backwards compat. Adjust grammar.
 1.35 05-Jun-2023  riastradh /etc/rc.d/sshd: Use default curve for ECDSA keygen, not NIST P-521.

The default is NIST P-256, which:

(a) has plenty of cryptanalytic security,
(b) performs better on essentially all platforms (smaller enough that
even the advantage of the Mersenne prime structure of P-521 can't
compete), and
(c) likely gets more scrutiny on implementations than P-521 since it's
more widespread.
 1.34 05-Jun-2023  riastradh /etc/rc.d/sshd: Stop generating DSA host keys by default.

If you want them you can generate them yourself, but in this day and
age (Monday and 2023, specifically) there's no reason to be using DSA
except for compatibility with ancient legacy software.
 1.33 26-May-2023  riastradh /etc/rc.d/sshd: New check cmd and reload precmd.

- check cmd: run `sshd -t' to check sshd_config file

- reload precmd: run check cmd before reloading so we don't nuke sshd
if there's an error in the sshd_config file

(It is still possible to effectively nuke sshd by changing the
configuration tosomething that won't work on your network, but at
least we avoid making sshd just exit on reload when you make a typo
in a config option.)

XXX pullup-9
XXX pullup-10
 1.32 15-May-2022  martin branches: 1.32.2;
PR 56835: fix sshd startup script to only whine about bogus keys it
created if it actualy did create keys (one should thing that a
function called sshd_keygen() only is called to create keys, but
the "precmd" magic makes it run every time sshd is started or stopped).

Patch from Tom Lane, with modifications suggested by kre and a minor
additional cosemtic change.
 1.31 26-Sep-2021  martin If key generation happens with not enough entropy in the system, add
a warning to motd pointing at entropy(7) and give instructions how to
re-generate the (weak) keys after fixing up entropy.

Add a "keyregen" command, which forces regeneration of all host keys
to simplify the replacement of weak keys.
 1.30 23-Oct-2019  christos simplify more (from rudolf)
 1.29 26-May-2018  riastradh branches: 1.29.2; 1.29.4;
Revert previous: Don't generate XMSS host keys for sshd by default.

XMSS is a stateful post-quantum signature scheme.

- Post-quantum security for _online_ authentication is not important
until quantum computers become practical; there's no danger of
retroactive forgery in sessions that have already completed.

- As a stateful signature schemes, XMSS is qualitatively different
from all the other ones sshd supports, requiring additional
administrative care: roll back the state (e.g., from a disk backup
or VM snapshot), and you've shot yourself in the foot.

If users want XMSS keys, they can make them explicitly, but there's
no need for this to be enabled by default.

Discussed with christos offline.
 1.28 26-May-2018  jmcneill Silence ssh-keygen output when host keys are generated. Instead, print only
key fingerprints. This replaces dozens of lines out ASCII art output with
something more reasonable:

armv7# service sshd start
ssh-keygen: 1024 SHA256:ynP4BQ2B0Fknnf9PfF4QoUDlYi0+7rNfYXTOYP2cDic root@armv7 (DSA)
ssh-keygen: 521 SHA256:Eoj382aaJNlSxuq/aYj3AXgxfMJAkyVPoCQd2BNjJiA root@armv7 (ECDSA)
ssh-keygen: 256 SHA256:+e9/qTbbN/g6xvkadtHsmIQ+Pc0afZRxbXJsk2HKIzY root@armv7 (ED25519)
ssh-keygen: 2048 SHA256:urNaF/m6oiCe5hXFZBxGLW2PvLz0ibtRFrqYw6R+qTw root@armv7 (RSA)
ssh-keygen: 256 SHA256:Su2Nal2W3vrFz8ukpcSXngl1/bu6xUm1nSvbxTHe9Js root@armv7 (XMSS)
Starting sshd.
 1.27 09-Apr-2018  christos Simplify so we don't have to hard-code the key filenames in two places.
 1.26 07-Apr-2018  christos support xmss keys
 1.25 04-Dec-2017  kre branches: 1.25.2;

Do away with (not well specified, even if it happens to work) absurd
15 arg test ([ ]) expression, and replace it with several well defined
2 arg tests, combined with (also well defined) sh syntax.
 1.24 07-Oct-2017  sevan With the new version of OpenSSH, SSHv1 is no longer supported server-side.
Along with that rsa1 type keys are no longer supported.
Don't try to generate such keys on new systems.

ok christos
 1.23 19-Oct-2014  christos branches: 1.23.8;
Add new keytype, replace duplicated code with loop
 1.22 07-Feb-2013  christos branches: 1.22.10;
PR/47540: Felix Deichmann: DSA keys can only be 1024 bits.
 1.21 25-Jul-2011  christos branches: 1.21.2; 1.21.4; 1.21.8; 1.21.10; 1.21.12;
generate ecdsa key
 1.20 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.19 18-Feb-2004  jonb Add ssh_keygen_flags variable to rc.conf to allow users to set the
size of auto-generated keys if desired.
 1.18 29-Apr-2002  lukem Complete the conversion back to the OpenSSH default configuration files of
"/etc/ssh/ssh_config" (from "/etc/ssh/ssh.conf") for ssh(1) and other
userland tools, and "/etc/ssh/sshd_config (from "/etc/ssh/sshd.conf")
for sshd(8).

etc/postinstall will detect this, and if "fix" is given, rename the files.
 1.17 29-Apr-2002  lukem deprecate $sshd_conf_dir and hardcode /etc/ssh.
$sshd_conf_dir wasn't as flexible as liked (it didn't work for ssh(1),
host keys or known_hosts).
 1.16 19-Apr-2002  enami Don't assume that $0 is this script.
 1.15 19-Apr-2002  enami Wrap long lines.
 1.14 27-Mar-2002  lukem Set command_args to '-f ${sshd_conf_dir}/${name}.conf'.
This occurs before the first load_rc_config() so that it may be
overridden by the user, and appears in single quotes so the
variables don't get evaluated until the eval in run_rc_command().
Problem noted by Patrick Welche <prlw1@cam.ac.uk> in [bin/15912].
 1.13 24-Feb-2002  lukem Support alternate config dir for sshd conf file and keys (defaults to "/etc").
Based on [misc/12473] from Jim Bernard.
 1.12 25-Apr-2001  lukem be consistent with other scripts when temporarily setting umask to 022
 1.11 25-Apr-2001  lukem set the umask to 022 (remembering the previous setting) for ssh_keygen()
 1.10 26-Mar-2001  itojun check existence of /etc/ssh_host_rsa_key too
 1.9 26-Mar-2001  itojun auto-generate SSH protocol version 2 RSA key.
use newer command line syntax for ssh-keygen (-t <type>, instead of -d)
 1.8 19-Sep-2000  lukem - 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
 1.7 10-Aug-2000  lukem - sshd has a pid file, so take advantage of it
- support `reload' arg (using default of SIGHUP)
 1.6 10-Aug-2000  lukem - provide sshd not ssh
- don't start until after LOGIN (after NETWORK is way too early)
- KNF (as such :)
 1.5 01-Aug-2000  jwise branches: 1.5.2;
Change name of precmd from start_precmd to sshd_precmd. While it worked
fine as was, the result was the line `start_precmd=start_precmd' which
looked odd. Pointed out by Bernd Ernesti.

While here, add NetBSD RCS Id.

BTW, to clarify, as people have asked: this script does not support
pkgsrc/security/sshd -- that package comes with a perfectly fine rc script
which in addition to supporting /etc/rc.d can also be used with 1.4.X.

This script will not trivially work with the ssh package as it a.) calls
the ssh commands at the pathnames they will be installed at by usr.bin/ssh,
and b.) generates a DSA key as well as an RSA key.
 1.4 31-Jul-2000  jlam Correct apparent past-o: RSA -> DSA
 1.3 31-Jul-2000  jwise An sshd startup script for use with usr.bin/sshd. Installation is conditional
on ${SSHDIST}, as with usr.bin/ssh itself.

This script includes a `keygen' target for regenerating RSA and DSA host keys,
and invokes this if these keys are not present when sshd is started up.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.5.2.6 30-Mar-2001  he Pull up revision 1.10 (requested by itojun):
Auto-generate SSH protocol version 2 RSA key.
Use newer command syntax (``-t <type>'' instead of ``-d'').
(fix to previous)
 1.5.2.5 30-Mar-2001  he Pull up revision 1.9 (requested by itojun):
Auto-generate SSH protocol version 2 RSA key.
Use newer command syntax (``-t <type>'' instead of ``-d'').
 1.5.2.4 02-Oct-2000  lukem pull up rev 1.8 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.5.2.3 29-Sep-2000  thorpej Sync this with rev 1.8.
 1.5.2.2 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.5.2.1 01-Aug-2000  lukem file sshd was added on branch netbsd-1-5 on 2000-08-09 19:09:46 +0000
 1.21.12.1 15-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1468):
etc/rc.d/sshd: revision 1.22
etc/rc.d/sshd: revision 1.23
PR/47540: Felix Deichmann: DSA keys can only be 1024 bits.
--
Add new keytype, replace duplicated code with loop
 1.21.10.1 15-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1468):
etc/rc.d/sshd: revision 1.22
etc/rc.d/sshd: revision 1.23
PR/47540: Felix Deichmann: DSA keys can only be 1024 bits.
--
Add new keytype, replace duplicated code with loop
 1.21.8.1 25-Feb-2013  tls resync with head
 1.21.4.1 15-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1468):
etc/rc.d/sshd: revision 1.22-1.23
PR/47540: Felix Deichmann: DSA keys can only be 1024 bits.
--
Add new keytype, replace duplicated code with loop
 1.21.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.22.10.1 02-May-2015  martin Pull up following revision(s) (requested by nakayama in ticket #728):
etc/rc.d/sshd: revision 1.23
Add new keytype, replace duplicated code with loop
 1.23.8.3 07-Jun-2018  martin Pull up following revision(s) (requested by jmcneill in ticket #838):

etc/rc.d/sshd: revision 1.28

Silence ssh-keygen output when host keys are generated. Instead, print only
key fingerprints. This replaces dozens of lines out ASCII art output with
something more reasonable:

armv7# service sshd start
ssh-keygen: 1024 SHA256:ynP4BQ2B0Fknnf9PfF4QoUDlYi0+7rNfYXTOYP2cDic root@armv7 (DSA)
ssh-keygen: 521 SHA256:Eoj382aaJNlSxuq/aYj3AXgxfMJAkyVPoCQd2BNjJiA root@armv7 (ECDSA)
ssh-keygen: 256 SHA256:+e9/qTbbN/g6xvkadtHsmIQ+Pc0afZRxbXJsk2HKIzY root@armv7 (ED25519)
ssh-keygen: 2048 SHA256:urNaF/m6oiCe5hXFZBxGLW2PvLz0ibtRFrqYw6R+qTw root@armv7 (RSA)
ssh-keygen: 256 SHA256:Su2Nal2W3vrFz8ukpcSXngl1/bu6xUm1nSvbxTHe9Js root@armv7 (XMSS)
Starting sshd.
 1.23.8.2 10-Dec-2017  snj Pull up following revision(s) (requested by sevan in ticket #420):
etc/rc.d/sshd: revision 1.25
Do away with (not well specified, even if it happens to work) absurd
15 arg test ([ ]) expression, and replace it with several well defined
2 arg tests, combined with (also well defined) sh syntax.
 1.23.8.1 04-Dec-2017  snj Pull up following revision(s) (requested by sevan in ticket #321):
etc/rc.d/sshd: revision 1.24
Don't try to generate sshv1 keys on new systems.
 1.25.2.3 25-Jun-2018  pgoyette Sync with HEAD
 1.25.2.2 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.25.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.29.4.1 21-Jun-2023  martin Pull up following revision(s) (requested by kim in ticket #1643):

etc/rc.d/sshd: revision 1.30
etc/rc.d/sshd: revision 1.33
etc/rc.d/sshd: revision 1.34
etc/rc.d/sshd: revision 1.35

simplify more (from rudolf)

/etc/rc.d/sshd: New check cmd and reload precmd.
- check cmd: run `sshd -t' to check sshd_config file
- reload precmd: run check cmd before reloading so we don't nuke sshd
if there's an error in the sshd_config file

(It is still possible to effectively nuke sshd by changing the
configuration tosomething that won't work on your network, but at
least we avoid making sshd just exit on reload when you make a typo
in a config option.)

/etc/rc.d/sshd: Stop generating DSA host keys by default.
If you want them you can generate them yourself, but in this day and
age (Monday and 2023, specifically) there's no reason to be using DSA
except for compatibility with ancient legacy software.
/etc/rc.d/sshd: Use default curve for ECDSA keygen, not NIST P-521.

The default is NIST P-256, which:
(a) has plenty of cryptanalytic security,
(b) performs better on essentially all platforms (smaller enough that
even the advantage of the Mersenne prime structure of P-521 can't
compete), and
(c) likely gets more scrutiny on implementations than P-521 since it's
more widespread.
 1.29.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.32.2.1 21-Jun-2023  martin Pull up following revision(s) (requested by kim in ticket #196):

etc/rc.d/sshd: revision 1.33
etc/rc.d/sshd: revision 1.34
etc/rc.d/sshd: revision 1.35
etc/rc.d/sshd: revision 1.36

/etc/rc.d/sshd: New check cmd and reload precmd.

- check cmd: run `sshd -t' to check sshd_config file

- reload precmd: run check cmd before reloading so we don't nuke sshd
if there's an error in the sshd_config file

(It is still possible to effectively nuke sshd by changing the
configuration tosomething that won't work on your network, but at
least we avoid making sshd just exit on reload when you make a typo
in a config option.)

/etc/rc.d/sshd: Stop generating DSA host keys by default.

If you want them you can generate them yourself, but in this day and
age (Monday and 2023, specifically) there's no reason to be using DSA
except for compatibility with ancient legacy software.

/etc/rc.d/sshd: Use default curve for ECDSA keygen, not NIST P-521.

The default is NIST P-256, which:
(a) has plenty of cryptanalytic security,
(b) performs better on essentially all platforms (smaller enough that
even the advantage of the Mersenne prime structure of P-521 can't
compete), and
(c) likely gets more scrutiny on implementations than P-521 since it's
more widespread.

Add some backwards compat. Adjust grammar.
 1.6 02-May-2012  gendalia Add the ability for staticroute to evaluate lines from /etc/route.conf
as shell script fragments, add example to the route.conf man page of
evaluating variables.

Remove route.conf man page statement that staticroute is enabled in
rc.conf since that's incorrect.

Wrap the staticroute while in parens, per <apb> & <christos>, and
quote all the arguments for the evals.
 1.5 07-Oct-2009  tron branches: 1.5.6; 1.5.8;
Add proper error reporting via the return code:
Remember if any of the "route" commands failed and return an error in
that case.
 1.4 07-Oct-2009  tron Add a "return 0" to avoid incorrect error returns because we ran out of
lines to read from "/etc/route.conf".
 1.3 31-Jan-2008  reed branches: 1.3.2; 1.3.12;
Add comment to point to manual page for details.
 1.2 13-Aug-2004  mycroft branches: 1.2.16;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 09-Jan-2003  christos Script to add and remove static routes:

eg:
$ cat /etc/route.conf
# Turn on/off IP forwarding.
+sysctl -w net.inet.ip.forwarding=1
-sysctl -w net.inet.ip.forwarding=0
net 192.168.2.0 -netmask 255.255.255.0 192.168.150.2
 1.2.16.1 23-Mar-2008  matt sync with HEAD
 1.3.12.1 19-May-2012  riz Pull up following revision(s) (requested by gendalia in ticket #1757):
share/man/man5/route.conf.5: revision 1.4
etc/rc.d/staticroute: revision 1.4
etc/rc.d/staticroute: revision 1.5
etc/rc.d/staticroute: revision 1.6
Add a "return 0" to avoid incorrect error returns because we ran out of
lines to read from "/etc/route.conf".
Add proper error reporting via the return code:
Remember if any of the "route" commands failed and return an error in
that case.
Add the ability for staticroute to evaluate lines from /etc/route.conf
as shell script fragments, add example to the route.conf man page of
evaluating variables.
Remove route.conf man page statement that staticroute is enabled in
rc.conf since that's incorrect.
Wrap the staticroute while in parens, per <apb> & <christos>, and
quote all the arguments for the evals.
 1.3.2.2 31-Jan-2008  reed Add comment to point to manual page for details.
 1.3.2.1 31-Jan-2008  reed file staticroute was added on branch mjf-devfs on 2008-01-31 15:21:33 +0000
 1.5.8.1 07-May-2012  riz Pull up following revision(s) (requested by gendalia in ticket #211):
share/man/man5/route.conf.5: revision 1.4
etc/rc.d/staticroute: revision 1.6
Add the ability for staticroute to evaluate lines from /etc/route.conf
as shell script fragments, add example to the route.conf man page of
evaluating variables.
Remove route.conf man page statement that staticroute is enabled in
rc.conf since that's incorrect.
Wrap the staticroute while in parens, per <apb> & <christos>, and
quote all the arguments for the evals.
 1.5.6.1 23-May-2012  yamt sync with head.
 1.2 22-May-2001  fredette sunndd has been renamed to ndbootd.
 1.1 17-May-2001  fredette Added rc.d support for sunndd.
 1.14 16-Apr-2022  andvar fix various typos in comments and log messages.
 1.13 19-Oct-2018  martin Apply patch from Ian D. Leroux in PR bin/51019:
when unmounting tmpfs file systems at shutdown time, avoid unmounting
a tmpfs created by init on /dev - behaviour overridable from rc.conf.
By default all tmpfs that have device nodes are not mounted.
 1.12 20-Apr-2015  prlw1 branches: 1.12.14; 1.12.16;
Apply modified version of patch from Wolfgang Stukenbrock in PR bin/41766

This forcibly unmounts tmpfs file systems, so that swapctl doesn't run
out of swap itself, eventually trying to kill pid 1.

No objections since:
http://mail-index.netbsd.org/current-users/2015/03/16/msg026908.html
 1.11 24-Sep-2009  apb Adapt /etc/rc.d/swap1 and swap2 scripts to the new meaning of
exit status 2 from swapctl(8).
 1.10 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.9 13-Aug-2004  mycroft branches: 1.9.36;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.8 24-Mar-2002  lukem also check $rc_force != "" to determine if operation should occur
 1.7 21-Mar-2002  lukem Implement rc.conf(5) variable `` $swapoff ''.
If set to yes, block-type swap partitions will be deleted upon shutdown.
This can be useful if swapping onto a RAIDframe device, but may cause
unnecessary delays during shutdown for the general case, so it's
disabled by default.
Should resolve [bin/14433] and [kern/14769].
 1.6 13-Apr-2001  msaitoh check no_swap
 1.5 17-Jul-2000  lukem use "load_rc_config swap" for swap1 and swap2
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 26-Apr-2000  thorpej Make ccd and raidframe provide `disks', and make swap1 and fsck
depend on `disks', rather than `ccd' and `raidframe'.
 1.2 11-Mar-2000  veego Add raidframe to the REQUIRE list. rcorder seems to get it right, but it
is better to add it.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.2 30-Sep-2001  he Pull up revision 1.6 (requested by msaitoh):
Check for and obey no_swap.
 1.4.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.9.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.12.16.1 10-Jun-2019  christos Sync with HEAD
 1.12.14.1 20-Oct-2018  pgoyette Sync with head
 1.8 24-Sep-2009  apb Adapt /etc/rc.d/swap1 and swap2 scripts to the new meaning of
exit status 2 from swapctl(8).
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 21-Aug-2000  lukem remove BEFORE DAEMON
 1.4 17-Jul-2000  lukem use "load_rc_config swap" for swap1 and swap2
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.2 23-Aug-2000  lukem pull up rev 1.5:
remove `BEFORE: DAEMON'

approved: thorpej
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.14 13-Jun-2021  mlelstv run sysctl early enough.
 1.13 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.12 29-Apr-2002  lukem don't bother warning about obsolete $defcorename and $nfsiod_flags;
postinstall now checks for these
 1.11 27-Mar-2002  lukem clean up warnings.
don't bother setting defcorename from obsolete $defcorename.
 1.10 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.9 21-Aug-2000  lukem migrate raising of securelevel from sysctl to separate securelevel script.
the latter depends upon aftermountlkm (but is required by DAEMON), so that
lkms may be loaded before the securelevel is raised.
noted by Rafal Boni <rafal@mediaone.net> in [bin/10780]
 1.8 13-Jun-2000  itojun branches: 1.8.2;
add rc.d/ipsec for ipsec configuration. when enabled, it will inject
/etc/ipsec.conf into "setkey -f". PR 9609.
 1.7 13-May-2000  lukem branches: 1.7.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.6 07-May-2000  tsarna This was doubly borken...
 1.5 07-May-2000  tsarna Only warn on non-default old nfsiod args.
 1.4 15-Apr-2000  tsarna Death to nfsiod!

It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
 1.3 09-Apr-2000  tsarna Improve backwards compatability and leave securelevel the old way.
 1.2 08-Apr-2000  tsarna The file /etc/sysctl.conf is now run with sysctl -f at boot time.
This replaces the previous /etc/rc.d/sysctl. Also, the variables are now
set earlier, between ipf/ipnat and the network coming up.

The rc.conf defcorename and securelevel variables are no more. You can
set them directly in sysctl.conf now.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.7.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.2.1 23-Aug-2000  lukem pull up rev 1.9 (approved by thorpej):
migrate raising of securelevel from sysctl to separate securelevel
script. the latter depends upon aftermountlkm (but is required by
DAEMON), so that lkms may be loaded before the securelevel is
raised. noted by Rafal Boni <rafal@mediaone.net> in [bin/10780]
 1.26 25-Dec-2023  kre Stop using the obsolete test(1) -o operator, use sh || instead.
Prefer sh ! over test's ! (though that one is not completely obsolete).
 1.25 23-Apr-2016  dholland Avoid unnecessary use of basename(1). From Jukka Salmi a long, long time
ago on a tech-kern far, far away.
 1.24 03-Jun-2012  joerg Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
 1.23 21-Feb-2012  nakayama Avoid rebuilding services database every boot time.
The database has been renamed since the default was changed to CDB format.
 1.22 02-Sep-2011  mbalmer branches: 1.22.2; 1.22.4;
Terminate line with a '.', not the word 'done', for consistency with other
startup scripts.
 1.21 18-Jun-2009  christos now that pwd_mkdb does not change the version, warn if we still have version
0 databases.
 1.20 26-Aug-2007  dyoung Let an rc variable, sysdb=YES|NO, control the building of the system
databases. Defaults to YES.
 1.19 16-May-2007  christos check if the source exists, not that it is a file. Reported by
Blair Sadewitz
 1.18 13-May-2007  christos don't attempt to build the db file if the src file does not exist.
 1.17 10-May-2007  christos Move .db files for services and netgroup to /var/db per gimpy's request.
 1.16 08-May-2007  christos - don't trash utmp{,x} needlessly
- also support netgroup services and password
- pretty print
 1.15 12-Oct-2004  lukem Fix for /bin/ksh, from Jukka Salmi in PR 27232.
 1.14 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.13 11-May-2003  ragge branches: 1.13.4;
Remove kvm_mkdb, it's not used anymore.
 1.12 24-Feb-2003  atatat Execute the actual command as it's set instead of calling the sh
routine directly. This allows one to to override a specific command
via the use of /etc/rc.conf.d/sysdb.
 1.11 08-Oct-2002  atatat Reorganize the sysdb script so that lkm{1,2,3} can request that the
dev database be rebuilt after loading modules. Loading modules might
create new nodes in /dev, but the dev database is being initialized
too soon for lkm2 and lkm3. This means that, eg, /dev/xf86 (typically
marked AFTERMOUNT and loaded by lkm2) will show up properly. Reviewed
by lukem.
 1.10 16-Sep-2002  perry create a utmpx with the same permissions as utmp
Solves pr 18282, although very differently.
 1.9 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.8 16-Apr-2001  lukem wrap kvm_mkdb arg in "s. from adam laurie in pr 12664
 1.7 14-Oct-2000  nisimura Add missing -n option of sysctl(8) booted_kernel name retrival.
 1.6 09-Oct-2000  nisimura - avoid -a or -o logical operator of test command as possible. They would
introduce syntaxical ambiguousity, and having concatenation with && or
|| costs nothing because our sh(1) has test(1) builtin.
- use elif construct to avoid dungling else-ifs.
- while-read construct does not need enclosed by a sub-shell.
- variable detection could be done in eval args=\$ifconfig_$int
- smart variable substitution occationally saves lines and extra command
invocations.
 1.5 19-Sep-2000  lukem - 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
 1.4 27-Jul-2000  lukem move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.2 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.13.4.1 08-May-2005  riz Pull up revision 1.15 (requested by lukem in ticket #1266):
Fix for /bin/ksh, from Jukka Salmi in PR 27232.
 1.22.4.2 23-Jun-2012  riz Pull up following revision(s) (requested by joerg in ticket #328):
lib/libc/gen/devname.c: revision 1.22
distrib/sparc64/instfs/dot.profile: revision 1.7
distrib/i386/cdroms/install.sh: revision 1.3
tests/lib/libcurses/director/director.c: revision 1.10
lib/libc/include/reentrant.h: revision 1.15
distrib/amd64/cdroms/install.sh: revision 1.3
tests/include/t_paths.c: revision 1.12
share/man/man7/hier.7: revision 1.101
etc/rc.d/sysdb: revision 1.24
include/stdlib.h: revision 1.99
tests/lib/libcurses/Makefile: revision 1.3
distrib/sparc64/cdroms/installcd/install.sh: revision 1.3
distrib/i386/cdroms/Makefile.cdrom: revision 1.27
lib/libc/gen/ttyname.c: revision 1.25
usr.bin/tic/Makefile: revision 1.2
tools/compat/Makefile: revision 1.57
lib/libterminfo/compile.c: revision 1.7
lib/libc/gen/ttyname.c: revision 1.26
lib/libterminfo/compile.c: revision 1.8
tools/compat/Makefile: revision 1.59
tools/compat/cdbw.h: revision 1.1
distrib/i386/installimage/install.sh: revision 1.2
lib/libc/include/namespace.h: revision 1.154
usr.bin/tic/tic.c: revision 1.13
usr.bin/tic/tic.c: revision 1.14
usr.bin/tic/tic.c: revision 1.15
distrib/sets/lists/base/mi: revision 1.996
usr.bin/tic/tic.c: revision 1.16
usr.sbin/dev_mkdb/dev_mkdb.8: revision 1.13
usr.bin/tic/tic.c: revision 1.17
usr.bin/tic/tic.c: revision 1.18
tools/compat/cdbr.h: revision 1.1
distrib/sparc64/instfs/list: revision 1.25
usr.bin/tic/tic.c: revision 1.19
lib/libc/cdb/cdbw.c: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.5
share/terminfo/Makefile: revision 1.3
usr.sbin/dev_mkdb/dev_mkdb.c: revision 1.29
usr.sbin/dev_mkdb/Makefile: revision 1.8
lib/libc/gen/ttyname.3: revision 1.23
lib/libc/gen/ttyname.3: revision 1.24
lib/libc/cdb/cdbr.c: revision 1.3
include/cdbw.h: revision 1.2
distrib/sparc64/cdroms/installcd/Makefile: revision 1.15
lib/libc/gen/devname.3: revision 1.12
tools/compat/compat_defs.h: revision 1.85
tools/compat/compat_defs.h: revision 1.86
lib/libterminfo/term_private.h: revision 1.10
lib/libterminfo/term.c: revision 1.14
usr.bin/tic/tic.1: revision 1.10
lib/libterminfo/term.c: revision 1.15
lib/libterminfo/Makefile.hash: revision 1.5
lib/libterminfo/term.c: revision 1.16
distrib/amd64/installimage/install.sh: revision 1.2
share/man/man5/rc.conf.5: revision 1.152
distrib/sets/lists/tests/mi: revision 1.472
distrib/amd64/cdroms/Makefile.cdrom: revision 1.7
include/paths.h: revision 1.41
bin/ps/ps.1: revision 1.101
lib/libterminfo/terminfo.5.in: revision 1.16
usr.bin/tic/tic.c: revision 1.20
lib/libterminfo/terminfo.5.in: revision 1.17
Prefer __printflike.
Use queue(3)
Replace linear lookup with hash table, reducing runtime by 60%.
Use e* from util.h.
One more strdup -> estrdup.
Maintain nalias and nterm on the fly.
Add void for ttyslot prototype.
Use memcmp in place of strncmp, since length is known to no longer than
either of the arguments.
Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
Add __predict_true / __predict_false definitions.
Add a special seeder for cdbw_output that gives stable results.
Hook up cdbw(3) for the tool build.
Prototype for cdbw_stable_seeder.
Provide a usable thr_once for !_REENTRANT
Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
Switch terminfo(3) to cdb(5).
Fix typos.
Make Alan Barrett happy and add ().
Add cdbr(3) support to tools/compat.
Bump date for previous.
Relax consistency to make it possible to match valid entries.
Prefix devname's buffer with /dev/ as ttyname is supposed to return the
full path. Reported by Dave Huang.
 1.22.4.1 23-Feb-2012  riz Pull up following revision(s) (requested by nakayama in ticket #27):
etc/rc.d/sysdb: revision 1.23
Avoid rebuilding services database every boot time.
The database has been renamed since the default was changed to CDB format.
 1.22.2.2 30-Oct-2012  yamt sync with head
 1.22.2.1 17-Apr-2012  yamt sync with head
 1.15 11-Oct-2004  lukem Use load_rc_config `basename chrootdirscript` in a subshell to determine
the rc.conf(5) setting for chrootdirscript, incase the configuration
for that is in /etc/rc.conf.d/chrootdirscript.
Fixes PR 26478 from Jukka Salmi.
 1.14 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.13 18-Jun-2002  lukem branches: 1.13.4;
Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.12 22-Mar-2002  thorpej branches: 1.12.2;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.11 22-Mar-2002  lukem - Rename a bunch of "internal" run_rc_command() variables and officially
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)

_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.

_pid rc_pid PID of command (if appropriate).

_rc_run_fast rc_fast Not empty is "fast" was provided.

_rc_run_force rc_force Not empty is "force" was provided.

- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
 1.10 20-Feb-2002  lukem oops; forgot to retain previous setting of $_flags (aka $syslogd_flags)
which adding "-P /var/run/syslogd.sockets"...
 1.9 18-Jan-2002  lukem * build /var/run/syslogd.sockets to contain list of sockets in chrooted cages
that we know about, and start syslogd with -P /var/run/syslogd.sockets
if necessary.
* add ${ntpd_chrootdir}/var/run/log to known sockets
 1.8 12-Mar-2001  lukem if $named_chrootdir is defined, add ${named_chrootdir}/var/run/log to
the list of sockets listened to.
 1.7 19-Sep-2000  lukem - 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
 1.6 29-Jul-2000  veego syslog requires databases from sysdb which creates /var/run/utmp.
 1.5 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.4 14-May-2000  tron branches: 1.4.4;
Add "wscons" to requirement list so that a tty used for syslog output
will be created before starting the syslog daemon.
 1.3 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.2 02-Oct-2000  lukem pull up rev 1.7 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.12.2.1 18-Jun-2002  lukem Pull up revision 1.13 (requested by lukem in ticket #316):
Build the list of names to check for $XXX_chrootdir support from
`rcorder -k chrootdir` rather than hardcoding "named ntpd".
Based on [misc/16884] from Jarle Greipsland <jarle@uninett.no>
 1.13.4.1 16-Jan-2005  he Pull up revision 1.15 (requested by lukem in ticket #912):
Use "load_rc_config `basename chrootdirscript`" in a subshell
to determine the rc.conf(5) setting for chrootdirscript, incase
the configuration for that is in /etc/rc.conf.d/chrootdirscript.
Fixes PR#26478.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.2 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 27-Aug-2002  takemura Added touch panel calibration utility.
 1.7 10-Nov-2012  apb Make /etc/rc.d/ttys run after /etc/rc.d/bootconf.sh,
because bootconf could conceivably change /etc/ttys.
 1.6 10-Nov-2004  christos branches: 1.6.50; 1.6.56;
Don't try to chmod ptys if we have none.
 1.5 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.4 12-Feb-2002  lukem reset perms of ptyX[0-9a-zA-Z] instead of just ptyX[0-9a-f]
 1.3 25-Apr-2001  lukem setup tty[p-uw-zP-T]? (kern.maxpty default = 256) instead of just tty[p-s]?.
on platforms which don't reserve ttyv? for console on ttyv0, set up ttyv?
 1.2 13-May-2000  lukem Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.6.56.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.50.1 16-Jan-2013  yamt sync with (a bit old) head
 1.9 15-May-2007  elad Some Veriexec stuff that's been rotting in my tree for months.

Bug fixes:
- Fix crash reported by Scott Ellis on current-users@.

- Fix race conditions in enforcing the Veriexec rename and remove
policies. These are NOT security issues.

- Fix memory leak in rename handling when overwriting a monitored
file.

- Fix table deletion logic.

- Don't prevent query requests if not in learning mode.


KPI updates:
- fileassoc_table_run() now takes a cookie to pass to the callback.

- veriexec_table_add() was removed, it is now done internally. As a
result, there's no longer a need for VERIEXEC_TABLESIZE.

- veriexec_report() was removed, it is now internal.

- Perform sanity checks on the entry type, and enforce default type
in veriexec_file_add() rather than in veriexecctl.

- Add veriexec_flush(), used to delete all Veriexec tables, and
veriexec_dump(), used to fill an array with all Veriexec entries.


New features:
- Add a '-k' flag to veriexecctl, to keep the filenames in the kernel
database. This allows Veriexec to produce slightly more accurate
logs under certain circumstances. In the future, this can be either
replaced by vnode->pathname translation, or combined with it.

- Add a VERIEXEC_DUMP ioctl, to dump the entire Veriexec database.
This can be used to recover a database if the file was lost.
Example usage:

# veriexecctl dump > /etc/signatures

Note that only entries with the filename kept (that is, were loaded
with the '-k' flag) will be dumped.

Idea from Brett Lymn.

- Add a VERIEXEC_FLUSH ioctl, to delete all Veriexec entries. Sample
usage:

# veriexecctl flush

- Add a 'veriexec_flags' rc(8) variable, and make its default have
the '-k' flag. On systems using the default signatures file
(generaetd from running 'veriexecgen' with no arguments), this will
use additional 32kb of kernel memory on average.

- Add a '-e' flag to veriexecctl, to evaluate the fingerprint during
load. This is done automatically for files marked as 'untrusted'.


Misc. stuff:
- The code for veriexecctl was massively simplified as a result of
eliminating the need for VERIEXEC_TABLESIZE, and now uses a single
pass of the signatures file, making the loading somewhat faster.

- Lots of minor fixes found using the (still under development)
Veriexec regression testsuite.

- Some of the messages Veriexec prints were improved.

- Various documentation fixes.


All relevant man-pages were updated to reflect the above changes.

Binary compatibility with existing veriexecctl binaries is maintained.
 1.8 15-Oct-2005  elad Load Veriexec signatures after mountall. Use veriexec_strict and
veriexec_verbose to set strict level and verbose level in rc.conf.
Defaults are 0.
 1.7 11-Oct-2005  elad Revert previous commit; I'll find a better solution.
 1.6 11-Oct-2005  elad We need mountall here.
 1.5 15-Jun-2005  elad Run veriexec before securelevel and sysctl scripts. Suggested by Nino Dehne.
 1.4 20-Apr-2005  blymn Rototill of the verified exec functionality.
* We now use hash tables instead of a list to store the in kernel
fingerprints.
* Fingerprint methods handling has been made more flexible, it is now
even simpler to add new methods.
* the loader no longer passes in magic numbers representing the
fingerprint method so veriexecctl is not longer kernel specific.
* fingerprint methods can be tailored out using options in the kernel
config file.
* more fingerprint methods added - rmd160, sha256/384/512
* veriexecctl can now report the fingerprint methods supported by the
running kernel.
* regularised the naming of some portions of veriexec.
 1.3 13-Aug-2004  mycroft branches: 1.3.2;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 15-Jan-2004  uebayasi Missing rcvar. From Nicolas Joly in PR 24106.
 1.1 14-Jan-2004  blymn Add startup script for verified exec.
 1.3.2.5 21-Oct-2005  tron Pull up following revision(s) (requested by elad in ticket #896):
etc/defaults/rc.conf: revision 1.70
etc/rc.d/veriexec: revision 1.8
Load Veriexec signatures after mountall. Use veriexec_strict and
veriexec_verbose to set strict level and verbose level in rc.conf.
Defaults are 0.
 1.3.2.4 21-Oct-2005  tron Backout ticket 883. It has been superseeded by ticket 896.
 1.3.2.3 21-Oct-2005  tron Pull up following revision(s) (requested by elad in ticket #883):
etc/rc.d/veriexec: revision 1.6
We need mountall here.
 1.3.2.2 02-Jul-2005  tron Pull up revision 1.5 (requested by elad in ticket #487):
Run veriexec before securelevel and sysctl scripts. Suggested by Nino Dehne.
 1.3.2.1 10-Jun-2005  tron Pull up revision 1.4 (requested by elad in ticket #389):
Rototill of the verified exec functionality.
* We now use hash tables instead of a list to store the in kernel
fingerprints.
* Fingerprint methods handling has been made more flexible, it is now
even simpler to add new methods.
* the loader no longer passes in magic numbers representing the
fingerprint method so veriexecctl is not longer kernel specific.
* fingerprint methods can be tailored out using options in the kernel
config file.
* more fingerprint methods added - rmd160, sha256/384/512
* veriexecctl can now report the fingerprint methods supported by the
running kernel.
* regularised the naming of some portions of veriexec.
 1.9 02-May-2025  reed set command_interpreter in /etc/rc.d/virecover so status works

This was prompted by PR bin/31060
 1.8 13-Aug-2004  mycroft branches: 1.8.106;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 11-Jan-2004  uebayasi Define an rcvar "virecover" so that this can be configurable. The default
is YES.
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 11-Apr-2001  aymeric we now rely on /usr/libexec/virecover to get the work done
 1.4 09-Oct-2000  nisimura Use find(1) to search files in straight fashion with the cost of external
command invocation.
 1.3 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.2 13-May-2000  lukem branches: 1.2.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.2.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.106.1 02-Aug-2025  perseant Sync with HEAD
 1.4 21-Apr-2009  joerg Split fsck during boot into two phases. Check the root file system
first, mount root and run the various disk providers. Add swap and
check the remaining file systems after that.
This breaks the dependency cycle for lvm, which needs writeable /dev.
Depend on rndctl in cgd.
 1.3 15-Apr-2009  joerg Add missing PROVIDE.
 1.2 13-Aug-2004  mycroft branches: 1.2.22; 1.2.26; 1.2.36;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.1 30-Jul-2002  thorpej branches: 1.1.2;
Add a wdogctl startup/shutdown script.
 1.1.2.2 11-Nov-2002  he Pull up revision 1.1 (new, requested by thorpej in ticket #584):
Add a wdogctl startup/shutdown script.
 1.1.2.1 30-Jul-2002  he file wdogctl was added on branch netbsd-1-6 on 2002-11-11 23:42:03 +0000
 1.2.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.26.1 21-Feb-2008  mjf Start where the mjf-devfs branch left off.
 1.2.22.1 18-Feb-2008  mjf Add some devfs code that's been sitting in my local tree for a while.

devfsd(8) is now the first daemon to be started after init(8). It tracks
device insertion (will eventually track removal) and devfs mounts.

Currently, we can mount multiple device file systems and have device
special files pushed into the mounts automatically, though, the device
special files aren't created with the correct major/minor number pairs
yet.

More work to come soon.
 1.9 08-Sep-2020  martin Rename MOUNTCRITLOCAL to CRITLOCALMOUNTED to avoid a name collision
on case insensitive file systems
 1.8 22-Jul-2020  martin Split the local disk availability step into two phases to allow scripts
that pre-populate parts of the system (e.g. a tmpfs based /var) an
easy place to plug in like:

# REQUIRE: mountcritlocal
# BEFORE: MOUNTCRITLOCAL

This also cleans up the existing special handling a bit by separating it
into new scripts. All later scripts now depend on MOUNTCRITLOCAL.
Discussed on tech-userlevel some time ago.
 1.7 29-Jun-2018  roy Remove dhclient from the base system.

Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
 1.6 22-Jan-2015  jmcneill branches: 1.6.14; 1.6.16;
It doesn't make sense to start wpa_supplicant from an rc.d script without
the -B flag, so always prepend it to $rc_flags.
 1.5 23-Jan-2014  spz branches: 1.5.4;
- make etc/rc.d/wpa_supplicant create directory /var/run/wpa_supplicant
on startup
- create share/examples/wpa_supplicant/wpa_supplicant.conf and make it
known in the relevant places. Improvements welcome, my point was
ctrl_interface and "you seriously want this"
 1.4 01-Feb-2013  tron Make custom "reload" target work. Before this fix it would have tried
to send a HUP signal to "wpa_supplicant" instead.
 1.3 30-Sep-2009  apb branches: 1.3.6; 1.3.8; 1.3.12;
Document the fact that wpa_supplicant won't start properly unless
/usr is mounted by mountcritlocal.
 1.2 17-Nov-2008  abs Add a 'reload' option - from Peter Bex
 1.1 07-Oct-2006  rpaulo branches: 1.1.2; 1.1.18; 1.1.26;
PR 34692: wpa_supplicant script.
By Jukka Salmi.
 1.1.26.2 09-Jun-2013  msaitoh Pull up following revision(s) (requested by tron in ticket #1849):
etc/rc.d/wpa_supplicant: revision 1.4
Make custom "reload" target work. Before this fix it would have tried
to send a HUP signal to "wpa_supplicant" instead.
 1.1.26.1 18-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #69):
etc/rc.d/wpa_supplicant: revision 1.2
Add a 'reload' option - from Peter Bex
 1.1.18.1 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 18-Nov-2008  bouyer Pull up following revision(s) (requested by abs in ticket #1236):
etc/rc.d/wpa_supplicant: revision 1.2
Add a 'reload' option - from Peter Bex
 1.3.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.8.1 10-Feb-2013  riz Pull up following revision(s) (requested by tron in ticket #805):
etc/rc.d/wpa_supplicant: revision 1.4
Make custom "reload" target work. Before this fix it would have tried
to send a HUP signal to "wpa_supplicant" instead.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.4.1 23-Jan-2015  martin Pull up following revision(s) (requested by jmcneill in ticket #443):
etc/defaults/rc.conf: revision 1.129
etc/rc.d/wpa_supplicant: revision 1.6
It doesn't make sense to start wpa_supplicant from an rc.d script without
the -B flag, so always prepend it to $rc_flags.
 1.6.16.1 10-Jun-2019  christos Sync with HEAD
 1.6.14.1 28-Jul-2018  pgoyette Sync with HEAD
 1.14 08-Apr-2025  pgoyette Enable setting of font variable on console and constty

PR bin/59232
 1.13 09-Aug-2011  mbalmer branches: 1.13.56;
Print 'Keyboard encoding -> sg' instead of just 'encoding -> sg' on the
console.
 1.12 02-Apr-2007  mishka Provide yet more functionality to wscons.conf's "setvar" (see
examples in the wscons.conf). Now, you have to specify wscons
control device and put variable name and parameter on separate
fields.

NB: changes ARE NOT backward compatible and config file must be
checked (but default config doesn't utilizing setvar).
 1.11 13-Dec-2005  peter Add an extra argument to "setvar" to indicate whether a keyboard,
display or mouse variable should be changed. This is backwards compatible
with the old setvar style: if the argument is not specified, it defaults
to `keyboard'.
 1.10 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.9 26-Apr-2002  lukem - Improve wscons.conf(5)
- Add support for "setvar", which allows setting of arbitrary wsconsctl(8)
variables. Per email on tech-userlevel from Julio Merino <jmmv@hispabsd.org>
 1.8 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.7 02-May-2001  drochner Add support for selection of a kernel builtin keymap and/or a userspace
keymap file to wscons.conf.
Follows PR misc/12760 by Stephen Borrill, but uses the external keymap
file instead of individual key entries in wscons.conf. This saves a lot
of editing work if the map has to be switched.
 1.6 19-Sep-2000  lukem - 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
 1.5 21-Aug-2000  lukem migrate rc.wscons to (already existing) rc.d/wscons
 1.4 26-Jul-2000  lukem * add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp

Notes:
* dhclient (and others) needs /var to be a $critical_filesystem_beforenet
* dhclient now starts before syslogd (because the latter needs /usr, and
/usr might need dhclient to be mounted)

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 11-Mar-2000  veego Don't start rc.wscons with an start/stop argument. Disable stop and add an
checkyesno check.
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.4 02-May-2001  he Pull up revision 1.7 (requested by drochner):
Allow to select/modify keyboard map from /etc/wscons.conf.
Fixes PR#12760.
 1.3.4.3 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.3.4.2 24-Aug-2000  tron Finish incomplete pullup (approved by fvdl):

pull up rev 1.5:
move guts of etc/rc.wscons -> etc/rc.d/wscons
approved: thorpej
 1.3.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.13.56.1 02-Aug-2025  perseant Sync with HEAD
 1.3 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.2 04-Mar-2003  jmmv Use the pidfile created by wsmoused.
 1.1 27-Jun-2002  christos Add wsmoused
 1.9 05-Dec-2008  cube - Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.8 13-Aug-2004  mycroft branches: 1.8.26; 1.8.34;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 17-May-2004  lukem Update the paths to the required_files configuration files for the
move from /usr/X11R6/lib/X11/<app> -> /etc/X11/<app>.
Resolves PR [misc/25613] from Jukka Salmi.
 1.6 19-Sep-2000  lukem - 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
 1.5 17-Jul-2000  lukem add '# KEYWORD: shutdown' so that these scripts get run at shutdown time.
now, only scripts with the keyword `shutdown' will be run by /etc/rc.shutdown,
which speeds up shutdown and makes it more robust.
 1.4 13-May-2000  lukem branches: 1.4.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.3 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.4.4.2 02-Oct-2000  lukem pull up rev 1.6 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.4.4.1 09-Aug-2000  lukem pull up the following
approved by: thorpej

etc/rc.d/DAEMON 1.3
etc/rc.d/LOGIN 1.3
etc/rc.d/NETWORK 1.1
etc/rc.d/SERVERS 1.2
etc/rc.d/cron 1.4
etc/rc.d/dhclient 1.6
etc/rc.d/dmesg 1.4
etc/rc.d/inetd 1.5
etc/rc.d/lkm1 1.3
etc/rc.d/lkm2 1.3
etc/rc.d/lkm3 1.4
etc/rc.d/motd 1.3
etc/rc.d/mountcritlocal 1.3-1.4
etc/rc.d/mountcritremote 1.3
etc/rc.d/mountd 1.7
etc/rc.d/network 1.12 1.14
etc/rc.d/ntpdate 1.4
etc/rc.d/ppp 1.3-1.4
etc/rc.d/pwcheck 1.3
etc/rc.d/rpcbind 1.4
etc/rc.d/sshd 1.3-1.5
etc/rc.d/swap1 1.5
etc/rc.d/swap2 1.4
etc/rc.d/sysdb 1.3-1.4
etc/rc.d/syslogd 1.5-1.6
etc/rc.d/systemfs REMOVE
etc/rc.d/virecover 1.3
etc/rc.d/wscons 1.4
etc/rc.d/xdm 1.5

summary:

* reword descriptions
* add '# KEYWORD: shutdown' to some of these scripts so that only they get run
at shutdown time. now, only scripts with the keyword `shutdown' will be
run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust
* add new dummy dependancy `NETWORK' to be REQUIREd by services which need
networking to be operational before starting, and use as appropriate.
NETWORK depends upon network and dhclient.
* move the guts of systemfs into mountcritlocal
* replace the dependancy on systemfs with mountcritremote, and remove the
former.
* SERVERS now also depends upon ppp
* move recreating /var/run/utmp from mountcritlocal (where /var/run is
purged but /usr/bin/install is not available) to sysdb.
problem noted by Matthias Drochner.
* share the same load_rc_config between the lkm* scripts
* network: Don't warn that $hostname isn't set if the hostname is already set.
* network: reenable stop_cmd now that network doesn't get run at shutdown
* add sshd startup script
* use "load_rc_config swap" for swap1 and swap2
* syslog requires databases from sysdb which creates /var/run/utmp.

Should fix PRs:
[install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641]
 1.8.34.1 06-Dec-2008  snj Pull up following revision(s) (requested by cube in ticket #168):
etc/rc.d/Makefile: revision 1.70
etc/rc.d/xdm: file removal
etc/rc.d/xfs: file removal
etc/rc.d/xfs.in: revision 1.1
etc/rc.d/xdm.in: revision 1.1
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.8.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.1 05-Dec-2008  cube branches: 1.1.2; 1.1.4;
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 05-Dec-2008  mjf file xdm.in was added on branch mjf-devfs2 on 2009-01-17 20:43:44 +0000
 1.1.2.2 06-Dec-2008  snj Pull up following revision(s) (requested by cube in ticket #168):
etc/rc.d/Makefile: revision 1.70
etc/rc.d/xdm: file removal
etc/rc.d/xfs: file removal
etc/rc.d/xfs.in: revision 1.1
etc/rc.d/xdm.in: revision 1.1
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.1.2.1 05-Dec-2008  snj file xdm.in was added on branch netbsd-5 on 2008-12-06 22:03:15 +0000
 1.9 05-Dec-2008  cube - Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.8 13-Aug-2004  mycroft branches: 1.8.26; 1.8.34;
Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.7 17-May-2004  lukem Update the paths to the required_files configuration files for the
move from /usr/X11R6/lib/X11/<app> -> /etc/X11/<app>.
Resolves PR [misc/25613] from Jukka Salmi.
 1.6 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 09-Nov-2000  jdolecek make this REQUIRE also cleartmp, so that it's started after /tmp
is cleared, otherwise the xfs's socket might get removed
This fixes misc/10310 by Alasdair Baird
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 30-Apr-2000  lukem use extra_commands= instead of using 2nd argument to run_rc_command
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.2 10-Nov-2000  tv Pullup 1.5 [jdolecek]:
make this REQUIRE also cleartmp, so that it's started after /tmp
is cleared, otherwise the xfs's socket might get removed
This fixes misc/10310 by Alasdair Baird
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.8.34.1 06-Dec-2008  snj Pull up following revision(s) (requested by cube in ticket #168):
etc/rc.d/Makefile: revision 1.70
etc/rc.d/xdm: file removal
etc/rc.d/xfs: file removal
etc/rc.d/xfs.in: revision 1.1
etc/rc.d/xdm.in: revision 1.1
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.8.26.1 17-Jan-2009  mjf Sync with HEAD.
 1.1 05-Dec-2008  cube branches: 1.1.2; 1.1.4;
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 05-Dec-2008  mjf file xfs.in was added on branch mjf-devfs2 on 2009-01-17 20:43:44 +0000
 1.1.2.2 06-Dec-2008  snj Pull up following revision(s) (requested by cube in ticket #168):
etc/rc.d/Makefile: revision 1.70
etc/rc.d/xdm: file removal
etc/rc.d/xfs: file removal
etc/rc.d/xfs.in: revision 1.1
etc/rc.d/xdm.in: revision 1.1
- Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
 1.1.2.1 05-Dec-2008  snj file xfs.in was added on branch netbsd-5 on 2008-12-06 22:03:15 +0000
 1.3 02-May-2000  simonb Out with the old, in with the new.
 1.2 13-Mar-2000  lukem * replace daemon, login, servers with DAEMON, LOGIN, SERVERS
* remove sshd (it was from my private system)
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.8 11-Oct-2004  christos Use new style command substitution.
 1.7 11-Oct-2004  lukem Explicitly REQUIRE: rpcbind since these services directly use RPC...
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 22-Mar-2002  thorpej Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.4 19-Sep-2000  lukem - 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
 1.3 13-May-2000  lukem branches: 1.3.4;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 16-Mar-2000  lukem fix check for domainname since it can come from /etc/defaultdomain as well as $domainname
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.4.1 02-Oct-2000  lukem pull up rev 1.4 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.10 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.9 11-Oct-2004  christos Use new style command substitution.
 1.8 11-Oct-2004  lukem Explicitly REQUIRE: rpcbind since these services directly use RPC...
 1.7 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.6 22-Mar-2002  thorpej branches: 1.6.6;
Correct the "direction" of the barrier dependencies (DAEMON, LOGIN,
NETWORKING, and SERVERS) by specifying that certain things should
come BEFORE a given barrier, rather than having the barrier REQUIRE
a service. This allows scripts to be removed without having to
edit the barrier dependencies.

As discussed on tech-userlevel, and approved by Luke.
 1.5 19-Sep-2000  lukem - 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
 1.4 02-Jun-2000  fvdl branches: 1.4.2;
* Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.3 13-May-2000  lukem branches: 1.3.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 16-Mar-2000  lukem fix check for domainname since it can come from /etc/defaultdomain as well as $domainname
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.6.6.1 09-May-2005  riz Pull up revision 1.10 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.9 01-Apr-2005  lukem ypserv(8) doesn't need the domainname(1) set -- it will serve any maps
present under /var/yp/<somedomain>/<map> -- so don't require it.
Thanks to Chuck Cranor for the suggestion.
 1.8 12-Oct-2004  lukem Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20768 from Pavel Cahyna.
 1.7 11-Oct-2004  christos Use new style command substitution.
 1.6 13-Aug-2004  mycroft Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this
for a speedup by doing:
$_rc_subr_loaded . /etc/rc.subr
 1.5 19-Sep-2000  lukem branches: 1.5.6;
- 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
 1.4 02-Jun-2000  fvdl branches: 1.4.2;
* Portmap is now called rpcbind.
* Add IPv6 RPC entries to inetd.conf (commented out by default, as the others)
* Add netconfig file, needed for TI-RPC code.
 1.3 13-May-2000  lukem branches: 1.3.2;
Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf.
This allows us or a user to change the configuration file method in
one place - rc.subr - without having to edit all of the rc.d/* files.
 1.2 16-Mar-2000  lukem fix check for domainname since it can come from /etc/defaultdomain as well as $domainname
 1.1 10-Mar-2000  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 10-Mar-2000  lukem rc.d scripts derived from /etc/rc
 1.3.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.1 02-Oct-2000  lukem pull up rev 1.5 (approved by thorpej):
- always use $rcvar to determine the name of the var to checkyesno
- fix force*
 1.5.6.1 09-May-2005  riz Pull up revision 1.8 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.
 1.2 16-Jan-2003  martti Back out previous (as discussed with releng). The correct way to set this is:

# echo "myserver" > /var/yp/binding/`domainname`.ypservers
 1.1 16-Jan-2003  martti Script to bind a NIS client to a known server.

$ grep yp /etc/rc.conf
ypbind=YES
ypbind_flags="-ypset"
ypset=YES
ypset_flags="myserver"
 1.6 03-Aug-2021  mlelstv Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
 1.5 09-Dec-2019  sevan branches: 1.5.4;
This script just makes sure that the ZFS module loads and unloads, mountall
script takes care of mounting filesystems.
Don't try to unmount all file systems before unloading the ZFS module, leave
that to the operator in preperation or the mountall script to take care
of. Module will of course fail to unload then if file systems are still
mounted.
 1.4 08-Dec-2019  sevan We don't need to require the presence of /etc/zfs/zpool.cache to unmount &
unload the module, just like for the start target.
 1.3 04-Dec-2019  jmcneill Add missing rcvar=$name
 1.2 01-Dec-2019  jmcneill Attempt to load the zfs module even if /etc/zfs/zpool.cache is absent. The
module needs to be loaded to create a pool in the first place, and
autoloading won't work after the fact won't work at securelevel=1.
 1.1 15-Sep-2019  brad branches: 1.1.2;


Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.1.2.4 11-Dec-2019  martin Pull up following revision(s) (requested by sevan in ticket #539):

etc/rc.d/zfs: revision 1.4
etc/rc.d/zfs: revision 1.5

We don't need to require the presence of /etc/zfs/zpool.cache to unmount &
unload the module, just like for the start target.

This script just makes sure that the ZFS module loads and unloads, mountall
script takes care of mounting filesystems.

Don't try to unmount all file systems before unloading the ZFS module, leave
that to the operator in preperation or the mountall script to take care
of. Module will of course fail to unload then if file systems are still
mounted.
 1.1.2.3 08-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #516):

etc/rc.d/zfs: revision 1.2
etc/rc.d/zfs: revision 1.3

Attempt to load the zfs module even if /etc/zfs/zpool.cache is absent. The
module needs to be loaded to create a pool in the first place, and
autoloading won't work after the fact won't work at securelevel=1.

Add missing rcvar=$name
 1.1.2.2 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.1.2.1 15-Sep-2019  martin file zfs was added on branch netbsd-9 on 2019-09-27 09:18:37 +0000
 1.5.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.4.1 09-Dec-2019  martin file zfs was added on branch phil-wifi on 2020-04-13 07:45:46 +0000

RSS XML Feed