fix(rngd): add configuration file on ArchLinux - #2543
Conversation
ArchLinux uses /etc/conf.d rather than /etc/sysconfig in its rngd.service to read environment variables from. So far this file was not included automatically, and only sysconfig was considered, leading to rngd.service failing on boot on ArchLinux if rng-tools is just installed. This commit adds the same handling for /etc/conf.d Fixes: dracut-ng#2542
|
Earlier discussion on this - #2243 |
I can see that standardising the path upstream would be preferred in the medium term, but the status quo is a rather unfortunate automatic failure of a service if rng tools is just installed. Wouldn't it make sense to merge this fix, as it doesn't have any downsides? |
|
An alternative would be to enhance dracut to read the service file and look for |
|
I'm not really a fan of this, I'd rather have a more general solution to read and include EnvironmentFiles for any systemd units. |
|
I can see how such a general solution would be overall preferable, but that's much different in terms of scope than a simple bugfix. As mentioned, this creates real issues right now for people who are using Dracut on Arch. A general solution would require quite some design discussion, as .service files can be overridden. What if it read the EnvironmentFile=... line from the .service file, but a user had overridden it to use a different location? You couldn't read that from the .service alone. As of such, and considering that the /etc/sysconfig solution exists right next to it as the same stop-gap until such a feature is designed, wouldn't it be an option to merge this as a bugfix until then? |
|
My worry is that then this opens the doors for every distro's variants of this to be in every module, and I don't really want to be in the business of figuring that out when someone does something stupid like have two distros' files because they cross-graded and so the wrong data is read. This is already bad enough as it is. 😦 |
|
I don't know if this is acceptable but this could be used to read all potential environment files from the unit, and this would work even if the end user customized the units or with systemd drop-in files: |
@bdrung has started similar work in another PR I think - see #1031 We would have to understand the performance impact of such an extra computation before merging |
ArchLinux uses /etc/conf.d rather than /etc/sysconfig in its rngd.service to read environment variables from. So far this file was not included automatically, and only sysconfig was considered, leading to rngd.service failing on boot on ArchLinux if rng-tools is just installed. This commit adds the same handling for /etc/conf.d
Fixes: #2542
Checklist