Page MenuHomeFreeBSD

Fix default login class for services started via command line; allow service class in /etc/login.conf to be overridden.
ClosedPublic

Authored by adrian on Sep 10 2015, 10:10 PM.
Tags
None
Referenced Files
F86706760: D3630.diff
Mon, Jun 24, 8:30 AM
F86706408: D3630.id.diff
Mon, Jun 24, 8:23 AM
Unknown Object (File)
May 18 2024, 1:33 PM
Unknown Object (File)
May 18 2024, 6:45 AM
Unknown Object (File)
May 5 2024, 11:18 AM
Unknown Object (File)
Apr 29 2024, 11:22 PM
Unknown Object (File)
Apr 27 2024, 7:19 AM
Unknown Object (File)
Apr 27 2024, 7:18 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 594
Build 594: arc lint + arc unit

Event Timeline

adrian retitled this revision from to Fix default login class for services started via command line; allow service class in /etc/login.conf to be overridden..
adrian updated this object.
adrian edited the test plan for this revision. (Show Details)
etc/rc.subr
771

should we just call it ${name}_class instead of ${name}_login_class? it really doesn't have much to do with 'login'

Agreed that Hunk #1 (curfiles) is not subject to review.

Hunk #3 is completely unnecessary (assigning default value for _login_class).
Hunk #4 can be simplified to the following (again, Hunk #3 removed):

1060: # Prepend default limits
1061: _doit="limits -C ${_login_class:-daemon} $_doit"

Alternatively, if you think that future code may want to inherit the default, keep Hunk #3 but change it to:

: ${_login_class:=daemon}

And don't modify Hunk #4.

etc/rc.subr
947

After some thought, I think the best solution is:

947: _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon}

Then, remove lines 948-952 below. With that, this patch would be ready to sail.

adrian edited edge metadata.

Address devin's feedback.

This revision was automatically updated to reflect the committed changes.