freebsd-dev/share/examples
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
..
bhyve vmrun: Add a missing close-paren to the usage message. 2019-06-07 17:54:26 +00:00
bootforth Move sys/boot to stand. Fix all references to new location 2017-11-14 23:02:19 +00:00
BSD_daemon SPDX: use the Beerware identifier. 2017-11-30 20:33:45 +00:00
csh - Add two new subcommands to rc.subr: 2016-04-23 16:19:34 +00:00
diskless
drivers Remove 'All Rights Reserved' from the collection copyright and templates. 2018-05-09 02:02:49 +00:00
etc Add list of valid CPUTYPE flags for arm/arm64 to make.conf example 2019-06-22 16:54:23 +00:00
find_interface Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
FreeBSD_version Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
hast share and pc-sysinstall: adoption of SPDX licensing ID tags. 2017-11-27 15:28:26 +00:00
hwpmc hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
indent
ipfilter share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
ipfw share and pc-sysinstall: adoption of SPDX licensing ID tags. 2017-11-27 15:28:26 +00:00
IPv6
jails add ability to set watchdog timeout for a shutdown 2019-10-03 11:23:10 +00:00
kld Fix build for KLD dyn_sysctl example 2019-03-16 04:24:02 +00:00
libifconfig libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libusb20 SPDX: use the Beerware identifier. 2017-11-30 20:33:45 +00:00
libvgl share and pc-sysinstall: adoption of SPDX licensing ID tags. 2017-11-27 15:28:26 +00:00
mdoc Add SPDX tags to example manual pages and POSIX copyright. 2018-07-20 13:45:09 +00:00
netgraph
perfmon Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
pf Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
ppi Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
ppp For the udp-client example, instruct user to add an entry for a udp based 2017-08-01 16:20:33 +00:00
printing Remove now bogus README 2017-10-30 00:36:08 +00:00
scsi_target share and pc-sysinstall: adoption of SPDX licensing ID tags. 2017-11-27 15:28:26 +00:00
ses Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
smbfs share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
sunrpc examples: fix typo 2017-12-29 23:58:05 +00:00
tests Update the spelling of my name 2019-04-22 17:52:46 +00:00
uefisign Make the uefikeys script output slightly more obvious. 2015-02-26 14:22:27 +00:00
witness
ypldap ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3). 2016-01-13 01:49:35 +00:00
Makefile pkgbase: Move login.access to usb.bin/login 2019-05-22 07:23:03 +00:00
Makefile.depend DIRDEPS_BUILD: Fix staging of share/sendmail and share/examples. 2016-03-11 23:45:09 +00:00