Commit Graph

686 Commits

Author SHA1 Message Date
riastradh d3b9fe60e3 Allow random seed on zfs. 2020-02-23 08:53:14 +00:00
roy 536a6b742b Revert unrelated changes to prior 2020-02-22 11:55:43 +00:00
roy 68c104dbdb rc.d/network: improve wording of waiting for DAD to finish 2020-02-22 11:52:45 +00:00
kim 6ca5a47e66 Use the configured IP6ADDRCTL_CMD for stopping also. 2020-02-14 12:12:07 +00:00
kim 5639632747 Add NetBSD ID 2020-01-27 08:33:24 +00:00
kim b5a7b1ab14 Skip inet6 addresses that begin with fe80: (not just exact match). 2020-01-27 08:28:33 +00:00
sevan a8ffec0052 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.
2019-12-09 00:11:32 +00:00
sevan 9112ea0837 We don't need to require the presence of /etc/zfs/zpool.cache to unmount &
unload the module, just like for the start target.
2019-12-08 00:58:16 +00:00
jmcneill 0bd087563f Add missing rcvar=$name 2019-12-04 16:46:50 +00:00
jmcneill aa92e84215 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.
2019-12-01 21:00:43 +00:00
christos 8f75e4b21c simplify more (from rudolf) 2019-10-23 14:45:38 +00:00
sevan 0e74c10957 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.
2019-10-05 22:21:29 +00:00
nonaka da6a94293e Moved zfs out of MKX11 block.
Fix build failure without X11.
2019-09-18 05:16:15 +00:00
brad 12ea0a140d 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.
2019-09-15 19:38:08 +00:00
rin 01a583bbb1 little bit verbose for slow machines 2019-08-09 10:05:44 +00:00
nakayama fa4c499b74 Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency. 2019-08-07 19:30:00 +00:00
maxv 0323b962b3 Remove comment, since there is no parsing anymore. 2019-05-13 18:53:10 +00:00
kre 480c945f6e 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.)
2019-05-12 11:55:47 +00:00
kre 6ae1c84105 No change... Previous log message should have said:
Install rc.d/smtoff
2019-05-12 01:50:14 +00:00
kre 1aa98bd080 install rc.d 2019-05-12 01:33:47 +00:00
kre 7476299781 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.
2019-05-12 00:24:03 +00:00
maxv 907a706c0b 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.
2019-05-11 19:31:03 +00:00
roy b312a806c1 Fix build, install wsmoused 2019-04-25 11:21:34 +00:00
roy d73f7f4f61 Don't install YP rc.d files with MKYP=no 2019-04-25 08:56:21 +00:00
leot 39ae4dd0ba Do not start npf again at reboot (it is started via npf_boot) 2019-04-19 18:36:25 +00:00
sevan 967446d222 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.
2019-04-10 00:32:15 +00:00
sevan 14689fed34 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.
2019-04-02 01:50:32 +00:00
mrg 0050db9471 only flush routes in stop routine if flushroutes is true, same as
the start up.
2018-10-23 09:25:33 +00:00
martin a52a4fdc24 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.
2018-10-19 14:11:12 +00:00
jmcneill 51976c5c14 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.
2018-10-06 13:09:53 +00:00
martin 56d7a6f003 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)
2018-09-30 10:38:05 +00:00
maxv 6049b090a1 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.
2018-09-23 07:24:19 +00:00
christos f062baa468 handle v6 addresses 2018-08-13 09:16:06 +00:00
roy eb279c7f26 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.
2018-07-27 15:31:02 +00:00
roy b729dec75a Remove dhclient from the base system.
Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
2018-06-29 12:34:13 +00:00
sevan 66fd14939a 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.
2018-06-08 14:44:21 +00:00
riastradh aafff8763a 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.
2018-05-26 19:18:11 +00:00
jmcneill c9b64841e5 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.
2018-05-26 00:17:54 +00:00
christos e5ff1cf5fd Simplify so we don't have to hard-code the key filenames in two places. 2018-04-09 15:02:39 +00:00
christos 733ab037c6 support xmss keys 2018-04-07 00:41:16 +00:00
uwe 097b3add5a Actually install dhcpd6 rc script. Organize CONFIGFILES
alphabetically again while where.

PR 53018
2018-02-17 03:02:04 +00:00
christos b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
is d9123c9e75 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.
2017-12-29 18:15:48 +00:00
kre 6b923cca7a 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.
2017-12-04 14:50:33 +00:00
sevan 0759fcfcfc 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
2017-10-07 21:41:51 +00:00
kre 810e1e7da1 Revert previous - not a typo, even though it looks like one 2017-07-06 09:49:39 +00:00
kre b1a3593132 PR misc/52370
Correct typo.

XXX pullup 8, pullup 7
2017-07-06 09:24:47 +00:00
christos 71cba524e4 add scripts for npfd 2017-01-05 14:39:09 +00:00
kre 8ad774dbf7 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.
2016-11-19 01:14:58 +00:00
kre 1675d6af19 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.
2016-11-18 23:10:05 +00:00
riastradh 6b3de624e6 Handle variable expansion and comma/space separators in postconf.
From Timo Buhrmester:
https://mail-index.netbsd.org/tech-userlevel/2016/08/20/msg010301.html
2016-10-30 15:47:06 +00:00
christos 90ff2f0a25 Adjust for new ifconfig address/mask output. 2016-10-19 21:27:10 +00:00
kre a5229b934a 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.)
2016-07-23 01:38:35 +00:00
dholland 796a3ac327 Avoid unnecessary use of basename(1). From Jukka Salmi a long, long time
ago on a tech-kern far, far away.
2016-04-23 21:24:31 +00:00
christos d6c8225a0e use kat, a version of cat that strips comments 2016-03-06 18:50:06 +00:00
roy 2357a4fb46 Use the new -P option to work out which pidfile dhcpcd will use. 2016-01-07 22:03:00 +00:00
roy d0367588d0 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.
2016-01-07 11:51:07 +00:00
christos dd01c08e97 remove some stuff we don't have; rename rc command variable. 2015-12-23 04:38:00 +00:00
christos ff0756d560 Add ip6addrctl 2015-12-13 02:05:15 +00:00
christos 0e5ab369bd 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
2015-11-23 19:56:47 +00:00
roy 8b04443cd8 Fix the problem of just having a valid interface name in dhcpcd_flags. 2015-10-16 18:06:22 +00:00
roy c95ec17135 Make mdnsd start before NETWORKING and require staticroute, mountcritlocal
and networking.
Fixes PR install/43313.
2015-10-15 16:47:28 +00:00
riz e3d8d886ce Implement "status" command for postfix - makes tools like ansible
happier.
2015-07-23 17:12:16 +00:00
dholland 562a53e657 /usr/sbin/chown -> /sbin/chown
(not sure why these need explicit paths at all, but whatevs)
2015-07-03 18:36:54 +00:00
prlw1 68974b6b61 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
2015-04-20 18:01:46 +00:00
jmcneill f02362348e fix typo in previous; pass -y unconditionally to resize_ffs, not -p 2015-04-07 18:02:11 +00:00
jmcneill 906c0d847e add KEYWORD: interactive, honour resize_root_flags and resize_root_postcmd rc vars 2015-04-06 22:40:09 +00:00
mlelstv b68ba22239 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.
2015-04-06 15:07:50 +00:00
chopps 94dff34741 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.
2015-03-30 10:58:37 +00:00
jmcneill 7ba4328bfa Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
2015-03-21 19:10:43 +00:00
joerg 88c9fb0be8 Add rc script for /sbin/iscsid. 2015-02-21 23:13:00 +00:00
jmcneill f1c95757e8 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.
2015-01-22 19:50:21 +00:00
spz 1690f8559d 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
2014-12-25 23:00:18 +00:00
christos bd08953ecc Add new keytype, replace duplicated code with loop 2014-10-19 16:33:01 +00:00
christos bad357ce4f fix syntax error 2014-10-14 20:49:47 +00:00
roy f68fe4cac7 Use checkyesnox to test rtsol as it has been removed including its
default configuration which we should not warn about.
2014-09-21 09:48:32 +00:00
roy f542fd2122 Don't try and install rc.d/rtsold 2014-09-11 18:01:22 +00:00
roy c6314d6139 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@
2014-09-11 13:10:03 +00:00
wiz 7f6fa64667 'file system' for consistency with documentation (instead of 'filesystem'). 2014-07-22 17:11:09 +00:00
spz 652bd7d1b3 Create the dhcpd.leases file if it doesn't exist already, don't just
warn about it not being there.
Closes PR misc/48868
2014-07-17 07:17:03 +00:00
tls 916085404d 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. 2014-07-13 22:06:56 +00:00
spz 46ee6da10e create /etc/rndc.key on start if it doesn't already exist 2014-07-08 07:04:07 +00:00
uebayasi a270487d77 Indent. 2014-04-29 09:58:18 +00:00
uebayasi 4f67388957 Refactor a little to remove huge indents. 2014-04-29 09:56:16 +00:00
uebayasi 0db0bb3da5 Split huge monolithic functions for readability. 2014-04-29 09:42:51 +00:00
khorben cf10990721 Allow the extra command "reload" to dhcpcd's rc script, letting it reload
its configuration and rebind directly via the script.

LGTM roy@
2014-04-06 17:13:57 +00:00
spz 8797028bc7 - 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"
2014-01-23 07:26:50 +00:00
christos 8f0c389494 wait until our local address is available before configuring. 2013-09-12 19:52:50 +00:00
roy d87d6793f0 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
2013-07-09 09:34:58 +00:00
roy e3bb11dade 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
2013-06-25 13:02:53 +00:00
christos aa3896734e 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.
2013-06-14 16:37:55 +00:00
yamt 8782935dec try to sync lists of rc.d scripts 2013-05-16 07:37:05 +00:00
christos a33513dc62 don't attempt to create interfaces that exist and don't hide errors. 2013-04-20 18:24:18 +00:00
christos df473aee24 PR/47540: Felix Deichmann: DSA keys can only be 1024 bits. 2013-02-07 19:32:19 +00:00
tron b1d97a6429 Make custom "reload" target work. Before this fix it would have tried
to send a HUP signal to "wpa_supplicant" instead.
2013-02-01 13:29:33 +00:00
prlw1 281a5e1fdb 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
2013-01-13 18:47:57 +00:00
christos 191ca062bf add a sync to make it less likely to boot with /etc pointing to nothing after
a crash.
2012-12-31 23:21:27 +00:00
christos 7c8b13934d better messages, more quoting. 2012-12-29 22:15:07 +00:00
apb 448aa50d4c 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.
2012-12-17 18:20:50 +00:00
apb c755e023f2 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.
2012-12-14 18:42:25 +00:00