analogdevicesinc / libiio

A cross platform library for interfacing with local and remote Linux IIO devices
http://analogdevicesinc.github.io/libiio/
GNU Lesser General Public License v2.1
471 stars 309 forks source link

Systemd warns about unset variables #1142

Closed dennis-ju closed 3 months ago

dennis-ju commented 5 months ago

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?

pcercuei commented 4 months ago

@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?

dennis-ju commented 4 months ago

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 commented 4 months ago

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

mhennerich commented 4 months ago

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

Yes

mhennerich commented 4 months ago

Lets re-open