<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/etc/rc.subr, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2018-07-28T20:41:33Z</updated>
<entry>
<title>Opps, I missed moving a couple of files in r336845.</title>
<updated>2018-07-28T20:41:33Z</updated>
<author>
<name>Brad Davis</name>
<email>brd@FreeBSD.org</email>
</author>
<published>2018-07-28T20:41:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=df89e317127b204127da018b5cf5a4fbee4ec4ce'/>
<id>urn:sha1:df89e317127b204127da018b5cf5a4fbee4ec4ce</id>
<content type='text'>
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16466
</content>
</entry>
<entry>
<title>rc.subr: Support loading environmental variables from a file</title>
<updated>2018-05-25T19:36:26Z</updated>
<author>
<name>Mark Felder</name>
<email>feld@FreeBSD.org</email>
</author>
<published>2018-05-25T19:36:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=75a315f6d2a31c61cb3f3da58e44be090c663ff7'/>
<id>urn:sha1:75a315f6d2a31c61cb3f3da58e44be090c663ff7</id>
<content type='text'>
The current support for setting environment via foo_env="" in rc.conf is
not scalable and does not handle envs with spaces in the value. It seems
a common pattern for some newer software is to skip configuration files
altogether and rely on the env. This is well supported in systemd unit
files and may be the inspiration for this trend.

MFH:		1 week
Differential Revision:	https://reviews.freebsd.org/D14453
</content>
</entry>
<entry>
<title>Support configuring arbitrary limits(1) for any daemon in rc.conf</title>
<updated>2018-01-24T14:15:06Z</updated>
<author>
<name>Dmitry Marakasov</name>
<email>amdmi3@FreeBSD.org</email>
</author>
<published>2018-01-24T14:15:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=148ee4c3ff5cbea187d09ea86fd1cc053b794ae7'/>
<id>urn:sha1:148ee4c3ff5cbea187d09ea86fd1cc053b794ae7</id>
<content type='text'>
Usage is ${name}_limits, and the argument is any flags accepted by
limits(1), such as `-n 100' (e.g. only allow 100 open files).

Approved by:	cy
Differential Revision:	https://reviews.freebsd.org/D14015
</content>
</entry>
<entry>
<title>userland: Fix several typos and minor errors</title>
<updated>2017-12-27T03:23:01Z</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2017-12-27T03:23:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dae3a64fb967bbff627efc2e8cdd127c6b93d902'/>
<id>urn:sha1:dae3a64fb967bbff627efc2e8cdd127c6b93d902</id>
<content type='text'>
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
</content>
</entry>
<entry>
<title>rc.subr: Remove test that is always true.</title>
<updated>2017-10-15T11:28:41Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2017-10-15T11:28:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d78b853f0ff789cf35e4ef35339e8b74bef3e3b3'/>
<id>urn:sha1:d78b853f0ff789cf35e4ef35339e8b74bef3e3b3</id>
<content type='text'>
The code above always sets _pidcmd to a non-empty value.
</content>
</entry>
<entry>
<title>Enhance mdmfs(8) to work with tmpfs(5).</title>
<updated>2017-09-29T22:13:26Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2017-09-29T22:13:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=50e3590c4486925a3694a113f59db7db69eb7679'/>
<id>urn:sha1:50e3590c4486925a3694a113f59db7db69eb7679</id>
<content type='text'>
Existing scripts and associated config such as rc.initdiskless, rc.d/var,
and others, use mdmfs to create memory filesystems. That program accepts a
size argument which allows SI suffixes and treats an unsuffixed number as a
count of 512 byte sectors. That makes it difficult to convert existing
scripts to use tmpfs instead of mdmfs, because tmpfs treats unsuffixed
numbers as a count of bytes. The script logic to deal with existing user
config that might include suffixed and unsuffixed numbers is... unpleasant.

Also, there is no g'tee that tmpfs will be available. It is sometimes
configured out of small-resource embedded systems to save memory and flash
storage space.

These changes enhance mdmfs(8) so that it accepts two new values for the
'md-device' arg: 'tmpfs' and 'auto'. With tmpfs, the program always uses
tmpfs(5) (and fails if it's not available). With 'auto' the program prefers
tmpfs, but falls back to using md(4) if tmpfs isn't available. It also
handles the -s &lt;size&gt; argument so that the mdconfig interpetation of
unsuffixed numbers applies when tmpfs is used as well, so that existing user
config keeps working after a switch to tmpfs.

A new rc setting, mfs_type, is added to etc/defaults/rc.conf to let users
force the use of tmpfs or md; the default value is "auto".

Differential Revision:	https://reviews.freebsd.org/D12301
</content>
</entry>
<entry>
<title>rc.subr: Optimize repeated sourcing.</title>
<updated>2017-06-11T19:06:07Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2017-06-11T19:06:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eaac4bffc7566a21e5e8429caa82d7d4249b9ff1'/>
<id>urn:sha1:eaac4bffc7566a21e5e8429caa82d7d4249b9ff1</id>
<content type='text'>
When /etc/rc runs all /etc/rc.d scripts, it has already loaded /etc/rc.subr
but each /etc/rc.d script sources it again (since /etc/rc.d scripts must
also work when started stand-alone).

Therefore, if rc.subr is already loaded, return so sh need not parse the
rest of the file.

A second effect is that there is no longer a compound command around most of
rc.subr. This reduces memory usage while sh is loading rc.subr for the first
time (but this memory is free()d once rc.subr is loaded).

For purposes of porting this to other systems, I do not recommend porting
this to systems with shells that do not have the change to the return
special builtin like in r255215 (before FreeBSD 10.0-RELEASE). This change
ensures that return in the top level of a dot script returns from the dot
script, even if the dot script was sourced from a function.

A comparison of CPU time on an amd64 bhyve virtual machine from a times
command added near the end of /etc/rc, all four values summed:

x orig1
+ quickreturn
+--------------------------------------------------------------------------+
|  +    +              +                             x    x               x|
||______M__A_________|                             |______M___A__________| |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   3         1.704         1.802         1.726         1.744   0.051419841
+   3         1.467         1.559         1.487     1.5043333   0.048387326
Difference at 95.0% confidence
	-0.239667 +/- 0.113163
	-13.7424% +/- 6.48873%
	(Student's t, pooled s = 0.0499266)
</content>
</entry>
<entry>
<title>Revert r316487. It is broken, causing boot to fail due to line 25 in</title>
<updated>2017-04-06T12:52:05Z</updated>
<author>
<name>Cy Schubert</name>
<email>cy@FreeBSD.org</email>
</author>
<published>2017-04-06T12:52:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f6245ac3f7cce7d3af33f9f2a6096f2b64943fc3'/>
<id>urn:sha1:f6245ac3f7cce7d3af33f9f2a6096f2b64943fc3</id>
<content type='text'>
etc/rc.d/dhclient unconditionally testing true when called by a devd
rule during boot, ignoring statically assigned IP addresses in rc.conf.

Requested by:	des@
</content>
</entry>
<entry>
<title>Revert r316516. des@ asked that r316516 be reverted so that he can spend</title>
<updated>2017-04-06T00:15:18Z</updated>
<author>
<name>Cy Schubert</name>
<email>cy@FreeBSD.org</email>
</author>
<published>2017-04-06T00:15:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=89f0a53cfe5a24e3390279c929539f66cfeb5c15'/>
<id>urn:sha1:89f0a53cfe5a24e3390279c929539f66cfeb5c15</id>
<content type='text'>
a little more time getting r316487 right.

Requested by:	des@
</content>
</entry>
<entry>
<title>r316487 altered the defined values of rc_force from "yes" (for yes)</title>
<updated>2017-04-05T05:23:09Z</updated>
<author>
<name>Cy Schubert</name>
<email>cy@FreeBSD.org</email>
</author>
<published>2017-04-05T05:23:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4360d992ef0f06f4d74042f42de15607b663775f'/>
<id>urn:sha1:4360d992ef0f06f4d74042f42de15607b663775f</id>
<content type='text'>
and NULL (for no) to "no" (for no) and no change to the definition
of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for
yesi, using test -n, and no, using test -z. The redefinition of
yes and no by r316487 caused rc.d/dhclient, when invoked by devd
using a devd.conf rule, to assign DHCP assigned IP addresses for
interfaces with statically assigned interfaces, breaking boot.
Point of breakage was at line 25 of etc/rc.d/dhclient (r301068)
where $rc_force needs to be NULL.

MFC after:	3 weeks
X-MFC with:	r316487
</content>
</entry>
</feed>
