Commit Graph

56 Commits

Author SHA1 Message Date
John-Mark Gurney
c2ebbb5572 add the FILESYSTEMS placeholder and note that it's the default early_late_divider 2020-10-06 22:53:11 +00:00
Andriy Gapon
5fda0d60c1 add ability to set watchdog timeout for a shutdown
This change allows to specify a watchdog(9) timeout for a system
shutdown.  The timeout is activated when the watchdogd daemon is
stopped.  The idea is to a prevent any indefinite hang during late
stages of the shutdown.  The feature is implemented in rc.d/watchdogd,
it builds upon watchdogd -x option.

Note that the shutdown timeout is not actiavted when the watchdogd
service is individually stopped by an operator.  It is also not
activated for the 'shutdown' to the single-user mode.  In those cases it
is assumed that the operator knows what they are doing and they have
means to recover the system should it hang.

Significant subchanges and implementation details:
- the argument to rc.shutdown, completely unused before, is assigned to
  rc_shutdown variable that can be inspected by rc scripts
- init(8) passes "single" or "reboot" as the argument, this is not
  changed
- the argument is not mandatory and if it is not set then rc_shutdown is
  set to "unspecified"
- however, the default jail management scripts and jail configuration
  examples have been updated to pass "jail" to rc.shutdown, just in case
- the new timeout can be set via watchdogd_shutdown_timeout rc option
- for consistency, the regular timeout can now be set via
  watchdogd_timeout rc option
- watchdogd_shutdown_timeout and watchdogd_timeout override timeout
  specifications in watchdogd_flags
- existing configurations, where the new rc options are not set, should
  keep working as before

I am not particularly wed to any of the implementation specifics.
I am open to changing or removing any of them as long as the provided
functionality is the same (or very close) to the proposed one.
For example, I think it can be implemented without using watchdogd -x,
by means of watchdog(1) alone.  In that case there would be a small
window between stopping watchdogd and running watchdog, but I think that
that is acceptable.

Reviewed by:	bcr (man page changes)
MFC after:	5 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D21221
2019-10-03 11:23:10 +00:00
Mateusz Piotrowski
bb66a3e948 rc.8: Update documentation regarding old-style rc scripts
The EXAMPLES section does not contain any examples of output formats for
the old-style scripts. Remove the misleading bits stating otherwise.

Reviewed by:	bcr, imp
Approved by:	src (imp)
Differential Revision:	https://reviews.freebsd.org/D21552
2019-09-06 18:51:41 +00:00
Andriy Gapon
09b238e7c9 rc.8: fix a typo in r350701
I wronlgy expected that igor(1) checks spelling of all words.

MFC after:	1 week
2019-08-07 21:20:25 +00:00
Andriy Gapon
ce6c81b9d8 rc.8: add a reference to service(8)
While here:
- use Xr macro for a reference to sysrc(8)
- clarify that rc.shutdown invokes rc.d scripts with "faststop" argument

MFC after:	1 week
2019-08-07 21:07:59 +00:00
Enji Cooper
735f0ef041 Remove legacy rc.d infrastructure references from rc(8)
Legacy rc.d scripts (.sh extension) have not been supported since
r193118. Remove the outdated references to the legacy format, as they
are no longer valid.

Bug:	193936
MFC after:	1 week
Reviewed by:	cress, emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D18666
2018-12-29 20:02:20 +00:00
Devin Teske
da45b4da83 Add new rc keywords: enable, disable, delete
This adds new keywords to rc/service to enable/disable a service's
rc.conf(5) variable and "delete" to remove the variable.

When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
(default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
deleted if empty after modification using "service $foo delete".

Submitted by:	lme (modified)
Reviewed by:	0mp (previous version), lme, bcr
Relnotes:	yes
Sponsored by:	Smule, Inc.
Differential Revision:	https://reviews.freebsd.org/D17113
2018-10-31 20:37:12 +00:00
Eugene Grosbein
b25a469f94 rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
and runs scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is the port sysutils/cpupdate that defines
extra_commands="resume" to reload CPU microcode cleared
by suspend/resume sequence.

This change does nothing for a system having no scripts with KEYWORD: resume.

MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D15247
2018-10-27 17:21:13 +00:00
Stefan Eßer
09fdf1f84c Mention sysrc(8) as scripting interface for the modification of config
files. This is a follow up commit to r324721, which added sysrc(8) to
the SEE ALSO list.

Submitted by:	Kurt Jaeger (lists at opsec.eu)
MFC after:	1 week
2017-10-21 16:55:52 +00:00
Stefan Eßer
e5accd3ca1 Add references to sysrc(8).
Reported by:	Kurt Jaeger (lists at opsec.eu)
2017-10-18 13:25:44 +00:00
Brooks Davis
0607c830b3 More ATM and NATM removal
Submitted by:	ak
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D10511
2017-04-27 16:05:12 +00:00
Baptiste Daroussin
027b468717 Bump the date of the manpage after r298515
Sponsored by:	Essen Hackathon 2016
2016-04-23 17:09:40 +00:00
Lars Engels
1980d11b5f - Add two new subcommands to rc.subr:
"describe" shows an rc script's description
  "extracommands" shows an rc script's non-standard commands like "reload", "configtest", "keygen", etc
- Update the rc(8) manpage and the tcsh(1) completion examples to reflect these changes

Approved by:	bapt
Sponsored by:	Essen Linuxhotel Hackathon 2016
Differential Revision:	D452
2016-04-23 16:19:34 +00:00
Baptiste Daroussin
121f7af118 Sort SEE ALSO 2014-12-26 22:44:27 +00:00
Eitan Adler
dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Sergey Kandaurov
54c22eeae8 Clean up manual pages after BIND removal.
MFC after:	1 week
2013-12-25 17:28:08 +00:00
Colin Percival
cabad26453 Add support for "first boot" rc.d scripts. [1]
These scripts, containing
# KEYWORD: firstboot
will only be run if a sentinel file (default: /firstboot, configurable
via the rc.conf ${firstboot_sentinel} variable) exists; this sentinel
file will be deleted at the end of the boot process.

Scripts can request that the system reboot after the first boot by
creating the file ${firstboot_sentinel}-reboot.

This functionality is expected to be useful for embedded systems and
virtual machine images, where it may be desirable to
(a) download and install updates which became available between when
the image was created and when it was "turned on";
(b) download and install packages which may be newer than those
which were available when the image was created;
(c) install packages which run binaries during their install process,
bypassing the problem of cross-architecture installs;
(d) resize filesystems to match the disk onto which a VM image was
installed;
(e) perform initialization tasks relevant to cloud systems (e.g.,
Amazon's Elastic Compute Cloud);
and likely to perform many other one-time initialization functions.

Document this new functionality in rc.conf(5) and rc(8). [2]

Reviewed by:	freebsd-current, freebsd-rc [1]
Reviewed by:	Warren Block [2]
MFC after:	3 days
2013-10-19 21:37:06 +00:00
Dag-Erling Smørgrav
49cede74ee Add a setup script for unbound(8) called local-unbound-setup. It
generates a configuration suitable for running unbound as a caching
forwarding resolver, and configures resolvconf(8) to update unbound's
list of forwarders in addition to /etc/resolv.conf.  The initial list
is taken from the existing resolv.conf, which is rewritten to point to
localhost.  Alternatively, a list of forwarders can be provided on the
command line.

To assist this script, add an rc.subr command called "enabled" which
does nothing except return 0 if the service is enabled and 1 if it is
not, without going through the usual checks.  We should consider doing
the same for "status", which is currently pointless.

Add an rc script for unbound, called local_unbound.  If there is no
configuration file, the rc script runs local-unbound-setup to generate
one.

Note that these scripts place the unbound configuration files in
/var/unbound rather than /etc/unbound.  This is necessary so that
unbound can reload its configuration while chrooted.  We should
probably provide symlinks in /etc.

Approved by:	re (blanket)
2013-09-23 04:36:51 +00:00
Jamie Gritton
6a77419057 Mention the "nojailvnet" keyword.
MFC after:	3 days
2013-05-24 14:57:38 +00:00
Warren Block
344c81a166 Fixes to man8 groff mandoc style, usage mistakes, or typos.
PR:		168016
Submitted by:	Nobuyuki Koganemaru
Approved by:	gjb
MFC after:	3 days
2012-05-24 02:24:03 +00:00
Glen Barber
e907445846 Fix an mdoc(7) formatting nit. 2012-05-14 14:33:08 +00:00
Doug Barton
c86072f5a7 Remove documentation for set_rcvar() now that it has been removed. 2012-01-14 21:51:44 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Xin LI
3b5dbf01f7 rc.early(8) was removed as of 20090530 so remove manual page reference
to it.

MFC after:	1 week
2009-11-18 00:56:05 +00:00
Xin LI
9a0e6be26a Stop mentioning /usr/X11R6.
Approved by:	re (hrs)
2007-07-24 06:41:07 +00:00
Mike Makonnen
3d03791bb4 o Implement the stop_boot subroutine [1]. This subroutine can be used by
scripts in rc.d to stop rc(8) from booting into multi-user mode when
  a critical or severe error condition is encountered.

o Modify scripts in etc/rc.d that already implemented this functionality
  independently.

o Document it.

[1] - This subroutine was implemented in FreeBSD in rc.d/fsck. I moved it
      to rc.subr(8). Our version differs slightly in that it takes an
      optional argument to stop the boot even if "autoboot" is not set.

Obtained from: NetBSD
MFC after: 2 weeks
2007-05-18 12:04:41 +00:00
Ruslan Ermilov
81ae4b8da9 Markup fixes. 2006-09-18 15:24:20 +00:00
Doug Barton
9eb997817b Bring this page of the manual more in line with reality
as to how things work currently.

Delete a lot of stale references.
2005-12-19 08:48:57 +00:00
Ruslan Ermilov
a3f9c9fc03 Fixed xref. 2005-01-21 12:01:00 +00:00
Ruslan Ermilov
9cbda59000 Sort sections. 2005-01-21 08:36:40 +00:00
Mike Makonnen
028a5b9259 2004-10-07 14:06:23 +00:00
Ruslan Ermilov
2410103c1d mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
Ruslan Ermilov
1c85060a13 Sort SEE ALSO references (in dictionary order, ignoring case). 2004-07-04 20:55:50 +00:00
Warner Losh
3d595e7e8a Document /var/run/dmesg.boot, which is created by the rc scripts. Many
people have suggested that we document this somewhere, and this was a common
suggestion.
2004-07-03 21:01:18 +00:00
Ruslan Ermilov
8d5d039f80 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
Ruslan Ermilov
d962d52ac0 mdoc(7) police: scheduled sweep.
Approved by:	re
2002-11-29 11:39:20 +00:00
Gordon Tetlow
54e347fb3b Update rc(8) manpage to reflect rc.d
Add an rc.subr(8) manpage
Hook rc.subr.8 up to the build.

Submitted by:	Mike Makonnen <mtm@identd.net>
Approved by:	re@ (bmah)
Obtained from:	NetBSD
2002-11-21 20:12:05 +00:00
Jens Schweikhardt
d4bbfee298 Insert missing 'are' to fix grammar bogon.
MFC after:	3 days
2002-08-20 14:43:10 +00:00
Philippe Charnier
8d74f63d1e The .Nm utility 2002-07-14 14:58:11 +00:00
Crist J. Clark
6ee2a895d6 Add a paragraph break I missed in my last update. 2002-03-20 09:39:37 +00:00
Crist J. Clark
eb35eb2626 Add documentation for rc.early(8).
PR:		misc/35992
MFC after:	3 days
2002-03-17 09:14:54 +00:00
Ruslan Ermilov
6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Jens Schweikhardt
c1f3e4bf21 Removed whitespace at end-of-line; no content changes. I simply did
cd src/share; find man[1-9] -type f|xargs perl -pi -e 's/[ \t]+$//'

BTW, what editors are the culprits? I'm using vim and it shows
me whitespace at EOL in troff files with a thick blue block...

Reviewed by:	Silence from cvs diff -b
MFC after:	7 days
2001-07-14 19:41:16 +00:00
Ruslan Ermilov
3d45e180f4 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:31:11 +00:00
Ruslan Ermilov
4b66483fd8 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 18:41:33 +00:00
Ben Smithurst
91e06c00a3 Document the rc.d system.
Suggested by:	dcs
Reviewed by:	alex, dcs, sheldonh
2000-07-19 19:08:08 +00:00
Alexander Langer
22d8007635 rc.local is no longer a default.
PR:		19314
Submitted by:	Ben Smithurst <ben@scientia.demon.co.uk>
2000-06-20 10:30:50 +00:00
Sheldon Hearn
1111b49c35 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-03 14:05:08 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Matthew Dillon
ab327a8284 Reviewed by: freebsd-current
Update manual pages for rc(8) and rc.conf(5) based on recent changes
    to rc.local and rc.conf[.local].
1998-12-12 23:26:53 +00:00