Commit graph

334 commits

Author SHA1 Message Date
Franco Fichtner
2f41469118 rc: ignore InsydeH2O UEFI BIOS UUID placeholder for hostid
This caused MAC addresses (e.g. bridge0) to clash on systems
running this particular BIOS.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1544
2025-07-09 10:05:48 +02:00
Franco Fichtner
45e47679fe rc: also run NAME_setup on NAME_reload
Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx). In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one. Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

PR: https://reviews.freebsd.org/D36259
2025-07-09 10:05:48 +02:00
Olivier Certner
2d5e13c86a
rc/tests: Fix process flags checks using ps(1)
These checks use ps(1) with both the '-p' and '-a' flags, which worked
so far as ps(1)'s '-a' option was buggy.  Since the fix in commit
"ps(1): Make '-a' and '-A' always show all processes"
(93a94ce731a89b56), such a command-line always selects all processes,
making the specified '-p' useless and the test wrong.  Remove the
useless '-a'.

While here, remove the redundant '-x', as '-p' implies '-x' by default.

MFC after:      1 day
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D50201

(cherry picked from commit 646375408742dd5ed9abb174a621a3f8f65a56ef)
(cherry picked from commit a69fe62604021f120206e4064ca7463195aeb3a0)

Approved by:    re (cperciva)
2025-05-13 14:41:32 +02:00
Cy Schubert
94f4140860 Revert "ntpd: Use the ntpd -u option in preference to the rc su plumbing"
Using the ntpd -u option to set the credentials ntpd is to run under
while still using rc(8) to invoke causes some FreeBSD installs to fail
to load mac_ntp. The fact that that can_run_nonroot() does not
indicate why failures occur leaves people on the mailing lists
guessing as to why there are failures. Let's revert back to using
the rc(8) provided su. The ntpd rc script will be rewritten when
the ntpd chroot will be implemented.

Reported on:	freebsd-stable@

This reverts commit 521f66715afb312b356afafc68cbc044a436a753.

(cherry picked from commit 5ca7754519e8c618968d8acbf54d653b6e968829)
2025-03-11 10:59:10 -07:00
Cy Schubert
23ad1f4bb7 var_run: Clean up style
Clean up style and make more consistent.

Replace test with if-then-else to make the script more legible.

Replace the call to dirname with the shell %/* operator avoiding a
fork & exec.

Reorder the test for $var_run_autosave before the test for /var/run on
tmpfs. This avoids gratuitously scanning the mount table for a tmpfs
/var/run.

Initial concept by and in discussion with:
	Harry Schmalzbauer <freebsd@omnilan.de>

No functional change intended.

Differnential revision:	https://reviews.freebsd.org/D47773

(cherry picked from commit ed9712f8943573136fa92a0e61c8e7c10952eeb0)
2025-03-06 16:32:53 -08:00
Cy Schubert
1a241a911d ntpd: Use the ntpd -u option in preference to the rc su plumbing
Using the rc plumbing to setuid(2) is preferred as it allows the user
to use the -i option in ntpd_flags to chroot ntpd.

Chrooting ntpd by default will be a 2025 project.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D48191

(cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753)
2025-02-24 16:37:46 -08:00
Navdeep Parhar
03bbfb01cc rc.d/iovctl: Start the iovctl service after kld.
Drivers, including those that support SR-IOV, can be loaded via kld_list
and it makes sense to process iovctl configuration files afer all
drivers have been loaded.

Sponsored by:	Chelsio Communications
Reviewed by:	0mp, jhb
Differential Revision:	https://reviews.freebsd.org/D47937

(cherry picked from commit 41594021fa8bf02468407e8fc48c2e7a13de1a2f)
2025-02-13 20:57:54 -08:00
Mark Johnston
1c7f325e76 rc: Document rtadvd_flags
PR:		283696
MFC after:	1 week

(cherry picked from commit 872686b17e70636f031436b458262eb7dacc5832)
2025-01-14 14:14:24 +00:00
Tijl Coosemans
fb3408bb6e rc.d/sendmail: Fix error with some configurations
The sendmail startup script can run 4 daemons: sendmail, sendmail_submit,
sendmail_outbound, and sendmail_msp_queue.  Of the first 3 at most one
can be enabled.  There's a run_rc_command call for each and the ones for
sendmail and sendmail_msp_queue run unconditionally.  For some rc
commands this triggers warnings or errors when sendmail_enable="NO" or
sendmail_msp_queue_enable="NO".  Since d2e7bb630b83 these errors are
propagated and the whole script fails.

Fix this by first determining which daemons are enabled, setting ${name}
and ${rcvar} accordingly, and then always calling run_rc_command
conditionally.

Also replace ${name}.cf with sendmail.cf because ${name} isn't always
sendmail.

PR:		282585
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47757

(cherry picked from commit 6b17d944a1d448dbb797c5fa5b0778242ba02e52)
2024-12-31 14:16:10 +01:00
Cy Schubert
a7f33b5019 rc.d/var_run: Add missing $(dirname)
We intend to create the containing directory here. Fix this typo.

PR:		282939

(cherry picked from commit 4d58cf6ff905377dbca1ecf004f53133e6b57a46)
2024-12-04 09:08:27 -08:00
Cy Schubert
3b032c0698 ipfilter: Set ipf -T optionlist at boot
There is no easy way to set ipfilter optionlist variables during boot.
Add plumbing to the rc script to support this.

PR:			130555
Reviewed by:		jlduran
Differential Revision:	https://reviews.freebsd.org/D47346

(cherry picked from commit 8d6feaaaa26f444abb209360e52b993e39cb81bb)
2024-11-18 16:26:04 -08:00
Jose Luis Duran
f6d94e23d1
rc: Update ipfilter example rules location
It was originally /usr/src/contrib/ipfilter/rules and moved to
/usr/src/share/examples/ipfilter/rules in 41edb306f0.

Point to users to /usr/src/share/examples/ipfilter instead, as the base
directory also contains example rules.

Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47392

(cherry picked from commit 8934526be1843ba033e1423f6ecd8b3b3f2a9c23)
2024-11-14 03:21:25 +00:00
Mark Johnston
fc3c731bbf rc.d/kld: Print modules being loaded, take three
Some kernel modules will print informative messages when they are
loaded, making the output confusing.  Print everything up front instead.

Fixes:	152382e6613d ("rc.d/kld: Print the kernel modules being loaded")

(cherry picked from commit 3e55170e0fa2695f6d662e3ab67201138a6f8698)
2024-11-09 01:09:50 +00:00
Mark Johnston
2cb615d015 rc.d/kld: Avoid printing a trailing space
Fixes:		152382e6613d ("rc.d/kld: Print the kernel modules being loaded")
Reported by:	jrtc27

(cherry picked from commit cdb3cda6fd53b89c2bba0308d21aa8edf782dc34)
2024-11-09 01:09:47 +00:00
Mark Felder
bba8c461b9 rc.d/kld: Print the kernel modules being loaded
PR:		282269
MFC after:	2 weeks

(cherry picked from commit 152382e6613d7998fe6f5233767df54d3fdec329)
2024-11-09 01:09:29 +00:00
Baptiste Daroussin
6c682f5c38 nuageinit: add support for OpenStack network config
Add naive support for openstack network config.
if no config driver have been found, try to detect that we are running a
VM on openstack via the smbios information, use the first iface
available and temporary activate dhcp on it, to be able to fetch the
necessary informations for cloudinit.

While here make the rc script execute after devmatch, some ethernet
device might be attached via devmatch and may be needed for cloudinit.

Tested on OVHCloud Public Cloud.

MFC after:	3 weeks
Sponsored by:	OVHCloud

(cherry picked from commit 2775b9b0bcc278dd4183b57784953c26a3fcdc89)
2024-11-06 09:36:12 +01:00
Mateusz Piotrowski
4ff71ffaa7 rc.d/sendmail: Return non-zero if the daemon fails to start or is not running
If you have a mail server that is running sendmail daemon
(sendmail_enable=YES) and sendmail queue runner (sendmail_msp_queue=YES)
and the sendmail daemon dies, /etc/rc.d/sendmail status does see the
daemon is not running but returns 0 as the exit code.  This prevents
other programs (like puppet) from restarting sendmail to fix the issue.

Make sure that the exit code is propagated towards the end of the script
if any of the sendmail services fail.

This patch does not call exit directly but instead just sets the exit
status code by calling exit in a subshell. This way we do not exit the
current shell in case the service script is sourced (e.g., when
rc_fast_and_loose is active).

PR:		223132
MFC after:	2 weeks
Reported by:	pirzyk
Discussed with:	jilles, eugen
Reviewed by:	christos, gshapiro (previous version), markj
Approved by:	christos (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D46862
Co-authored-by: Jim Pirzyk <pirzyk@FreeBSD.org>

(cherry picked from commit d2e7bb630b83848a774d8213014a9e0747775019)
2024-11-04 15:55:40 +01:00
Robert William Vesterman
6fb03ddbce libexec/rc/rc.d/netif: Typo fix
Just fixing a typo ("configuriing" => "configuring").

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1484

(cherry picked from commit 65691b2dafda23691c3989749def755a98e731ec)
2024-10-30 17:49:57 -07:00
Mateusz Piotrowski
025535f945 rc/tests: Skip oomprotect tests in a jail
oomprotect cannot be used in a jail.

Reviewed by:	bnovkov, christos, markj
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:	1 week

(cherry picked from commit 6fa42b91ca3f481912af98c4d49c44507eb1b8e1)
2024-10-21 11:59:16 +02:00
Mateusz Piotrowski
f94127e3ee rc.d/sendmail: Fix stopping service during shutdown
The sendmail service script needs to be stopped during shutdown
to ensure a clean shutdown of active SMTP connections (and writing
any in memory queue files).

rcorder(8) requires the rcorder block to be an uninterrupted sequence of
REQUIRE, PROVIDE, BEFORE, and KEYWORD lines. Having a comment in between
REQUIRE and KEYWORD makes rcorder stop parsing the block when it reaches
the comment.

Fix that by moving the comment out from the rcorder block.

Reviewed by:	bnovkov, christos, gshapiro, markj
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D46924

(cherry picked from commit 8751fbe36ff02ed695f02132ee6eac723d2bbe3f)
2024-10-14 12:23:46 +02:00
Jose Luis Duran
c96dbfbd1b nuageinit: Silence an fstyp(8) warning
Silence a warning emitted by fread(3) in fstyp(8)'s read_buf(), when
detecting the file system type of the cloud-init device:

    % fstyp /dev/iso9660/cidata
    fstyp: fread: Invalid argument
    cd9660

Also rephrase slightly a comment while here.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
(cherry picked from commit d71e2c037c942dbe2a9fd2630d5cf155dd1bf7db)
2024-10-08 09:04:01 +02:00
Mateusz Piotrowski
e3b57f1485 rc.subr: Consistently use an absolute path for sysrc
MFC after:	2 weeks
Approved by:	christos

(cherry picked from commit 401516dbc54e4a4cba3085cd605fbf6cf8293b79)
2024-10-02 11:27:00 +02:00
Mateusz Piotrowski
2ab84513e9 rc.d/dnctl: Chmod +x for consistency with other rc scripts
MFC after:	1 week
Approved by:	bnovkov

(cherry picked from commit 91fac46bf7cff03c3471422c67281041c5fa0f1f)
2024-10-02 11:11:20 +02:00
Bjoern A. Zeeb
d60a0ffecf rc: network.subr update consitency with older change (v6/v4 order)
As of 1b5be7204e we setup parts of IPv6
before IPv4 if configured.  For consistency change a case in ifn_start()
calling ipv6_up() before ipv4_up() and reverse in ifn_stop().

Reviewed by:	zlei
Differential Revision: https://reviews.freebsd.org/D33426

(cherry picked from commit ed4d2a54fc7a0397c2042f496f176305ca03ebdd)
2024-09-28 10:35:11 +00:00
Jessica Clarke
11d7aa07eb rc.d/devmatch: Silence sysctl hw.bus.devctl_nomatch_enabled=1
As with various other rc scripts, we don't want the output from this
being visible in the boot log.

Fixes:		6437872c1d66 ("New sysctl to disable NOMATCH until devmatch runs")
MFC after:	1 week

(cherry picked from commit 62775aebf725a79703592f3276118245a74afdac)
2024-09-07 01:03:16 +01:00
John Baldwin
7b9327d6b2 defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths
Commit 99132daf6f70cb0cc969c555d3612547fa3cf1db prepends /usr/lib32 to
the list of paths in ldconfig32_paths since it is a standard library
path in ld-elf32.so.1.  Remove /usr/lib32 from the value in rc.conf so
that it is not listed twice.

Reviewed by:	olce, kib
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D44752

(cherry picked from commit 4bf5db113f760619bf754c22864b1d7e2acdeabd)
2024-08-27 14:15:55 -04:00
Konrad Witaszczyk
ee104259c7 rc.d/ldconfig: Compute ldconfig paths in a function
Move logic that computes paths passed to ldconfig(8) to a
ldconfig_paths() function that can be called for multiple ABIs.

Reviewed by:	olce, kib
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D44751

(cherry picked from commit e6e38bc522e29de6299536b547bf11dab11e9679)
2024-08-27 14:15:48 -04:00
Isaac Cilia Attard
54bd536723 dhclient: rc.conf option to disable ARP resolution
Introduce a new rc.conf option to not wait for ARP resolution within
dhclient. This is plausible on many modern networks where it is possible
to trust the DHCP server to know whether an IP address is available.

Sponsored by:	Google LLC (GSoC 2024)
Signed-off-by:	Isaac Cilia Attard <icattard@FreeBSD.org>
MFC after:	10 days
Reviwed by:	cperciva, brooks, Tom Hukins, Alexander Ziaee
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1368

(cherry picked from commit 503adcdf1db35eab0f3d35392947a6da3bd19539)
2024-08-19 21:57:09 -07:00
Ed Maste
f06d322e9d Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5c2bc3db201a4fe8d7911cf816bea104d5dc2138)
2024-08-06 15:39:53 -04:00
Cy Schubert
13f9c4addb rc.conf: Leap-seconds sources: Add IANA back
11da791920ba switched Leap-seconds source from IANA to IERS, as IERS
is the canonoical source. The problem ist that IERS is not accessible
from IPv6 only networks. To work around this we must add IANA back in
order to provide IPv6-only users a source for leap-seconds fetch.

PR:		279413
Fixes:		11da791920ba

(cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83)
2024-07-21 19:36:30 -07:00
Eugene Grosbein
a3a09bbf21 rc.subr: improve description for ${name}_offcmd
Clarify that ${name}_offcmd is for method start.

(cherry picked from commit af1b0aa5b957bbfedc929167aa3459ad2d8b6653)
2024-06-21 15:27:50 +07:00
Eugene Grosbein
efb1717d21 rc.subr(8): MFC: introduce ${name}_offcmd
New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but now rc.subr(8) does not call it
if a service is not enabled.

Fix devd startup script to use it instead of start_precmd.

PR:		279198
Reported by:	Dmitry S. Lukhtionov
Tested by:	Dmitry S. Lukhtionov

(cherry picked from commit 32a579e4fc69a65e8901111ad5f65ec56a97dfab)
(cherry picked from commit c2db3a0c7d31116028b38b426a9b139d26cbc7e5)
2024-06-17 11:57:53 +07:00
Emmanuel Vadot
ac658a7c76 rc: Set var_run_enable to enable by default
This will load/save the /var/run directories at boot/shutdown if
and only if /var/run/ is a tmpfs mount so it is a win for tmpfs
users and a no-op for everyone else.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44097
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 72b045386dd3db8b31ec3067cb9e160cbd1cfbc6)
2024-06-04 13:38:54 +02:00
Baptiste Daroussin
2c5c85cbcf nuageinit: by default to not enable nuageinit
MFC After:	1 day
Reported by:	karels@

(cherry picked from commit 5681636ead6790d5ad2c24a4712f010fcdfc926c)
2024-05-20 13:24:38 +02:00
Isaac Cilia Attard
c58d78f4fa New sysctl to disable NOMATCH until devmatch runs
Introduce hw.bus.devctl_nomatch_enabled and use it to suppress NOMATCH
until devmatch runs

There's a lot of NOMATCH events generated at boot. We also run devmatch
once during early boot to load unmatched devices. To avoid redundant
work, don't start generating NOMATCH events until after devmatch runs.
Set hw.bus.devctl_nomatch_enabled=1 just before we run devmatch. The
kernel will suppress NOMATCH events until this is set to true.

This saves about 170ms from the boot on aarch64 running atop Apple
M-series processors and the VMWare Fusion hypervisor.

Reviewed by:    imp, cperciva
MFC after:      3 days
Sponsored by:   Google Summer of Code
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1213

(cherry picked from commit 6437872c1d665c2605f54e8ff040b0ba41edad07)
2024-05-13 15:24:29 -07:00
Baptiste Daroussin
93b11fe0a1 nuageinit: start the script after zfs
It prevents the home directory for the new users to be hidden
by late mount of the home directory

(cherry picked from commit b6a4776008519bb4a1d5abfe63c46d5f009ce102)
2024-05-02 09:49:41 +02:00
Cy Schubert
abc4b30889 kdc: Add restart option
Add a new kdc_restart rc variable that manages kdc (or krb5kdc) under
daemon(8). This automatically restarts the kdc should it fail, i.e.
when it's configured to use LDAP as a backend and cannot connect to its
LDAP directory.

Set kdc_restart="YES" to auto restart kdc on abnormal termination.

Set kdc_restart_delay="N" to the number of seconds to delay before
restarting the kdc. The daemon(8) default seconds applies when not set.

Reported by:		Lexi Winter <lexi.freebsd@le-fay.org>
PR:			278395
Differential Revision:	https://reviews.freebsd.org/D44898

(cherry picked from commit 9e248b7f645cdf05615a49cc15295df49b54d659)
2024-04-29 05:50:19 -07:00
Baptiste Daroussin
16a6da44e2 nuageinit: add basic support for cloudinit.
this is a very early script to support cloudinit, it does not intend to
be a full featured cloudinit client, but will support a good enough
subset to be viable in most case.

It support nocloud and openstack config-2 config drive mode (iso9660 or
msdosfs)

The following features are currently supported:
- adding users (including a default user named 'freebsd' with password
  'freebsd'
- adding groups
- adding ssh keys
- static ipv4, static ipv6, dynamic ipv4

With this one is able to use the 'bring your own image feature" out of
box.

It is expected that the script grows the support of other clouds
supporting cloud-init, contributions are welcomed.

It is designed to be only run once via the firstboot mecanism.

Sponsored by:	OVHCloud
Differential Revision:	https://reviews.freebsd.org/D44141

(cherry picked from commit a42d6f76018e4ed8324e319ab48aac904bda437c)
(cherry picked from commit c051f22bce42d920abba61bd7cf4ef5b6a270ffa)
(cherry picked from commit b8c053c9a612651d4909f7a323088f3e92485b7b)
(cherry picked from commit 9eae9233fdcc946945f4191e1413f548adfa2943)
2024-04-11 13:52:52 +02:00
Jose Luis Duran
df4a9902ea rc.initdiskless: Disable soft-updates in mdmfs (again)
Re-apply the -S switch to disable soft-updates in memory disks (commit
8b1292ac52). This might be beneficial when tmpfs(5) is not present in
the kernel, as this can cause mdmfs(8)'s auto keyword to fallback to
using md(4).

PR:		85558
MFC after:	1 week
Reviewed by:	imp, emaste, brooks
Differential Revision:	https://reviews.freebsd.org/D43242

(cherry picked from commit bb4116576f2edf466ada3885cf851599ce7a4792)
2024-03-29 09:53:54 -04:00
Warner Losh
ded562d4af leapseconds: Update to the canonical place.
IERS is the source of truth for leap seconds. Their leapsecond file is
updated most quickly and is always right (unlike the IANA one which
often lags). IERS operates this public service for the express purpose
of random people downloading it. Their terms of service are compatible
with open source (we could include this in our release). Rather than
fighting with questions around this because the IANA one changed
locations or the auto update script broken, just use this.

This is in preference to the NIST ftp copy. NIST is in the process of
retiring their FTP services.

Sponsored by:		Netflix
Reviewed by:		philip, delphij, cy
Differential Revision:	https://reviews.freebsd.org/D43752

(cherry picked from commit 11da791920ba285f0832f09cb504ac81e35ff8d1)
2024-02-07 22:14:35 -07:00
Cy Schubert
83ab4d6cc5 rc.d/kdc: Support start of MIT krb5kdc
Some users wishing to use the MIT krb5kdc have discovered the
kdc script workaround applied to the MIT krb5 ports is insufficient.
Let's build into this rc script the smarts to determine whether
base or ports Hiemdal kdc is being invoked or the MIT krb5kdc.

While at it, remove kdc_start_precmd(). This will simplify a future
jail patch.

Suggested by:		netchild
Original patch:		netchild
Reviewed by:		emaste, netchild
Differential Revision:	https://reviews.freebsd.org/D43523

(cherry picked from commit 91f78c32befa08bf4010db7afd4407277a3e585f)
2024-01-28 16:26:05 -08:00
Cheng Cui
404b91dac4
libexec/rc/rc.initdiskless: make tar's path flexible
PR:		274977

(cherry picked from commit 93b7818226cf5270646725805b4a8c17a1ad3761
 and from commit a04ca1c229195c7089b878a94fbe76505ea693b5)
2024-01-19 05:45:28 -05:00
Mark Johnston
c7c7faa614 rc.d: Process autobridge_* in vnet jails
Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43316

(cherry picked from commit 1809089a9613c6ebdb6861ee142fba90d6a20c45)
2024-01-18 10:52:15 -05:00
Philip Paeps
163c434238 rc.conf: correct $ntp_leapfile_sources
IETF is no longer serving leap-seconds.list.  Point at IANA instead.

This fixes "service ntpd fetch".

(cherry picked from commit b1c95af45488bef649e9a84890e2414ff80b3a00)
2023-12-16 10:31:41 +08:00
Cy Schubert
3d845d94ea rc.d/ldconfig: Remove stray ;;
(cherry picked from commit ac910ad9951a52743389a47fa4a3feabe9021aaa)
2023-11-28 13:40:07 +02:00
Konstantin Belousov
98f8057eaa ldconfig: only configure compat32 when kernel supports it
(cherry picked from commit 73902ed85ab73d455d4be8c77336c88a07512230)
2023-11-28 13:40:07 +02:00
Konstantin Belousov
81a5b2389d ldconfig: filter out non-existing directories from default path
(cherry picked from commit 806e4e3273bee2e3a12ffc2e74db5c912fbd7aa9)
2023-11-28 13:39:39 +02:00
John W. O'Brien
5dba91f557 rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_paths
PR:			275031

(cherry picked from commit 99132daf6f70cb0cc969c555d3612547fa3cf1db)
2023-11-28 13:39:39 +02:00
Jamie Gritton
c96d5c97bb MFC jail: avoid a clash with /etc/jail.conf.d between rc and jail(8)
Since 13.1, /etc/rc.d/jail has looked for a per-jail config file in
/etc/jail.conf.d. For RELENG 14, the ".include" directive was added to
jail(8), with a sample line in the jail.conf(5) man page that includes
"/etc/jail.conf.d/*.conf".

These two use cases don't work together. When the jail.conf.d files
are included from a master jail.conf, the files in jail.conf.d are
likely to hold only partial configurations, and shouldn't be directly
loaded by rc.d/jail. But there are existing configurations that depend
on the current rc.d behavior. While users could be advised not to
include from /etc/jail.conf.d, it's the natural choice even if not
mentioned in jail.conf.5.

The workaround is for rc.d/jail to continue to load the individual
files, but only when /etc/jail.conf doesn't include from that
directory (via a simple grep test), This allows the current use
while not breaking the previous use.

Reported by:	antranigv at freebsd.am
Differential Revision:	https://reviews.freebsd.org/D41962

(cherry picked from commit a2440348eed75bb7682579af0905b652747fd016)
2023-09-27 21:39:00 -07:00
Daniel Tameling
f701d9da1d rc.subr: don't require service to be enabled for status
For a service that sets an rcvar, there is a check whether it has been
enabled before the actual command is executed. If the check fails, one
gets a message to enable it and the returned exit status is 0.
However, this is usually undesirable for the status command, which is
a) supposed to check whether the service is running anyway and
b) returns a non-zero exit code if that is not the case.
Thus, skip the check for the status command.

PR:		272282
Reviewed by:	emaste

(cherry picked from commit ba793728a840041e93e38bcbff4a7233dc63b722)
2023-09-24 09:17:43 -04:00