Commit Graph

5016 Commits

Author SHA1 Message Date
Doug Barton
1950852fcf MFC r201036:
Delete some trailing whitespace
2009-12-30 19:25:40 +00:00
Doug Barton
79a07a2e0c MFC r200448:
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

MFC r200563:

The named process needs to have a "working directory" that it can
write to. This is specified in "options { directory }" in named.conf.
So, create /etc/namedb/working with appropriate permissions, and
update the entry in named.conf to match.

In addition to specifying the working directory, file and path names
in named.conf can be specified relative to the directory listed.
However, since that directory is now different from /etc/namedb
(where the configuration, zone, rndc.*, and other files are located)
further update named.conf to specify all file names with fully
qualified paths. Also update the comment about file and path names
so users know this should be done for all file/path names in the file.

This change will eliminate the 'working directory is not writable'
messages at boot time without sacrificing security. It will also
allow for features in newer versions of BIND (9.7+) to work as
designed.
2009-12-29 07:08:48 +00:00
Doug Barton
c08a53d0ad Re-apply the fix from r199029 (MFC from r198162) to allow
$name_program to override $command.

PR:		conf//141642
Submitted by:	Petr Lampa <lampa@fit.vutbr.cz>
2009-12-15 23:05:16 +00:00
Doug Barton
cd6eecd4c7 MFC r200377:
Update to the December 12, 2008 version of this file. The one
substantive change is to add the IPv6 address of L. The other
changes are all CAPS LOCK related.
2009-12-13 23:56:46 +00:00
Xin LI
a1b9e5fa76 MFC revisions 196550 and 196552:
Add a new rc.d script, static_arp, which enables the administrator to
statically bind IPv4 <-> MAC address at boot time.

In order to use this, the administrator needs to configure the following
rc.conf(5) variable:

 - static_arp_pairs: A list of names for static bind pairs, and,
 - a series of static_arp_(name): the arguments that is being passed to
   ``arp -S'' operation.

Example:
  static_arp_pairs="gw"
  static_arp_gw="192.168.1.1 00:01:02:03:04:05"

See the rc.conf(5) manual page for more details.
2009-12-08 18:23:51 +00:00
Hiroki Sato
3cec660ea4 MFC:
r197139
- Add afexists() to check if the specified address family exists
  on the system or not.

r197697
- Add AF_IPX and AF_NATM to afexists().
2009-12-07 07:41:29 +00:00
Hiroki Sato
a1c3a99ce5 MFC:
r197144:
- Add an extension of set_rcvar(), a new function set_rcvar_obsolete(),
  and $desc.

  The set_rcvar_obsolete() is to mark a variable as obsolete and define
  the new one.  More specifically, a warning is displayed when
  a variable is removed or changed in the source tree and the user
  still defines the old one.
2009-12-07 06:25:19 +00:00
Colin Percival
0cd4e30efa Disable SSL renegotiation in order to protect against a serious
protocol flaw. [09:15]

Correctly handle failures from unsetenv resulting from a corrupt
environment in rtld-elf. [09:16]

Fix permissions in freebsd-update in order to prevent leakage of
sensitive files. [09:17]

Approved by:	so (cperciva)
Security:	FreeBSD-SA-09:15.ssl
Security:	FreeBSD-SA-09:16.rtld
Security:	FreeBSD-SA-09:17.freebsd-udpate
2009-12-03 09:18:40 +00:00
Doug Barton
715542d57f MFC r198162:
Allow $name_program to override $command in a more robust way that
will not cause the value to be null if $command is not set.
2009-11-07 22:59:04 +00:00
Ed Schouten
f36e7051c7 MFC various commits back to stable/8:
SVN r197174:
  Make sure we never place the cursor outside the screen.

  For some vague reason, it may be possible that scp->cursor_pos exceeds
  scp->ysize * scp->xsize. This means that teken_set_cursor() may get
  called with an invalid position. Just ignore the old cursor position in
  this case.

  Reported by:  Paul B. Mahol <onemda gmail com>

SVN r198213:
  Make lock devices work properly.

  It turned out I did add the code to use the init state devices to set
  the termios structure when opening the device, but it seems I totally
  forgot to add the bits required to force the actual locking of flags
  through the lock state devices.

  Reported by:	ru

SVN r198215, r198217:
  Fix a typo in the jail(8) manpage.

  Submitted by: Jille Timmermans <jille quis cx>

SVN r198216:
  Fix qouting in a comment, to make it look more consistent

  Submitted by: Jille Timmermans <jille quis cx>

SVN r198223:
  Properly set the low watermarks when reducing the baud rate.

  Now that buffers are deallocated lazily, we should not use
  tty*q_getsize() to obtain the buffer size to calculate the low
  watermarks. Doing this may cause the watermark to be placed outside the
  typical buffer size.

  This caused some regressions after my previous commit to the TTY code,
  which allows pseudo-devices to resize the buffers as well.

  Reported by:  yongari, dougb
2009-11-01 10:30:30 +00:00
Christian Brueffer
51b79b08b8 MFC: r198314
Add empty watchdogd_flags.
2009-10-29 16:30:48 +00:00
Doug Barton
888d94cf9b MFC r197947:
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. [Does not apply in RELENG_8]
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

Approved by:	re (kib)
2009-10-16 00:17:09 +00:00
Doug Barton
505c00fa5b MFC r196439:
Fix the typo mentioned in the PR, and one additional.
Fix caps while I'm here.

PR:		conf/138087
Submitted by:	Chris Petrik <c.petrik.sosa@gmail.com>
Approved by:	re (kib)
2009-10-14 03:31:37 +00:00
Doug Barton
d89eb6fc62 MFC r197297
Add a knob to show 'Starting foo:' messages when faststart is used,
such as at boot time.

MFC 197619

By popular acclaim, enable "Starting foo:" messages by default

Approved by:	re (bz)
2009-09-29 18:44:34 +00:00
Ken Smith
ac7d4c93c6 Remove extra debugging support that is turned on for head but turned off
for stable branches:

	- shift to MALLOC_PRODUCTION
	- turn off automatic crash dumps
	- Remove kernel debuggers, INVARIANTS*[1], WITNESS* from
	  GENERIC kernel config files[2]

[1] INVARIANTS* left on for ia64 by request marcel
[2] sun4v was left as-is

Reviewed by:	marcel, kib
Approved by:	re (implicit)
2009-09-10 14:04:00 +00:00
Remko Lodder
07c141a646 MFC r196787
Do the first step in removing lukemftpd from the base system. Disconnect
  it from the build.

  If you are using the FTP daemon, please consider using the port ftp/tnftpd
  which is the same FTP server, but newer and might have more/better
  functionality.

  This results in us providing only one ftp daemon by default.

  Reviewed by:        bz
  Approved by:        imp (mentor, implicit)
  MFC after:        3 days
  Silence from:        obrien

Approved by:	re (kib), imp (mentor, implicit)
2009-09-07 14:10:55 +00:00
Doug Barton
72d5a535fa MFC 196478:
Prior to the dire warning about values of network_interfaces other than
AUTO the biggest mistake users made was leaving lo0 off the list. Since
lo0 is effectively mandatory, check for it and add it to the list if
it's not there.

MFC 196523:
Improve the case test to detect the presence of lo0 in the list of
network_interfaces.
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>

Approved by:	re (kib)
2009-08-29 19:45:03 +00:00
Doug Barton
4bff593a8c MFC 196589:
In the loop through the list of interfaces in network6_interface_setup()
rtsol_interface gets reset to "yes" each time through the loop, but
rtsol_available does not. If a user has lo0 first in their list of
interfaces rtsol_available will get set to "no" the first time through
the loop and subsequent interfaces will not get rtsol'ed when they should.

Therefore change the conditional for the is_wired() test to _interface.

Approved by:	re (kib)
2009-08-27 17:53:25 +00:00
Doug Barton
0c4ef85bfd MFC 196436;
Move is_wired_interface() from rc.d/wpa_supplicant into network.subr,
simplify it a bit, and make use of that method to determine if an
interface is a candidate for IPv6 rtsol rather than listing all of the
possible wireless interfaces that should _not_ get rtsol'ed.

This change is only relevant for 8.0+ unless the "wlan mandatory" code
gets ported back to RELENG_7.

Approved by:	re (kib)
2009-08-26 21:08:41 +00:00
Simon L. B. Nielsen
452e49d601 MFC 196392:
Add support for backing up the old kernel when installing a new kernel
  using freebsd-update.  This applies to using freebsd-update in "upgrade
  mode" and normal freebsd-update on a security branch.

  The backup kernel will be written to /boot/kernel.old, if the directory
  does not exist, or the directory was created by freebsd-update in a
  previous backup.  Otherwise freebsd-update will generate a new directory
  name for use by the backup.  By default symbol files are not backed up
  to save diskspace and avoid filling up the root partition.

  This feature is fully configurable in the freebsd-update config file,
  but defaults to enabled.

  Reviewed by:	cperciva

Approved by:	re (kib)
2009-08-19 21:01:32 +00:00
Scott Long
ae93ebed73 Merge files missed in r196285. SVN is simply horrible. Sorry for the
tree breakage.

Approved by:	re
2009-08-17 13:51:19 +00:00
Pawel Jakub Dawidek
d5d7e76d2b Currently there is a problem with fscking UFS file systems created on
top of ZVOLs. The problem is that rc.d/fsck runs before rc.d/zfs. The
latter makes ZVOLs to appear in /dev/. In such case rc.d/fsck cannot
find devfs entry and aborts. We cannot simply move rc.d/zfs before
rc.d/fsck, because we first want kern.hostid to be configured (by
rc.d/hostid). If we won't wait (hostid will be 0) we can reuse disks
which are in use by different systems (eg. in SAN/NAS environment).
We also cannot move rc.d/hostid before rc.d/fsck, because rc.d/hostid on
first system start stores generated kern.hostuuid in /etc/hostid file,
so it needs root file system to be mounted read-write.

The fix is to split rc.d/hostid so that rc.d/hostid (which will now run
before rc.d/fsck) only generates hostid and sets up sysctls, but doesn't
touch root file system and rc.d/hostid_save (which is run after
rc.d/root) and only creates /etc/hostid file.

With that in place, we can move ZVOL initialization to dedicated
rc.d/zvol script which runs before rc.d/fsck.

PR:		conf/120194
Reported by:	James Snow <snow@teardrop.org>
Reviewed by:	brooks
Approved by:	re (kib)
MFC after:	2 weeks
2009-07-29 05:23:52 +00:00
Colin Percival
958fafa951 Add INDEX-8 to the default portsnap configuration file, and remove INDEX-5.
The Portsnap buildbox now generates teh bits needed for portsnap to produce
INDEX-8; and it hasn't built INDEX-5 for a long time, although the bits are
still distributed for an INDEX-5 from when FreeBSD 5.x reached its EoL.

Approved by:	re (kib)
MFC after:	3 days (INDEX-8 addition only)
2009-07-27 20:24:00 +00:00
Joe Marcus Clarke
8415b7620f Remove gdm as it is no longer needed.
Approved by:	re (kib)
Reminded by:	nork
2009-07-18 16:29:40 +00:00
Joe Marcus Clarke
10d3ca6e6d Remove this file. It is no longer needed as x11/gdm provides its own
version under /usr/local/etc/pam.d.

Approved by:	re (kib)
2009-07-18 06:08:21 +00:00
David Malone
6b560b8e98 1) Use our vendor domain at the pool.
2) Point people at the pool website and encourage
   people to provide a server in the pool (as a
   courtesy to the pool guys).
3) Fix a spelling.
4) Comment out the local clock and include a link
   to documentation for use of the local clock on
   the ntp.org site.

Approved by:	re (kib)
2009-07-13 05:51:33 +00:00
Scott Long
52c9ce25d8 Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability.  Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel.  The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives.  It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes.  ATAPI drives are
accessed via 'cd' device nodes.  They can all be enumerated and manipulated
via camcontrol, just like SCSI drives.  SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol.  See the camcontrol manpage for further
details.  Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment.  The userland ABI/API has
changed, so applications will need to be recompiled.  It may change
further in the near future.  The 'ada' device name may also change as
more infrastructure is completed in this project.  The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed.  In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols.  It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware.  While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged.  Help with new transports is also encouraged.

Submitted by:	scottl, mav
Approved by:	re
2009-07-10 08:18:08 +00:00
Doug Barton
511b9af0c9 rtsol should not be run on the wireless NIC interfaces directly,
it will run on wlan0 instead.
2009-06-26 01:27:16 +00:00
Doug Barton
5ca51aad69 Reverse the effect of r193198 for pf and ipfw which will once again
allow them to start after netif. There were too many problems reported
with this change in the short period of time that it lived in HEAD, and
we are too late in the release cycle to properly shake it out.

IMO the issue of having the firewalls up before the network is still a
valid concern, particularly for pf whose default state is wide open.
However properly solving this issue is going to take some investment
on the part of the people who actually use those tools.

This is not a strict reversion of all the changes for r193198 since it
also included some simplification of the BEFORE/REQUIRE logic which is
still valid for ipfilter and ip6fw.
2009-06-26 01:04:50 +00:00
Konstantin Belousov
c9253e931d Usermode portion of the support for swap allocation accounting:
- update for getrlimit(2) manpage;
- support for setting RLIMIT_SWAP in login class;
- addition to the limits(1) and sh and csh limit-setting builtins;
- tuning(7) documentation on the sysctls controlling overcommit.

In collaboration with:	pho
Reviewed by:	alc
Approved by:	re (kensmith)
2009-06-23 20:57:27 +00:00
Ed Schouten
fcbfce6643 Remove the note about using vt220, which makes no sense at all.
vt220 will not work better. Even though it probably will remove warnings
about unknown terminal types, a cons25 emulator is not compatible with
vt220 at all.
2009-06-14 22:35:33 +00:00
Brian Somers
50a3e1d89e Remove HOME= - this has surprised me several times in the past.
PR:		132135
Submitted by:	Craig Leres
MFC after:	3 weeks
2009-06-14 06:37:19 +00:00
Edwin Groothuis
6850bf71da Sync termcap.small with main termcap; add xterm entry for libteken
PR:		conf/135530
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua>
MFC after:	1 week
2009-06-13 13:35:18 +00:00
Edwin Groothuis
d7e47db675 Fix typo in cons25l7 definition in etc/termcap.small and share/termcap
There is a minor typo in the cons25l7 (':' instead of '|') entry
    in src/etc/termcap.small that causes syscons to complain about
    bogus characters in /etc/termcap.db.

PR:		conf/132777
Submitted by:	Nikos Ntarmos <ntarmos@cs.uoi.gr>
MFC after:	1 week
2009-06-12 23:43:19 +00:00
Andriy Gapon
44672a2966 syslog.conf: pop up from logging only ppp messages at the end of file
This allows to append custom rules at the end of the file without
risk of confusion that can result when one misses default !ppp line
and doesn't add another program specification and thus subsequent
selector(s) would belong to ppp program block.

Requested by:	marck
Submitted by:	marck
Approved by:	jhb (mentor)
2009-06-11 15:07:02 +00:00
Andriy Gapon
9af31fe2f8 rc.d/fsck: allow additional options for fsck_y_enable via fsck_y_flags
Primary intention is to allow to pass -C option to avoid (re-)checking
clean filesystems when preening fails and fsck -y kicks in.

Submitted by:	marck
Reviewed by:	current@
Approved by:	jhb (mentor)
MFC after:	1 week
2009-06-10 19:03:23 +00:00
Ed Schouten
87fa155012 Small cleanups to the jail script:
- Remove redundant debugging of consolelog.
- Use `while :', instead of `while [ true ]'. This is done in other
  places as well.

Submitted by:	Jille Timmermans <jille quis cx> (not jilles)
Reviewed by:	jilles
2009-06-10 18:18:14 +00:00
Edwin Groothuis
f8d7304fea add ca_AD, ca_FR and ca_IT locales
Catalan language is not only spoken in Spain (ca_ES), but also
    in Andorra, France and Italy. In Andorra it is the official
    language.

    (see http://en.wikipedia.org/wiki/Catalan_language#Geographic_distribution)

Add a bunch of symlinks to between ca_ES and ca_AD, ca_FR and ca_IT.

PR:		conf/92541
Submitted by:	<rmh@io.debian.net>
MFC after:	1 week
2009-06-10 12:20:11 +00:00
Edwin Groothuis
e530f4b50d Welcome to a default installed /etc/ntp.conf
This NTP configuration file points to the [012].pool.ntp.org servers,
which will return a list of geographical local NTP servers.
It uses the best-practice options of "iburst" and "maxpoll 9".
It gives examples on how to use the "restrict" commands, which are
unfortunately not working when you use the pool.ntp.org servers.
It sets up a fudge server so any clients syncing against this server
will always be synced even if we lose the master.

The idea of this file was briefly discussed on -net.

PR:		conf/58595
Submitted by:	Chris Stenton <jacs@gnome.co.uk>
MFC after:	1 week
2009-06-07 13:26:57 +00:00
Rick Macklem
f0a011a1b1 Add support for the experimental nfs subsystem to the scripts in
/etc/rc.d. They use the following new rc variables:
  nfsv4_server_enable - set to "YES" to run the experimental server
  nfsuserd_enable - set to "YES" to run nfsuserd for NFSv4 client and
    server
  nfsuserd_flags - command line flags for nfsuserd
  nfscbd_enable - set to "YES" to run the experimental nfs client's
    NFSv4 callback daemon
  nfscbd_flags - command line flags for nfscbd

Reviewed by:	dougb
Approved by:	kib (mentor)
2009-06-02 22:15:47 +00:00
Brian Somers
045e970615 Rather than using both -prune (which requires directory-first tree traversal)
and -delete (which implies depth-first traversal), avoid using -delete in
favour of -execdir.

This has a side-effect of not removing directories that contain files,
even if we delete all of those files, but IMHO that's a better option
than specifying all possible local filesystem types in this script.

PR:		122811
MFC after:	3 weeks
2009-06-02 07:35:51 +00:00
Doug Barton
9cdd13b268 Eliminate the warning that "Values of network_interfaces other than
AUTO are deprecated.' There is no good reason to deprecate them, and
setting this to different values can be useful for custom solutions
and/or one-off configuration problems.
2009-06-01 05:37:13 +00:00
Doug Barton
a3f6188b53 Make the pf and ipfw firewalls start before netif, just like ipfilter
already does. This eliminates a logical inconsistency, and a small
window where the system is open after the network comes up.
2009-06-01 05:35:03 +00:00
Doug Barton
a3e42d03b9 Substitute ypset for ypbind in REQUIRE lines. If you use ypset it has to
happen right after ypbind, and before anything that uses NIS. The only
change in rcorder accomplished by this patch is make that happen.

PR:		conf/117555
Submitted by:	John Marshall <john@rwsrv05.mby.riverwillow.net.au>
2009-06-01 04:55:13 +00:00
Doug Barton
fe9e60d287 Small cleanup, add (spurious) quotation marks around the value
for name= to make these scripts consistent with the rest.
2009-05-30 21:51:38 +00:00
Doug Barton
b004b4e45f Now that the last of the *.sh scripts are gone from the base,
emit a warning if come across one.
2009-05-30 21:41:54 +00:00
Doug Barton
38e2331796 As previously advertised, remove this script prior to the 8.0 branch. 2009-05-30 19:38:51 +00:00
Brian Somers
48369f7cc0 Update this script so that it handles different ruleset failures
differently.  The output now shows the ruleset and shortens to
slightly different text (using $daily_status_mail_rejects_shorten),
but it should be more descriptive.

PR:		35018
Inspired by:	Mikhail Teterin - mi at aldan dot algebra dot com
MFC after:	3 weeks
2009-05-28 07:43:06 +00:00
Andrew Thompson
11c63ede84 Delete the old USB stack. The new stack has settled in and has all the
drivers/functionality and then some.
2009-05-27 16:16:56 +00:00
Robert Watson
8ab21fb261 Further idmapd garbage collection -- remove rc.d Makefile reference and
default settings.

Submitted by:	Pawel Worach <pawel.worach at gmail.com>
2009-05-22 13:56:16 +00:00