Yes, the original intention of linux.parameters
was to have a recommended file to add that is not managed by apt
or yum
.
I have a feeling that when it was originally added, it was primarily aimed at init.d
systems. I can’t recall anyone asking about it for systemd
services before.
We could add this to openhab.service
as you suggest to match the same behavior as starting it manually.
However, generally if you want to have your own Environment vars for a systemd
service without interference from the apt
mechanism that set it up. You can use the following:
sudo systemctl edit openhab
This will allow you to override or add your own settings to openHAB’s service and the file that gets created isn’t tracked by apt
or yum
.
### Editing /etc/systemd/system/openhab.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
EnvironmentFile=-/etc/openhab/linux.parameters
So there’s two ways of going about it:
- We add the EnvironmentFile parameter to
/etc/systemd/system/openhab.service
, this may have consequences to anyone who has a legacylinux.parameters
file in their system but I think there chance of this is very low and acceptable considering anyone editing this file would have done a reasonable amount of lookup. - We alter documentation to encourage users to override
systemd
units in the the usual way. - Bonus option - we do both!
On a second side note: I’m not sure that /etc/default/openhab
gets changed without the user’s permission. This is set as a conffile for apt
and yum
so there should be some warning during installation that this file gets changed, apt
gives an option for keeping the user version rather than the maintainer version.