libiio icon indicating copy to clipboard operation
libiio copied to clipboard

Systemd warns about unset variables

Open dennis-ju opened this issue 1 year ago • 5 comments

During startup of iiod, we get the following warning: iiod.service: Referenced but unset environment variable evaluates to an empty string: IIOD_EXTRA_OPTS

This is because since v254 of systemd, unset environmental variables will result in a warning (see commit).

I could make a PR where I add this to the service file: Environment=IIOD_EXTRA_OPTS=''

Would this be a good solution?

dennis-ju avatar Feb 02 '24 12:02 dennis-ju

@dennis-ju IIOD_EXTRA_OPTS is supposed to (optionally) be set in the config file, /etc/default/iiod. Do you have a way to make it default to an empty string, but still be overridden by the config file if it exists?

pcercuei avatar Feb 07 '24 12:02 pcercuei

Yes, I believe that adding the line Environment=IIOD_EXTRA_OPTS='' would set it to an empty string while still being overridden if it is set in /etc/default/iiod.

In the systemd manual (see link) under EnvironmentFile= it says "Settings from these files override settings made with Environment=."

dennis-ju avatar Feb 07 '24 14:02 dennis-ju

Is there a possibility that we could add this to the legacy branch?

dennis-ju avatar Feb 23 '24 14:02 dennis-ju

Is there a possibility that we could add this to the legacy branch?

Yes

mhennerich avatar Feb 23 '24 14:02 mhennerich

Lets re-open

mhennerich avatar Feb 23 '24 14:02 mhennerich