Commit Graph

1115 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
b202f3dc89 Install the IPv6 reject routes we do for the default FIB to all FIBs.
Sponsored by:	Cisco Systems, Inc.
2012-02-03 15:31:47 +00:00
Hiroki Sato
d830cea6b7 Perform IPv6 DAD only in ifn_start. 2012-01-29 08:33:34 +00:00
Hiroki Sato
f6e5ba31d2 Fix several glitches in IPv6-related knobs:
- ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for
  backward compatibility.

- Configurations in ipv6_prefix_IF should be recognized even if there is no
  ifconfig_IF_ipv6.

- DAD wait should be performed at once, not on a per-interface basis, if
  possible.  This fixes an issue that a system with a lot of IPv6-capable
  interfaces takes too long for booting.

MFC after:	1 week
2012-01-22 10:57:32 +00:00
Brooks Davis
2dd3bcd48d When creating the jails /dev/log symlink, do it by full path to avoid
creating stray "log" symlinks if the mount fails.  That apparently
happens in some ezjail configs.

PR:		conf/143084
Submitted by:	Dirk Engling <erdgeist at erdgeist.org>
Reviewed by:	simon
MFC after:	2 weeks
2012-01-20 22:55:19 +00:00
Eygene Ryabinkin
1eea470950 dhclient: don't use syslog for logging non-DHCP interface errors
We should show the error to user, but it doesn't deserve syslog.

Approved by: jhb
2012-01-20 17:19:50 +00:00
Doug Barton
801c438304 Prepare for the removal of set_rcvar() by changing the rcvar=
assignments to the literal values it would have returned.

The concept of set_rcvar() was nice in theory, but the forks
it creates are a drag on the startup process, which is especially
noticeable on slower systems, such as embedded ones.

During the discussion on freebsd-rc@ a preference was expressed for
using ${name}_enable instead of the literal values. However the
code portability concept doesn't really apply since there are so
many other places where the literal name has to be searched for
and replaced. Also, using the literal value is also a tiny bit
faster than dereferencing the variables, and every little bit helps.
2012-01-14 02:18:41 +00:00
Eygene Ryabinkin
0113cca483 rc.d: document 'quiet' prefix and fix dhclient/devd interaction
Document the current semantics of the 'quiet' command prefix
in the rc.subr(8).

Fix dhclient rc.d script: it should not call err() for
non-DHCP-enabled interface when it is called from devd, because the
latter just blindly calls 'service dhclient quietstart' on each "link
up" event.

Since the 'quietstart' will silence the message "Cannot 'start' <foo>.
Set <foo>_enable to YES in /etc/rc.conf or use 'onestart' instead of
'start'." and running dhclient on the non-DHCP-enabled interface is
the same thing as running the service <foo> without <foo>_enable set,
such modification is in sync with the current semantics of the 'quiet'
prefix.

Approved by: glebius
Reviewed by: freebsd-rc list
MFC after:	2 weeks
2012-01-12 06:48:11 +00:00
Gleb Smirnoff
5c39f7bdeb Bunch of fixes to pfsync(4) module load/unload:
o Make the pfsync.ko actually usable. Before this change loading it
  didn't register protosw, so was a nop. However, a module /boot/kernel
  did confused users.
o Rewrite the way we are joining multicast group:
  - Move multicast initialization/destruction to separate functions.
  - Don't allocate memory if we aren't going to join a multicast group.
  - Use modern API for joining/leaving multicast group.
  - Now the utterly wrong pfsync_ifdetach() isn't needed.
o Move module initialization from SYSINIT(9) to moduledata_t method.
o Refuse to unload module, unless asked forcibly.
o Improve a bit some FreeBSD porting code:
  - Use separate malloc type.
  - Simplify swi sheduling.

This change is probably wrong from VIMAGE viewpoint, however pfsync
wasn't VIMAGE-correct before this change, too.

Glanced at by:	bz
2012-01-09 08:50:22 +00:00
Doug Barton
a194b02d88 There is no longer a need to abstract ${rcvar_manpage} as we are not
attempting to maintain compatibility with NetBSD for some years now.
2012-01-08 20:25:29 +00:00
Ulrich Spörlein
081dc98788 Spelling fixes for etc/ 2012-01-07 16:10:32 +00:00
Pawel Jakub Dawidek
e3bf08680d Add 'nojail' keyword as auditd(8) can't really do anything useful when
inside a jail.

Discussed with:	rwatson
MFC after:	1 week
2012-01-06 14:00:31 +00:00
Pawel Jakub Dawidek
04d8001793 - Put one file into one line. This makes keeping local changes and merging
with FreeBSD easier for vendors.
- For optional files use variables starting with underscore.

Both changes make rc.d/Makefile look similar to sys/modules/Makefile.

Reviewed by:	dim
2011-12-15 21:06:37 +00:00
David E. O'Brien
59509bae0a Ensure kldxref is run first. Currently both 'kldxref' and 'kld' depend
on "FILESYSTEMS" and 'kld' is being run 8 scripts ahead of 'kldxref'.

Reported by:	dhw
2011-12-01 22:50:10 +00:00
Jilles Tjoelker
e60150fafa rc.d: Eliminate some unnecessary non-POSIX constructs:
* set - ...
 * empty braces
 * ^ in character class
2011-11-08 23:02:32 +00:00
Dimitry Andric
66aa9b8dc9 Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf,
the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3.

Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd
via the rc.d script, without rebooting, the sysctl does *not* get reset
to max version 4, so NFSv4 still doesn't work.

Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when
NFSv4 is requested.

I also added resetting of the nfs_privport sysctls, since this has the
same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport
sysctl to 1, but in the other case, the sysctl doesn't get reset to 0.

Reviewed by:	rmacklem
Silence from:	rc@
MFC after:	3 days
2011-11-05 16:47:47 +00:00
Eygene Ryabinkin
0c4b17e1e7 Fix handling of rc_force in /etc/rc.d/dhclient
Variable 'rc_force' is accessible only at the time of rc_run_command,
so it can't be examined from the script's main code.

Spotted by:	hrs
Reviewed by:	hrs, des
Approved by:	des
MFC after:	2 weeks
2011-10-28 06:03:38 +00:00
Martin Matuska
4d428b10ae Correctly reassign copyright of etc/rc.d/static_ndp back to delphij@
as the project itself is no legal entity

Reported by:	Joe Dahl <joel@vnode.se>
MFC after:	3 days
2011-10-23 10:17:42 +00:00
Martin Matuska
dbedf61ce3 Add etc/rc.d/static_ndp, analogous to etc/rc.d/static_arp.
Make sure that static ARP and NDP bindings are set before NETWORKING.

As static_ndp is based on static_arp, pass copyright to the project with
permission of the original author (delphij@).

Reviewed by:	delphij@FreeBSD.org
MFC after:	3 days
2011-10-23 09:08:42 +00:00
Dag-Erling Smørgrav
32ca8e078d The rc_force test was inverted in the previous commit, so that dhclient ran
for interfaces which were not configured for DHCP *unless* rc_force was set;
the correct logic is to run dhclient for those interfaces *only if* rc_force
is set.

Broken by:	des@
Noticed by:	everybody and his dog
Submitted by:	rea@
PR:		bin/161733
2011-10-17 13:05:57 +00:00
Dag-Erling Smørgrav
23f39c906b Make dhclient use a pid file. Modify the rc script accordingly; while
there, clean it up and add some error checks.

Glanced at by:	brooks@
MFC after:	3 weeks
2011-10-13 17:20:45 +00:00
Hiroki Sato
04303fd864 Use REQUIRE: line to reorder rc.d/bridge instead of BEFORE: line.
Pointed out by:	dougb
Approved by:	re (bz)
2011-09-20 00:37:35 +00:00
Hiroki Sato
33b9d9a8d2 Use resolvconf(8) to create /etc/resolv.conf, not directly overwrite it.
Approved by:	re (kib)
2011-09-19 15:56:50 +00:00
Hiroki Sato
f8c5f6a6b8 Fix the script order to run rc.d/bridge after the initial network
interface configuration and before running network daemons.

Approved by:	re (kib)
2011-09-19 15:55:53 +00:00
Hiroki Sato
049087a0f3 Add $ipv6_cpe_wanif to enable functionality required for IPv6 CPE
(r225485).  When setting an interface name to it, the following
configurations will be enabled:

 1. "no_radr" is set to all IPv6 interfaces automatically.

 2. "-no_radr accept_rtadv" will be set only for $ipv6_cpe_wanif.  This is
    done just before evaluating $ifconfig_IF_ipv6 in the rc.d scripts (this
    means you can manually supersede this configuration if necessary).

 3. The node will add RA-sending routers to the default router list
    even if net.inet6.ip6.forwarding=1.

This mode is added to conform to RFC 6204 (a router which connects
the end-user network to a service provider network).  To enable
packet forwarding, you still need to set ipv6_gateway_enable=YES.

Note that accepting router entries into the default router list when
packet forwarding capability and a routing daemon are enabled can
result in messing up the routing table.  To minimize such unexpected
behaviors, "no_radr" is set on all interfaces but $ipv6_cpe_wanif.

Approved by:	re (bz)
2011-09-13 00:06:11 +00:00
Xin LI
aefb9fe04f Honor WITHOUT_IPX when installing etc/rc.d/ipxrouted.
MFC after:	1 week
Approved by:	re (kib)
2011-08-23 19:29:11 +00:00
Doug Barton
ab1779e30e Revert the apparently-unecessary module_path twiddling from r223917
Approved by:	re (kib)
2011-07-22 21:08:19 +00:00
Jilles Tjoelker
068c02de6d rc.d/routing: Fix ugly output with additional routing options.
Print a separate "Additional routing options" line for each address family
which has additional options, so that it does not get mixed up with the
output from adding routes.

This also reverts r224048 which added newlines to two arbitrary routing
options.
2011-07-17 14:52:55 +00:00
Kevin Lo
d99dc333db Remove "-n" from echo
Reviewed by:	dougb
2011-07-15 01:59:08 +00:00
Doug Barton
c2d900ef50 Make sure we load kernel modules from the same path as the running kernel 2011-07-10 23:47:03 +00:00
Rick Macklem
1e2cac7b7f Delete the /etc/rc.d/nfsserver script, since it is no
longer used by /etc/rc.d/nfsd and it is no longer necessary
to load the old nfs server by default, when nfs_server_enable="YES".

Tested by:	sgk at troutmask.apl.washington.edu
Reviewed by:	rc (Andrzej Tobola)
2011-07-08 00:49:50 +00:00
Rick Macklem
c4c07ee035 Fix the /etc/rc.d/nfsd script so that it no longer uses
the /etc/rc.d/nfsserver script to load the old nfs server
module.

Tested by:	sgk at troutmask.apl.washington.edu
Reviewed by:	rc (hrs)
2011-07-07 20:59:42 +00:00
Sergey Kandaurov
1bb5e90ffd Run load_rc_config before stop_cmd definition, so that ${quotaoff_flags}
is correctly expanded inside stop_cmd instead of getting nothing.

PR:		conf/157687
Reported by:	Dmitry Banschikov <d.banschikov peterhost ru>
MFC after:	1 week
2011-06-28 14:26:34 +00:00
Doug Barton
ef247ddad1 I knew there was something funny about this line 2011-06-22 06:27:32 +00:00
Doug Barton
0ee974f9cf Blah, forgot to svn add the actual script from r223310 2011-06-19 22:59:54 +00:00
Doug Barton
d732b516ea Add the netwait rc.d script. It waits for the specified period for the
network to become active.

PR:		conf/151063
Submitted by:	Jeremy Chadwick <freebsd@jdc.parodius.com>
2011-06-19 22:48:40 +00:00
Doug Barton
aff92fcbb9 Add rc.d/kld to load kernel modules after local disks are up.
This method is many times faster than doing it in /boot/loader.conf.
2011-06-18 19:41:05 +00:00
Hiroki Sato
1e1c0371e6 - Remove $ipv6_gateway_enable check.
- Use list_net_interfaces() instead of "ifconfig -l".
2011-06-11 21:41:44 +00:00
Rick Macklem
34eb31ca42 Make three one line changes to the rc scripts so that
they work with the new NFS client being the default,
since the new NFS client's module name is nfscl and
not nfsclient.
2011-06-11 21:14:22 +00:00
Hiroki Sato
88492dfb20 Remove redundant keywords.
Submitted by:	wxs
2011-05-17 07:40:13 +00:00
Rick Macklem
a0c2c3691c Change the new NFS server so that it uses vfs.nfsd naming
for its sysctls instead of vfs.newnfs. This separates the
names from the ones used by the client.
2011-05-08 01:01:27 +00:00
Dag-Erling Smørgrav
4a421b6336 Upgrade to OpenSSH 5.8p2. 2011-05-04 07:34:44 +00:00
Rick Macklem
afea74655f Fix module names and dependencies so the NFS clients will
load correctly as modules after r221124.
2011-04-27 20:42:30 +00:00
Rick Macklem
6bb544780b Update the /etc/rc.d scripts for mountd and nfsd so they
can use the "-o" option to force the old NFS server to run.
Running the old NFS server is enabled by setting
oldnfs_server_enable="YES". The scripts will only enable
providing service for NFSv4 if nfsv4_server_enable="YES"
is set.

Reviewed by:	dougb (rc)
2011-04-26 00:22:17 +00:00
Doug Barton
fb91147e08 Create a function for the code from r192246 so that it can be used both
times mount is called.

Limit the automatic behavior to when AUTO is specified (as it is in
etc/defaults/rc.conf) and for everything else take advantage of all
of the goodness in checkyesno.
2011-04-25 06:03:22 +00:00
Doug Barton
d63de2e297 Add svn:executable property 2011-04-25 05:57:01 +00:00
Doug Barton
8028832653 Introduce to rc.subr get_pidfile_from_conf(). It does just what it sounds
like, determines the path to a pid file as it is specified in a conf file.

Use the new feature for rc.d/named and rc.d/devd, the 2 services in the
base that list their pid files in their conf files.

Remove the now-obsolete named_pidfile, and warn users if they have it set.
2011-04-23 04:26:31 +00:00
Edward Tomasz Napierala
cb89c25099 Add startup script, to load rules from /etc/rctl.conf.
Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (ealier version)
2011-03-30 18:32:45 +00:00
Ed Maste
86fdaae573 Replace ${SYSCTL_W} with ${SYSCTL} in rc.d scripts, as they are identical.
This is a further clean up after r202988.

SYSCTL_W is still initialized in rc.subr as some ports may still use it.
2011-03-30 01:19:00 +00:00
Jeff Roberson
aa0a1e58f0 - Merge in OFED 1.5.3 from projects/ofed/head 2011-03-21 09:58:24 +00:00
Doug Barton
19cc9846fe Remove the svn:executable property on Makefile
Add it on hastd
2011-03-13 08:22:46 +00:00
Pawel Jakub Dawidek
6be04ba681 Commit two more files missed in r219089.
MFC after:	1 month
2011-02-27 19:44:10 +00:00
Pawel Jakub Dawidek
35d77156fa Recognize 'reload' command, as hastd can be reloaded with the SIGHUP signal.
MFC after:	1 week
2011-02-27 11:40:20 +00:00
Doug Barton
e1c7c9d377 The new accounting file needs to be 644 so that unprivileged users
can use lastcomm(1)
2011-02-24 06:28:48 +00:00
Doug Barton
0a6cd3ac6d Update how accounting log files are rotated.
The old version had a race between the time that the old file was
cp'ed to acct.0 and the time that 'sa -s' was run that prevented
the commands that occurred in the meantime from being backed up.

It's also arguable that the old version was inefficient in using
cp which can be a problem on a space-constrained system.

This version avoids both problems, albeit it's considerably more
complicated. The advantage of putting the log rotation in the rc.d
script is that it can handle the _enable and _file questions without
having to do gymnastics to discover either value in the periodic script.

As a side effect of reviewing the rc.d script I cleaned it up a bit.
2011-02-22 21:13:40 +00:00
Doug Barton
606fffda66 Let rpcbind clean up after itself 2011-01-31 21:03:08 +00:00
Warner Losh
212dfb3236 Don't require /usr/lib/aout to be on the system. Test for its
existance since we don't generally need it.

MFC after:	1 week
2011-01-06 21:09:22 +00:00
Doug Barton
be59eea018 Add pidfile [1]
While I'm here, don't run the sysctl frob unconditionally, and
s/sysctl/$SYSCTL/

PR:		conf/153460 [1]
Submitted by:	Grigory Rechistov <ggg_mail@inbox.ru>
2010-12-27 22:52:47 +00:00
Kevin Lo
1fd114b406 Add pf in quiet mode 2010-12-17 09:38:55 +00:00
Doug Barton
5c0612b199 Add a sync to the shutdown step. In the common case this will be harmless
at worst. On a heavily loaded server it will give the fs a chance to do
its business without the axe hanging over its head.

Submitted by:	ivoras
2010-11-25 18:20:28 +00:00
Pawel Jakub Dawidek
24b7ca3412 Add gptboot_enable rc variable, which allows to turn gptboot reporting off in
case user wants to implement his own actions and doesn't want the attributes to
vanish.

Obtained from:	Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after:	3 days
2010-11-24 15:25:17 +00:00
Ed Maste
e64241487f /etc/rc.d/defaultroute currently bails immediately if all interfaces
set to use DHCP have no carrier.  This can cause grief as it may take
some time for link to be established, and defaultroute may terminate
before this happens.

Introduce a defaultroute_carrier_delay variable and then wait that long
in defaultroute before bailing if no interfaces have carrier.  With the
default settings defaultroute will wait for five seconds for this, and
the original 30 second wait for a default route to appear is unchanged.
Note that there is in discussion an alternative approach to the broader
problem of waiting for DHCP-configured routes.  However, this change
addresses a real problem in the current defaultroute script.

Discussed on:	freebsd-rc@
2010-09-29 13:08:23 +00:00
Warner Losh
8f3ec30476 Prefer echo over printf 2010-09-27 15:55:39 +00:00
Pawel Jakub Dawidek
867b3ba46a Add gptboot script that is responsible for:
- looking for partition with 'bootonce' attribute alone (without 'bootme'
  attribute), removing it and logging that we successfully booted from this
  partition.
- looking for partitions with 'bootfailed' attribute, removing it and
  logging that we failed to boot from this partition.

Reviewed by:	arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
Obtained from:	Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after:	2 weeks
2010-09-24 19:53:55 +00:00
Hiroki Sato
d3a8a8b9fa Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces.
The $ip6addrctl_policy is a variable to choose a pre-defined address
selection policy set by ip6addrctl(8).
The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3,
the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484,
respectively.  When "AUTO" is specified, it attempts to read
/etc/ip6addrctl.conf first.  If it is found, it reads and installs it as
a policy table.  If not, either of the two pre-defined policy tables is
chosen automatically according to $ipv6_activate_all_interfaces.

When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding
$ifconfig_IF_ipv6 is marked as IFDISABLED for security reason.

The default values are ip6addrctl_policy=AUTO and
ipv6_activate_all_interfaces=NO.

Discussed with:	ume and bz
2010-09-13 19:55:40 +00:00
Hiroki Sato
abe3ac576a Add $ipv6_privacy to support net.inet6.ip6.use_tempaddr. Note that this
will be replaced with a per-IF version later.

Based on:	changes in r206408 by dougb
2010-09-13 19:52:46 +00:00
Hiroki Sato
c5ad71aff5 Revert changes in r206408.
Discussed with:	dougb, core.5, and core.6
2010-09-13 19:51:15 +00:00
Daichi GOTO
6f0bcd4110 Avoid to try to remove suj journal file (.sujournal) and conventional
snapshot directory (.snap) from cleartmp rc.d script.
2010-09-05 05:44:40 +00:00
Jilles Tjoelker
32c50473a8 Allow starting /etc/rc.d/ipmon if ipnat is enabled but ipfilter is not
(in /etc/rc.conf).

This fixes an apparent confusion between test(1) and sh(1) syntax for
AND/OR.

PR:		conf/149036
Submitted by:	pluknet
MFC after:	1 week
2010-08-01 15:41:00 +00:00
Doug Barton
2822c33f8c This change does the following for the scripts that run up through
FILESYSTEMS (the default early_late_divider):
1. Move sysctl to run first
2. Move as many BEFOREs to REQUIREs as possible.
3. Minor effect, move hostid_save from right before mdconfig to right
   after.

A lot of the early scripts make use of sysctl one way or another so
running this first makes a lot of sense given that system-critical
values are often placed in sysctl.conf.

My original purpose for working on this was that while doing some
debugging on other stuff I noticed that the order of execution was
different in the first pass through the early scripts and the second.
In practice that doesn't matter because the scripts are not executed the
second time. However this _can_ result in problems if the difference in
the rcorder moves a script from the late section to the early section in
the second pass (which would mean the script would not get executed).
So, I wanted to make the order of execution of the scripts in the early
section more deterministic.

In the course of debugging the ordering problems I noticed that moving
the BEFOREs to REQUIREs prevented the changes in order from the first
pass to the second pass without having to make any substantial changes.
(Of course it's no secret that I think BEFORE should be avoided as much
as possible, but this is a good example of why.)

Reviewed by:	silence on freebsd-rc@
MFC after:	8.1-RELEASE
2010-05-19 19:03:19 +00:00
Doug Barton
2557f5bf0a Remove trailing white space. No functional changes. 2010-05-14 04:53:57 +00:00
Doug Barton
a16334d031 In the case where named_chroot_autoupdate is NOT set, but
named_chrootdir IS set, named-checkconf fails because it
cannot find the conf file. Fix this by making checkconf a
variable that includes "-t $named_chrootdir" as needed.
Notice of the bug and suggested direction for the fix from [1].

Using required_files for named.conf is overkill ever since
I added the named-checkconf call, so rather than update the
logic to handle the case described above, remove it. This
also handles the case where named_chroot_autoupdate IS set
but the symlink doesn't exist yet.

PR:		conf/145904
Submitted by:	J R Matthews
2010-04-28 22:29:17 +00:00
Hajimu UMEMOTO
b13cc627c7 Better handling of ipv6_default_interface using
net.inet6.ip6.use_defaultzone=1.  Now, it works IPv6 link-local
unicast addresses as well as IPv6 link-local multicast addresses.

MFC after:	1 week
2010-04-26 15:31:58 +00:00
Rui Paulo
7a246d0b14 Add ubthidhci.
MFC after:	2 days
2010-04-16 16:49:42 +00:00
Rui Paulo
c6c608b33d Add rc.d/ubthidhci. This small script calls usbconfig(1) to change a USB
Bluetooth controller from HID mode to HCI mode.

MFC after:	1 week
2010-04-09 17:32:38 +00:00
Doug Barton
8aa4c57946 Improve the handling of IPv6 configuration in rc.d. The ipv6_enable
and ipv6_ifconfig_<interface> options have already been deprecated,
these changes do not alter that.

With these changes any value set for ipv6_enable will emit a
warning. In order to avoid a POLA violation for the deprecation
of the option ipv6_enable=NO will still disable configuration
for all interfaces other than lo0. ipv6_enable=YES will not have
any effect, but will emit an additional warning. Support and
warnings for this option will be removed in FreeBSD 10.x.

Consistent with the current code, in order for IPv6 to be configured
on an interface (other than lo0) an ifconfig_<interface>_ipv6
option will have to be added to /etc/rc.conf[.local].

1. Clean up and minor optimizations for the following functions:
ifconfig_up (the ipv6 elements)
ipv6if
ipv6_autoconfif
get_if_var
_ifconfig_getargs
The cleanups generally were to move the "easy" tests earlier in the
functions, and consolidate duplicate code.

2. Stop overloading ipv6_prefer with the ability to disable IPv6
configuration.

3. Remove noafif() which was only ever called from ipv6_autoconfif.
Instead, simplify and integrate the tests into that function, and
convert the test to use is_wired_interface() instead of listing
wireless interfaces explicitly.

4. Integrate backwards compatibility for ipv6_ifconfig_<interface>
into _ifconfig_getargs. This dramatically simplifies the code in
all of the callers, and avoids a lot of other code duplication.

5. In rc.d/netoptions, add code for an ipv6_privacy option to use
RFC 4193 style pseudo-random addresses (this is what windows does
by default, FYI).

6. Add support for the [NO]RTADV options in ifconfig_getargs() and
ipv6_autoconfif(). In the latter, include support for the explicit
addition of [-]accept_rtadv in ifconfig_<interface>_ipv6 as is done
in the current code.

7. In rc.d/netif add a warning if $ipv6_enable is set, and remove
the set_rcvar_obsolete for it. Also remove the latter from
rc.d/ip6addrctl.

8. In /etc/defaults/rc.conf:

Add an example for RTADV configuration.

Set ipv6_network_interfaces to AUTO.

Switch ipv6_prefer to YES. If ipv6_enable is not set this will have
no effect.

Add a default for ipv6_privacy (NO).

9. Document all of this in rc.conf.5.
2010-04-09 01:35:09 +00:00
Jaakko Heinonen
7d4bbea850 Use an unique directory name instead of hardcoded /tmp/.diskless.
A malicious user could create a file named /tmp/.diskless and cause
the script to misbehave.

PR:		conf/141258
Reported by:	Jon Passki
MFC after:	1 week
2010-03-13 12:02:44 +00:00
Doug Barton
5d3cc6a4f7 Implement the idea of parallel-only-at-start-time in a cleaner, more
rc.d'ish way.

Not objected to by:	netchild
2010-03-07 04:26:21 +00:00
Alexander Leidinger
333fb1c996 Redirect stdin from /dev/null when starting a jail:
At least in RELENG_7 this fixes some start problems for some programs
  from the ports. It is also more correct, as a jail shall not expect
  input (interactivity) from the jail-host.

Revert the current behavior of starting jails in the background and
make it optional only for the start of jails (jail_parallell_start=YES
in rc.conf):
 - The stop can not be done in the background, the system needs to wait
   until everything is stopped correctly before it can reboot or power
   down.
 - The start should not be done in parallel by default, this not only
   breaks POLA for people comming from RELENG_x, it may also break a
   dependency chain with other scripts in the jail-host, which need to
   do some stuff after the jails are up and running (e.g. hardlinking
   a mysql socket from one jail into another one).

Discussed on:	freebsd-jails@
2010-03-05 14:34:33 +00:00
Hajimu UMEMOTO
f0cba49cf4 Add the shutdown KEYWORD.
Pointed out by:	dougb
MFC after:	3 days
2010-02-27 19:02:21 +00:00
Pawel Jakub Dawidek
c3a9f615e6 Add missing KEYWORD line.
Pointed out by:	dougb
2010-02-19 09:18:26 +00:00
Pawel Jakub Dawidek
bc6237f5b0 Remove some lines left over by accident. 2010-02-18 23:20:15 +00:00
Pawel Jakub Dawidek
32115b105a Please welcome HAST - Highly Avalable Storage.
HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by:	FreeBSD Foundation
Sponsored by:	OMCnet Internet Service GmbH
Sponsored by:	TransIP BV
2010-02-18 23:16:19 +00:00
Maksim Yevmenkin
fafa9c3c9a Introduce new rc.conf variable firewall_coscripts. It can be used to
specify list of executables and/or rc scripts that should be executed
after firewall starts/stops.

Submitted by:	Yuri Kurenkov <y dot kurenkov at init dot ru>
Reviewed by:	rhodes, rc@
MFC after:	1 week
2010-02-08 18:51:24 +00:00
Hajimu UMEMOTO
e60d067996 Add rc.d script for the rtsold(8) daemon.
The rtsol(8) handles just one RA then exit.  So, the OtherConfig flag
may not be handled well by rtsol(8) in the environment where there are
multiple RA servers on the segment.  In such case, rtsold(8) will be
your friend.

Reviewed by:	hrs
MFC after:	2 weeks
2010-02-03 16:18:42 +00:00
Hajimu UMEMOTO
98255d746a Allow use of -6 option to "server" and "peer" in ntp.conf.
MFC after:	1 week
2010-01-30 16:34:52 +00:00
Konstantin Belousov
c4c1575a01 Do not check for existence of symlink source for the link action. This
does not work for link in subdirectory, and sometimes it is useful to
create symlink in advance for dynamically created device node.

MFC after:	1 week
2010-01-23 11:42:31 +00:00
Ed Schouten
1e40039260 Let rc and periodic infrastructure and newsyslog use the utmpx files. 2010-01-13 19:07:48 +00:00
Xin LI
f91970991a Set svn:executable to *.
MFC after:	1 month
2010-01-11 23:32:36 +00:00
Gavin Atkinson
4c40efa74a Forced commit, to provide correct commit message for r201440:
Don't complain when we encounter the "cache" source, it's valid.  Also fix
the error message to include a line feed and not include a stray comma.

PR:		bin/121671
Submitted by:	Artis Caune  artis.caune gmail.com
Approved by:	ed (mentor)
MFC after:	2 weeks

While here, change "> /dev/stderr" for more usual ">&2"

Submitted by:	jilles
2010-01-03 21:27:10 +00:00
Gavin Atkinson
3e736db050 The default hash table size is 257 not 255. Reword the rest of the line
slightly while here.

PR:		bin/121671
Submitted by:	Artis Caune  artis.caune gmail.com
Approved by:	ed (mentor)
2010-01-03 19:14:22 +00:00
Doug Barton
1323e3dbec s/named_confidr/named_confdir/ in the rndc.key check. The line in
the command to create it was right, but the check was wrong, so it
was getting created every time. Mea culpa.

Submitted by:	oliver
2010-01-01 22:10:07 +00:00
Doug Barton
2128551758 The script hard-coded the assumption that the "configuration directory"
would be "/etc/namedb" in a number of places. Since the user may make
a different choice, introduce a new internal variable, named_confdir
that is generated relative to the location of $named_conf.

While this will work for some things (especially a highly customized
build from ISC source) there are still a number of places where
/etc/namedb is assumed that it is not easily virtualized (E.g., mtree).
If you deviate from the defaults you'd better know what you're doing. :)
2010-01-01 19:06:00 +00:00
Doug Barton
f25291f3a1 Since the change to rc.subr in r198162 it's not necessary to specify
command in the rc.d script if we have a corresponding ${name}_program
entry, which we do for named.

Rename named_precmd to named_prestart to make it more clear and match
convention.

Move the command_args definition related to -u up into _prestart().
It (and the associated $named_uid value) are only used there, and
unlike required_* and pidfile don't need to be used until this stage.

Fix a silly bug that would only have affected people who were using
the new named_wait or named_auto_forward features, AND had set up an
rndc.conf file instead of using the automatically generated rndc.key.

For named_conf:
	Add "-c $named_conf" to command_args if it's not set to the
	default. If it is set to the default and we're using the base
	BIND it's not necessary. If we're using BIND from the ports
	the user is likely to have included it in _flags (due to long
	necessity for doing so) so don't duplicate that if it's set.

	Add $named_conf to required_files
2009-12-12 21:51:50 +00:00
Hajimu UMEMOTO
2bba0e1a00 Unify rc.firewall and rc.firewall6, and obsolete rc.firewall6
and rc.d/ip6fw.

Reviewed by:	dougb, jhb
MFC after:	1 month
2009-12-02 15:05:26 +00:00
Remko Lodder
eabd1bcb21 Execute the start/stop process of a jail in the background.
This will prevent that the script hangs during startup, which
could cause annoying effects after rebooting for example.

PR:		kern/139422
Submitted by:	Andrey Groshev <greenx at yartv dot ru>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
Facilitated by:	Snow B.V.
2009-11-02 09:56:46 +00:00
Hiroki Sato
da5f0a6fac Use double-quotation marks to fix the unexpanded variable issue.
Spotted by:	swell.k
2009-10-23 09:30:19 +00:00
Doug Barton
c5a82ce01d Remove a circular dependency on routing
Submitted by:	Mykola Dzham <freebsd@levsha.org.ua>
Approved by:	hrs
2009-10-17 21:09:15 +00:00
Doug Barton
70d4ef1ea1 In regards to the "Starting foo:" type messages at boot time, create and
employ a more generic solution, and use it in the individual rc.d scripts
that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not expect
there to be anything printed out in between to make it more consistent.
5. In the following scripts change "quotes" to 'quotes' where no variables
exist in the message: savecore pf newsyslog
6. In the following scripts substitute if/then/fi for the simpler (and
more consistent) check_startmsgs &&: faith stf
7. In the following scripts separate the "Starting foo:" from the terminal
'.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
2009-10-10 22:17:03 +00:00
Hiroki Sato
df2b25f6ee - Enable an afexists() check only when no AF argument is specified.
- Simplify helper functions.

Discussed with:	ume
2009-10-02 20:19:53 +00:00
Hiroki Sato
b5a70c98b2 The net.inet.tcp.log_in_vain accepts 0, 1 or 2, not Y/N. 2009-10-02 06:51:39 +00:00