Bug 804320 - RFE: accept "export" in EnvironmentFile
RFE: accept "export" in EnvironmentFile
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-17 15:51 EDT by Remi Collet
Modified: 2012-09-17 12:59 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 12:56:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Remi Collet 2012-03-17 15:51:07 EDT
Before systemd, EnvironmentFile often have "export" line.

Ex in /etc/sysconfig/sshd

  export SSH_USE_STRONG_RNG=0


Often sysadmin add such variable in /etc/sysconfig/httpd, p.e.

  export SOMEVAR=foo


This syntaxe is silently ignored by systemd

Of course, the right syntax is

  SOMEVAR=foo


It will be great if systemd could accepts the "export" syntax.
Comment 1 Michal Schmidt 2012-03-19 09:54:01 EDT
On my system there's only one occurrence of "export" among the 70 files in /etc/sysconfig/ and that's the sshd.

The line is not ignored. It actually does add the string "export SSH_USE_STRONG_RNG=0" into the environment. Of course this is not what anyone wants. We should refuse to add keys with spaces (or other weird chars) and report errors.

Now as to whether to support the "export" syntax explicitly... I dislike the idea. It would add to the illusion that environment files are shell scripts, which they're not.
Comment 2 Kay Sievers 2012-03-19 10:07:20 EDT
Yes, we should validate the key name, and refuse lines with whitespace
and any non-printable characters.

Right, 'export' is a shell command; we do not want to make it look like systemd
understands shell, hence do not want to support or ignore 'export'.
Comment 3 Robert Scheck 2012-09-17 12:35:42 EDT
Bah, systemd still does not honor "export FOO=bar" for EnvironmentFile...
Comment 4 Kay Sievers 2012-09-17 12:56:13 EDT
Systemd does not understand shell specific syntax, and it should not pretend
it does. Closing as WONTFIX.
Comment 5 Robert Scheck 2012-09-17 12:59:31 EDT
I disagree and we will happly discuss this from the Enterprise perspective
of being a Red Hat partner and customer once this systemd stuff enters RHEL.

Note You need to log in before you can comment on or make changes to this bug.