Bug 63477 - Environment file parser gets confused by comments
Environment file parser gets confused by comments
Status: RESOLVED FIXED
Product: systemd
Classification: Unclassified
Component: general
unspecified
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: Zbigniew Jedrzejewski-Szmek
systemd-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-12 16:26 UTC by Alain Kalker
Modified: 2013-04-14 00:26 UTC (History)
3 users (show)

See Also:


Attachments
service file used for debugging (435 bytes, text/plain)
2013-04-12 16:26 UTC, Alain Kalker
Details
output of `systemctl status lm_sensors.service` after failure (1.23 KB, text/plain)
2013-04-12 16:49 UTC, Alain Kalker
Details
/etc/conf.d/lm_sensors failing (643 bytes, text/plain)
2013-04-12 16:50 UTC, Alain Kalker
Details
output of `systemctl status lm_sensors.service` after success (821 bytes, text/plain)
2013-04-12 16:54 UTC, Alain Kalker
Details
/etc/conf.d/lm_sensors working (70 bytes, text/plain)
2013-04-12 16:55 UTC, Alain Kalker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Kalker 2013-04-12 16:26:31 UTC
Created attachment 77894 [details]
service file used for debugging

After installing lm_sensors package, I discovered that lm_sensors.service wasn't picking up its environment variables from its EnvironmentFile= directive.
After some experimenting, I found that only the last environment variable defined in the environment file was non-blank.

I found that the only way to ensure that all variables are set is to remove all comments (preceded by '#') from the environment file.

As I'm not entirely sure what exactly in those comments is confusing systemd, I'm including a failing and a working environment file, as well as the service file I used for debugging.
Comment 1 Alain Kalker 2013-04-12 16:49:44 UTC
Created attachment 77899 [details]
output of `systemctl status lm_sensors.service` after failure
Comment 2 Alain Kalker 2013-04-12 16:50:49 UTC
Created attachment 77901 [details]
/etc/conf.d/lm_sensors failing
Comment 3 Alain Kalker 2013-04-12 16:54:29 UTC
Created attachment 77902 [details]
output of `systemctl status lm_sensors.service` after success
Comment 4 Alain Kalker 2013-04-12 16:55:02 UTC
Created attachment 77903 [details]
/etc/conf.d/lm_sensors working
Comment 5 Zbigniew Jedrzejewski-Szmek 2013-04-14 00:26:39 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=d3b6d0c21.