Summary: | rc: Environment variables set via ${name}_env are not passed to ${rc_arg}_cmd (e.g., start_cmd) | ||
---|---|---|---|
Product: | Base System | Reporter: | Mateusz Piotrowski <0mp> |
Component: | conf | Assignee: | Mateusz Piotrowski <0mp> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | jgh, kevans, koobs, rc, rgrimes |
Priority: | --- | Flags: | 0mp:
mfc-stable12+
koobs: mfc-stable11- |
Version: | 11.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D21228 | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235185 |
Description
Mateusz Piotrowski
2019-08-07 12:12:40 UTC
I've posted an attempt at addressing this issue: https://reviews.freebsd.org/D21228 A commit references this bug: Author: 0mp Date: Thu Sep 5 14:52:23 UTC 2019 New revision: 351863 URL: https://svnweb.freebsd.org/changeset/base/351863 Log: rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd) A user may set ${name}_env variable in rc.conf(5) in order to set additional environment variables for a service command. Unfortunately, at the moment this variable is only honored when the command is specified via the command variable. Those additional environment variables coming from ${name}_env are never set if the service is started via the ${rc_arg}_cmd variable (for example start_cmd). PR: 239692 Reviewed by: bcr, jilles Approved by: src (jilles) Differential Revision: https://reviews.freebsd.org/D21228 Changes: head/libexec/rc/rc.subr head/share/man/man8/rc.subr.8 Re-open for MFC (requested earlier), given the desirability of having this behaviour consistent across supported FreeBSD versions and the limited scope of the change. Would be great to add this to RELNOTES too A commit references this bug: Author: 0mp Date: Tue Nov 10 10:19:55 UTC 2020 New revision: 367550 URL: https://svnweb.freebsd.org/changeset/base/367550 Log: MFC r351863: rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd) A user may set ${name}_env variable in rc.conf(5) in order to set additional environment variables for a service command. Unfortunately, at the moment this variable is only honored when the command is specified via the command variable. Those additional environment variables coming from ${name}_env are never set if the service is started via the ${rc_arg}_cmd variable (for example start_cmd). PR: 239692 Reviewed by: bcr, jilles Approved by: src (jilles) Requested by: koobs Changes: _U stable/12/ stable/12/libexec/rc/rc.subr stable/12/share/man/man8/rc.subr.8 A commit references this bug: Author: 0mp Date: Tue Nov 10 10:40:45 UTC 2020 New revision: 367551 URL: https://svnweb.freebsd.org/changeset/base/367551 Log: Add an entry for r351863 (honoring ${name}_env in rc(8) scripts) PR: 239692 Requested by: koobs Changes: head/RELNOTES Done. I'm not MFCing the change to 11-STABLE as there seem to be some conflicts which make my Subversion client hang. Thanks Mateusz! ^Triage: Track (current) explicit non-merge to stable/11 @Kyle Do you have cycles to check the MFC for stable/11 ? Consistency would be nice for this one. (In reply to Kubilay Kocak from comment #7) Unfortunately not, but almost certainly the conflict is that the file doesn't exist as written in stable/11 so the diff would not apply cleanly. To be honest, if it's not something we'd issue an EN for, there's not much point in trying to keep stable/11 consistent anymore -- there will not be another release from that branch, so most folks will not see the difference anyways. (In reply to Kyle Evans from comment #8) Roger, just asking :) Thanks! |