Commit Graph

572 Commits

Author SHA1 Message Date
gendalia 7591311640 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.
2012-05-02 15:57:15 +00:00
nakayama 81cae6fbb5 Avoid rebuilding services database every boot time.
The database has been renamed since the default was changed to CDB format.
2012-02-21 12:30:32 +00:00
joerg 410d0f4380 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.
2012-02-07 19:13:24 +00:00
mbalmer 2e290c8200 For the sake of consistency with other scripts, output a full stop after the
word 'done'.  releng ok.
2012-02-07 10:36:01 +00:00
tsutsui a7f5216f76 Add an rc.d(8) script for isibootd(8). Taken from ndbootd(8). 2011-12-17 13:37:49 +00:00
tls 4924aa205a 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.
2011-11-23 10:47:48 +00:00
darcy 77a099d5ff Allow pf flags to be specified in rc.conf.
Add default to defaults/rc.d as suggested by lukem@
2011-11-21 20:56:21 +00:00
apb b80ac66c04 Don't try to fsck root device if "/" is not mentioned in fstab.
Also don't assume that all network mounts are "nfs".
2011-09-20 12:13:21 +00:00
riz 6fc3b870af 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.
2011-09-06 21:32:29 +00:00
mbalmer d88fd18413 Terminate line with a '.', not the word 'done', for consistency with other
startup scripts.
2011-09-02 07:13:28 +00:00
uwe 53fc796546 Revert previous as it introduces "Circular dependency on provision
`mountcritremote'".

route6d is "BEFORE: NETWORKING" and was made to "REQUIRE: mountcritremote",
but mountcritremote "REQUIRE: NETWORKING".
2011-08-18 16:46:14 +00:00
gdt ef4e1527ca 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.
2011-08-17 16:39:29 +00:00
mbalmer a8d3ab0aa2 Print 'Keyboard encoding -> sg' instead of just 'encoding -> sg' on the
console.
2011-08-09 08:08:10 +00:00
christos 3c5f87c86e generate ecdsa key 2011-07-25 03:04:23 +00:00
plunky b41529f23b remove empty files 2011-06-18 18:43:41 +00:00
hans 21f62f04a1 remove -q argument, it is useless with Xorg and fails with XFree 2011-06-15 13:42:46 +00:00
plunky b52bb12959 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.
2011-05-27 09:28:41 +00:00
enami d89653b315 Unconfigure on shutdown so that component deivces are closed. 2011-04-05 02:52:27 +00:00
jmcneill 0cce2c7d9b put a : in an otherwise empty function, makes this script work with bash 2011-03-07 23:21:13 +00:00
jmcneill a58d526ab8 Add rc.d script to make sure the system fontconfig cache is up to date. 2011-02-18 00:42:20 +00:00
rmind 07ac07d35f 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.
2011-02-02 02:20:24 +00:00
haad 7532abd112 Use chown now when it's available without /usr mounted. 2011-01-13 22:30:09 +00:00
kefren e0adf296c4 add ldpd rc script 2011-01-13 10:55:19 +00:00
haad 2dc8282a58 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
2011-01-08 16:16:51 +00:00
haad 912a040b47 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.
2011-01-05 14:57:27 +00:00
christos 29f0bfc6b2 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).
2010-11-01 14:42:08 +00:00
christos a8684509ca add a cgd_stop function 2010-11-01 14:41:11 +00:00
apb cc2db4f5f3 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.
2010-09-26 18:52:04 +00:00
bad 712189440d 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.
2010-09-25 15:10:14 +00:00
wiz 7163aafc26 Fix typo in sdpd, reported by Jukka Salmi in PR 43401.
This also affected bthcid, so I also fixed it there.
2010-06-01 21:08:13 +00:00
christos 55499e9fb3 Exclude root, since that is done in fsck_root. 2010-02-17 23:32:07 +00:00
mrg c291955dfd 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.
2010-02-16 02:46:02 +00:00
drochner 9b670cd37e fix an obvious typo in directory check 2010-01-23 17:44:44 +00:00
elad 4fc2067c9d Securelevel might not be present, properly complain instead of printing
error messages from sysctl(8).
2009-12-29 17:06:10 +00:00
haad f6e34e608b 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.
2009-10-18 21:58:37 +00:00
tron 8b451badf9 Add proper error reporting via the return code:
Remember if any of the "route" commands failed and return an error in
that case.
2009-10-07 08:06:11 +00:00
tron 9435d86beb Add a "return 0" to avoid incorrect error returns because we ran out of
lines to read from "/etc/route.conf".
2009-10-07 07:51:28 +00:00
haad cc9255a89b 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.
2009-10-05 22:39:27 +00:00
apb db5a8e6176 Document the fact that wpa_supplicant won't start properly unless
/usr is mounted by mountcritlocal.
2009-09-30 18:17:22 +00:00
tsarna a8bcd3b5c3 Multicast DNS ("Bonjour") support, based on Apple's mDNSResponder. 2009-09-29 23:56:26 +00:00
apb 27a9530c2c Adapt /etc/rc.d/swap1 and swap2 scripts to the new meaning of
exit status 2 from swapctl(8).
2009-09-24 16:45:48 +00:00
apb a83419cd12 Check whether a core dump exists before trying to save it. This should
prevent /etc/rc from thinking that /etc/rc.d/savecore failed.
2009-09-14 17:34:56 +00:00
apb 2fc6cb0baa It's print_rc_metadata, not rc_print_metadata. 2009-09-12 17:40:01 +00:00
cegger e72611bc37 backout rev. 1.59. Will be re-done differently. 2009-09-11 21:25:07 +00:00
apb 3a49704c6b 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.
2009-09-11 18:18:03 +00:00
apb bd87591cb3 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.
2009-09-11 18:17:43 +00:00
cegger eb4ebcd11a Do not flush routes if root file system is nfs mounted.
Fixes boot problem when the nfs server is in a different subnet.
2009-09-08 08:56:33 +00:00
apb 7259650e89 Delete a line that was accidentally included from work in progress. 2009-09-06 12:30:45 +00:00
apb 89432e7545 * 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).
2009-09-05 16:26:07 +00:00
apb 660b31de3a Use functions from rc.subr. 2009-09-05 16:24:03 +00:00
perry a8420debfe 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
2009-08-03 18:43:48 +00:00
perry b3d763cf9b 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.
2009-08-03 17:45:48 +00:00
mbalmer 70d654f756 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.
2009-07-25 16:20:10 +00:00
christos 87fc4e29f5 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
2009-07-10 20:02:21 +00:00
christos 3baf6d1ea8 now that pwd_mkdb does not change the version, warn if we still have version
0 databases.
2009-06-18 22:00:04 +00:00
roy da87763c6e 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
2009-05-14 15:33:36 +00:00
roy 6bdecd9c27 Add an rc.d script for dhcpcd(8) 2009-04-28 23:30:34 +00:00
apb 49e8137612 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.)
2009-04-28 13:08:51 +00:00
christos 923c91a5d0 handle new directory structure. 2009-04-25 15:46:19 +00:00
christos 61af394aa4 PR/41273: Martin Mersberger: missing '/' in /etc/rc.d/named in section
named_migrate
2009-04-24 14:26:02 +00:00
christos ad38869bc4 Adjust for new default location of the pid file. 2009-04-22 18:27:03 +00:00
joerg e7f29a3386 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.
2009-04-21 16:08:57 +00:00
joerg 49451a8f9f Add a small script to visualize the rc dependency graph and point to it. 2009-04-15 22:36:04 +00:00
perry bb9a479c59 un-uppercase pseudodependency for the moment so as not to break pkgsrc 2009-04-15 22:11:32 +00:00
perry 6b9d40b026 uppercase pseudodependency 2009-04-15 22:03:54 +00:00
joerg c06d8659e3 Add missing PROVIDE. 2009-04-15 21:33:57 +00:00
haad 94d1f41faa We need writable /dev to get lvm working otherwise lvm devices can't be created. 2009-04-13 18:48:14 +00:00
martin 58cbc21957 systime() is not needed here - as the man page clearly points out.
Noticed by pooka.
2009-04-08 13:29:59 +00:00
martin d37420f7ca Awk has strftime() and systime(), so no need to pipe the output of date
into the script - just do it internally.
2009-04-08 13:18:56 +00:00
hannken a51a8b101a 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>
2009-03-23 18:52:02 +00:00
haad 75fa841288 When setting LV_LIST variable do not use $LV_LIST. 2009-03-05 10:35:43 +00:00
apb 1cdee1d2a2 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.
2009-02-02 09:24:47 +00:00
haad 94a80e6646 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@.
2009-01-20 00:40:59 +00:00
haad 660aec81c7 Add lvm rc.d script to build. 2009-01-16 01:59:23 +00:00
haad 6fa32f841f 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.
2009-01-14 22:07:55 +00:00
lukem 006b668ed0 attempt to make the NOTE a bit more prominent 2009-01-08 02:07:28 +00:00
apb a0398a9d79 * 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).
2009-01-04 12:10:30 +00:00
isaki cf59801230 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.
2008-12-20 13:20:58 +00:00
mishka 43e91ff9f2 Import rc.d/httpd script for httpd(8) daemon control.
See rc.conf(5) for options explanation.
2008-12-11 13:55:16 +00:00
cube 4edff860d5 - Generate xdm and xfs depending on the value of X11FLAVOUR
- Only generate and install them for MKX11 builds
2008-12-05 18:55:22 +00:00
tsutsui 63156ee6a4 /etc/rc.d/mountall should obviously REQUIRE mountcritremote, and
may also REQUIRE named and ypbind for NFS hostname in fstab(5).
2008-12-01 14:47:14 +00:00
tsutsui 3381903ec0 Add "bootconf" to REQUIRE: lines which had beforenetlkm
since removed beforenetlkm required bootconf.
2008-11-22 20:23:33 +00:00
abs 845c5d6f11 Add a 'reload' option - from Peter Bex 2008-11-17 11:34:04 +00:00
ad 0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
christos 6536944397 eval arguments one more time so that quoting works. 2008-10-11 17:28:03 +00:00
apb 9b7231008d Move default route configuration after interface alias address
configuration, in case people have default routes over aliased
addresses.
2008-09-26 10:31:46 +00:00
apb c44f01fe5d remove an unecessary "eval" 2008-09-20 14:22:57 +00:00
apb 94f952dfe5 * 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"
2008-09-20 12:12:38 +00:00
reed 2ae533f9b5 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.)
2008-07-24 19:48:19 +00:00
yamt fff57c5525 merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@.  requested by core@
2008-06-18 09:06:25 +00:00
joerg 32455b2087 Allow per-interface DHCP configuration using dhcpcd via
ifconfig_xxN=dhcp or a dhcp line in /etc/ifconfig.xxN.
2008-05-29 15:38:35 +00:00
plunky 486e4624e5 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
2008-04-15 11:17:47 +00:00
tron 634457e76e Print out a message explaining why the system is rebooting if the root
filesystem is modified by fsck(8).
2008-03-02 21:31:30 +00:00
tron 5acd6cb052 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.
2008-02-25 22:12:42 +00:00
christos 3a24c02f26 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
2008-02-24 01:05:35 +00:00
reed f8fd203aa2 Add comment to point to manual page for details. 2008-01-31 15:21:32 +00:00
lukem 114e456e17 Ensure kdc starts after syslogd and ntpdate. 2008-01-16 23:58:26 +00:00
mjf d4a648c345 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@
2007-12-04 22:09:01 +00:00
xtraeme 2026f84dc1 Only print the message if the command ran successfully. 2007-10-07 05:30:56 +00:00
xtraeme 4b431f1771 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!
2007-10-07 04:19:06 +00:00