| #
f99f0ee1
|
| 22-May-2024 |
Alexander Leidinger <netchild@FreeBSD.org> |
rc.d: add a service jails config to all base system services
This gives more permissions to services (e.g. network access to services which require this) when they are started as an automatic servic
rc.d: add a service jails config to all base system services
This gives more permissions to services (e.g. network access to services which require this) when they are started as an automatic service jail.
The sshd patch is important for the sshd-related functionality as described in the man-page in the service jails part.
The location of the added env vars is supposed to allow overriding them in rc.conf, and to hard-disable the use of svcj for some parts where it doesn't make sense or will not work.
Only a subset of all of the services are fully tested (I'm running this since more than a year with various services started as service jails). The untested parts should be most of the time ok, in some edge-cases more permissions are needed inside the service jail. Differential Revision: https://reviews.freebsd.org/D40371
show more ...
|
| #
d0b2dbfa
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| #
ccc806a0
|
| 02-Jul-2023 |
Eugene Grosbein <eugen@FreeBSD.org> |
dumpdev: respect kenv for stable branches
We have somewhat twisted logic to determine actions for dumpdev considering three sources of information:
* kenv "dumpdev" tunnable supposed to point to sp
dumpdev: respect kenv for stable branches
We have somewhat twisted logic to determine actions for dumpdev considering three sources of information:
* kenv "dumpdev" tunnable supposed to point to specific device; * /etc/defaults/rc.conf "dumpdev" variable; * /etc/rc.conf that may be unset or set to "NO", "AUTO" or device name.
For CURRENT without any setting in kenv or /etc/rc.conf the default is "AUTO". For STABLE branches the default is "NO".
Current implementation breaks for STABLE branches if kenv points to specific device but /etc/rc.conf does not set "dumpdev" at all.
Let us fix it commenting out "dumpdev" in /etc/defaults/rc.conf for STABLE branches and making the code to consult kenv if "dumpdev" is not set elsewhere.
MFC-after: 1 month
show more ...
|
| #
67e751f1
|
| 07-Mar-2022 |
Ed Maste <emaste@FreeBSD.org> |
dumpon: use underlying device if encrypted swap is in use
/etc/rc.d/dumpon runs before /etc/rc.d/swap. When encrypted swap is in use the .eli or .bde device will not exist at the time dumpon runs.
dumpon: use underlying device if encrypted swap is in use
/etc/rc.d/dumpon runs before /etc/rc.d/swap. When encrypted swap is in use the .eli or .bde device will not exist at the time dumpon runs.
Even if this is addressed it does not make sense to dump core to encrypted swap, as the encryption key will not be available after reboot rendering the dump useless. Thus, for the case that dumpdev=AUTO and encrypted swap is in use, strip the extension and use the underlying device.
Emit a warning if we are using the underlying device and the user has not configured dump encryption, so that the user knows that the will not be encrypted.
PR: 238301 Reported by: Ivan Rozhuk Reviewed by: jilles MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34474
show more ...
|
| #
f30f11f8
|
| 05-Mar-2021 |
Chuck Tuffli <chuck@FreeBSD.org> |
wait for device mounts in zpool and dumpon
If the root file system is composed from multiple devices, wait for devices to be ready before running zpool and dumpon rc scripts.
An example of this is
wait for device mounts in zpool and dumpon
If the root file system is composed from multiple devices, wait for devices to be ready before running zpool and dumpon rc scripts.
An example of this is if the bulk of the root file system exists on a fast device (e.g. NVMe) but the /var directory comes from a ZFS dataset on a slower device (e.g. SATA). In this case, it is possible that the zpool import may run before the slower device has finished being probed, leaving the system in an intermediate state.
Fix is to add root_hold_wait to the zpool and dumpon (which has a similar issue) rc scripts.
PR: 242189 Reported by: osidorkin@gmail.com Reviewed by: allanjude MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29101
show more ...
|
| #
0696600c
|
| 17-Oct-2018 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Move the rc framework out of sbin/init into libexec/rc.
The reasons for this are forward looking to pkgbase: * /sbin/init is a special binary; try not to replace it with every package update bec
Move the rc framework out of sbin/init into libexec/rc.
The reasons for this are forward looking to pkgbase: * /sbin/init is a special binary; try not to replace it with every package update because an rc script was touched. (a follow-up commit will make init its own package) * having rc in its own place will allow more easy replacement of the rc framework with alternatives, such as openrc.
Discussed with: brd (during BSDCam), kmoore Requested by: cem, bz PR: 231522 Approved by: re (gjb)
show more ...
|
| #
1135e97b
|
| 28-Jul-2018 |
Brad Davis <brd@FreeBSD.org> |
Move rc startup scripts from etc/ to sbin/init/
This keeps most startup scripts as CONFS per discussion on src-committers from back during BSDCan.
Approved by: will (mentor) Differential Revision:
Move rc startup scripts from etc/ to sbin/init/
This keeps most startup scripts as CONFS per discussion on src-committers from back during BSDCan.
Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16466
show more ...
|
| #
64a16434
|
| 25-Oct-2017 |
Mark Johnston <markj@FreeBSD.org> |
Add support for compressed kernel dumps.
When using a kernel built with the GZIO config option, dumpon -z can be used to configure gzip compression using the in-kernel copy of zlib. This is useful o
Add support for compressed kernel dumps.
When using a kernel built with the GZIO config option, dumpon -z can be used to configure gzip compression using the in-kernel copy of zlib. This is useful on systems with large amounts of RAM, which require a correspondingly large dump device. Recovery of compressed dumps is also faster since fewer bytes need to be copied from the dump device.
Because we have no way of knowing the final size of a compressed dump until it is written, the kernel will always attempt to dump when compression is configured, regardless of the dump device size. If the dump is aborted because we run out of space, an error is reported on the console.
savecore(8) is modified to handle compressed dumps and save them to vmcore.<index>.gz, as it does when given the -z option.
A new rc.conf variable, dumpon_flags, is added. Its value is added to the boot-time dumpon(8) invocation that occurs when a dump device is configured in rc.conf.
Reviewed by: cem (earlier version) Discussed with: def, rgrimes Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11723
show more ...
|
| #
480f31c2
|
| 10-Dec-2016 |
Konrad Witaszczyk <def@FreeBSD.org> |
Add support for encrypted kernel crash dumps.
Changes include modifications in kernel crash dump routines, dumpon(8) and savecore(8). A new tool called decryptcore(8) was added.
A new DIOCSKERNELDU
Add support for encrypted kernel crash dumps.
Changes include modifications in kernel crash dump routines, dumpon(8) and savecore(8). A new tool called decryptcore(8) was added.
A new DIOCSKERNELDUMP I/O control was added to send a kernel crash dump configuration in the diocskerneldump_arg structure to the kernel. The old DIOCSKERNELDUMP I/O control was renamed to DIOCSKERNELDUMP_FREEBSD11 for backward ABI compatibility.
dumpon(8) generates an one-time random symmetric key and encrypts it using an RSA public key in capability mode. Currently only AES-256-CBC is supported but EKCD was designed to implement support for other algorithms in the future. The public key is chosen using the -k flag. The dumpon rc(8) script can do this automatically during startup using the dumppubkey rc.conf(5) variable. Once the keys are calculated dumpon sends them to the kernel via DIOCSKERNELDUMP I/O control.
When the kernel receives the DIOCSKERNELDUMP I/O control it generates a random IV and sets up the key schedule for the specified algorithm. Each time the kernel tries to write a crash dump to the dump device, the IV is replaced by a SHA-256 hash of the previous value. This is intended to make a possible differential cryptanalysis harder since it is possible to write multiple crash dumps without reboot by repeating the following commands: # sysctl debug.kdb.enter=1 db> call doadump(0) db> continue # savecore
A kernel dump key consists of an algorithm identifier, an IV and an encrypted symmetric key. The kernel dump key size is included in a kernel dump header. The size is an unsigned 32-bit integer and it is aligned to a block size. The header structure has 512 bytes to match the block size so it was required to make a panic string 4 bytes shorter to add a new field to the header structure. If the kernel dump key size in the header is nonzero it is assumed that the kernel dump key is placed after the first header on the dump device and the core dump is encrypted.
Separate functions were implemented to write the kernel dump header and the kernel dump key as they need to be unencrypted. The dump_write function encrypts data if the kernel was compiled with the EKCD option. Encrypted kernel textdumps are not supported due to the way they are constructed which makes it impossible to use the CBC mode for encryption. It should be also noted that textdumps don't contain sensitive data by design as a user decides what information should be dumped.
savecore(8) writes the kernel dump key to a key.# file if its size in the header is nonzero. # is the number of the current core dump.
decryptcore(8) decrypts the core dump using a private RSA key and the kernel dump key. This is performed by a child process in capability mode. If the decryption was not successful the parent process removes a partially decrypted core dump.
Description on how to encrypt crash dumps was added to the decryptcore(8), dumpon(8), rc.conf(5) and savecore(8) manual pages.
EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 using QEMU. The feature still has to be tested on arm and arm64 as it wasn't possible to run FreeBSD due to the problems with QEMU emulation and lack of hardware.
Designed by: def, pjd Reviewed by: cem, oshogbo, pjd Partial review: delphij, emaste, jhb, kib Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4712
show more ...
|
| #
7e7d2a6f
|
| 15-May-2016 |
Enji Cooper <ngie@FreeBSD.org> |
Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol
Make zfs and zvol come before all of the items that depended on them previously
MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Di
Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol
Make zfs and zvol come before all of the items that depended on them previously
MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
show more ...
|
| #
6c1a5e83
|
| 23-Apr-2016 |
Lars Engels <lme@FreeBSD.org> |
- Add descriptions to most of the rc scripts. Those are mostly taken from their daemon's manpage and probably improved. - Consistently use "filesystem" not "file system".
Approved by: bapt, brueff
- Add descriptions to most of the rc scripts. Those are mostly taken from their daemon's manpage and probably improved. - Consistently use "filesystem" not "file system".
Approved by: bapt, brueffer Differential Revision: D452
show more ...
|
| #
2822c33f
|
| 19-May-2010 |
Doug Barton <dougb@FreeBSD.org> |
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
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
show more ...
|
| #
2b985169
|
| 16-Jul-2008 |
Doug Barton <dougb@FreeBSD.org> |
As previously discussed, add the svn:executable property to all scripts
|
| #
4af72813
|
| 23-Jun-2008 |
Mike Makonnen <mtm@FreeBSD.org> |
Remove the -v flag from the command line to dumpon(8), and instead print diagnostic ouput only if the command fails.
|
| #
57e561c0
|
| 10-Dec-2005 |
Doug Barton <dougb@FreeBSD.org> |
Remove rcconf.sh from /etc/rc.d, and instead load the configuration as part of rc. Doing this, and the sourcing of rc.subr after we have determined if we are booting diskless (and correspondingly run
Remove rcconf.sh from /etc/rc.d, and instead load the configuration as part of rc. Doing this, and the sourcing of rc.subr after we have determined if we are booting diskless (and correspondingly run rc.initdiskless if necessary) are safe, and actually allow fewer files to be needed on the diskless box. This also allows variables from the configuration to be available to rc itself, such as ...
Add a variable to rc.conf, early_late_divider, which designates the script which separates the early and late stages of the boot process. Default this to mountcritlocal, and add text to etc/defaults/rc.conf, rc.conf(5) and diskless(8) which describes how and why one might want to change this.
Reviewed by: brooks
show more ...
|
| #
218fe3f1
|
| 13-Sep-2005 |
Robert Watson <rwatson@FreeBSD.org> |
Use kenv -q to extract dumpdev rather than kenv, in order to avoid spamming the console in the event that a loader tunable 'dumpdev' isn't defined, which is not a relevant failure to report.
MFC aft
Use kenv -q to extract dumpdev rather than kenv, in order to avoid spamming the console in the event that a loader tunable 'dumpdev' isn't defined, which is not a relevant failure to report.
MFC after: 1 week
show more ...
|
| #
f07bf527
|
| 07-Jun-2005 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Honor the "dumpdev" kenv variable if it is set and the "dumpdev" rc variable is set to "AUTO".
MFC after: 2 weeks
|
| #
623720bd
|
| 05-Apr-2005 |
David E. O'Brien <obrien@FreeBSD.org> |
'dumpon' can run before 'initrandom' so make it. This gives a better chance of debugging /dev/random related panics.
|
| #
e30c35ed
|
| 18-Oct-2004 |
Thomas Quinot <thomas@FreeBSD.org> |
When dumpdev is set to 'auto', and a suitable swap device is found, create a symbolic link /dev/dumpdev designating that device so savecore can find and save a previous kernel dump.
|
| #
585d0283
|
| 18-Oct-2004 |
Thomas Quinot <thomas@FreeBSD.org> |
Remove unused computation of memory size.
Reviewed by: des
|
| #
337338ee
|
| 07-Oct-2004 |
Mike Makonnen <mtm@FreeBSD.org> |
Remove the requirement for the FreeBSD keyword as it no longer makes any sense.
Discussed with: dougb, brooks MFC after: 3 days
|
| #
5a70daa2
|
| 20-Sep-2004 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
If $dumpdev is set to AUTO, use the first suitable swap partition listed in /etc/fstab, or print an error message if no suitable device was found.
MFC after: 4 weeks
|
| #
bd57d5b0
|
| 08-Mar-2004 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
Mark scripts as not usable inside a jail by adding keyword 'nojail'.
Some suggestions from: rwatson, Ruben de Groot <mail25@bzerk.org>
|
| #
40c00763
|
| 02-Feb-2004 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
Teach /etc/rc.d/dumpon script how to stop.
Reviewed by: gordon Approved by: gordon, scottl (mentor)
|
| #
27bc1b28
|
| 13-Jun-2002 |
Gordon Tetlow <gordon@FreeBSD.org> |
Merge in all the changes that Mike Makonnen has been maintaining for a while. This is only the script pieces, the glue for the build comes next.
Submitted by: Mike Makonnen <makonnen@pacbell.net> Re
Merge in all the changes that Mike Makonnen has been maintaining for a while. This is only the script pieces, the glue for the build comes next.
Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
show more ...
|