Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd warns about unset variables #1142

Closed
dennis-ju opened this issue Feb 2, 2024 · 6 comments · Fixed by #1144 or #1209
Closed

Systemd warns about unset variables #1142

dennis-ju opened this issue Feb 2, 2024 · 6 comments · Fixed by #1144 or #1209
Assignees

Comments

@dennis-ju
Copy link
Contributor

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
Copy link
Contributor

pcercuei commented Feb 7, 2024

@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
Copy link
Contributor Author

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 added a commit to dennis-ju/libiio that referenced this issue Feb 8, 2024
Systemd now gives a warning when IIOD_EXTRA_OPTS is unset.

This change sets it to an empty string by default while still allowing
it be overridden by /etc/default/iiod.

Fixes analogdevicesinc#1142.

Change-Id: I71c9979741eabab1fb5278b503bc984d998cfb3d
Signed-off-by: Dennis Jusufovic <[email protected]>
dennis-ju added a commit to dennis-ju/libiio that referenced this issue Feb 8, 2024
Systemd now gives a warning when IIOD_EXTRA_OPTS is unset.

This change sets it to an empty string by default while still allowing
it be overridden by /etc/default/iiod.

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
mhennerich pushed a commit that referenced this issue Feb 20, 2024
Systemd now gives a warning when IIOD_EXTRA_OPTS is unset.

This change sets it to an empty string by default while still allowing
it be overridden by /etc/default/iiod.

Fixes #1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
@dennis-ju
Copy link
Contributor Author

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

@mhennerich
Copy link
Contributor

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

Yes

@mhennerich mhennerich reopened this Feb 23, 2024
@mhennerich
Copy link
Contributor

Lets re-open

dennis-ju added a commit to dennis-ju/libiio that referenced this issue Feb 23, 2024
Systemd now gives a warning when IIOD_EXTRA_OPTS is unset.

This change sets it to an empty string by default while still allowing
it be overridden by /etc/default/iiod.

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
cristina-suteu pushed a commit that referenced this issue Mar 4, 2024
Systemd now gives a warning when IIOD_EXTRA_OPTS is unset.

This change sets it to an empty string by default while still allowing
it be overridden by /etc/default/iiod.

Fixes #1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
@dennis-ju
Copy link
Contributor Author

Unfortunately the issue is not solved yet. A rogue dollar sign causes the assignment of IIOD_EXTRA_OPTS to be invalid. I'll add a new fix soon.

@dennis-ju dennis-ju reopened this Oct 24, 2024
dennis-ju added a commit to dennis-ju/libiio that referenced this issue Oct 24, 2024
Fixed an invalid assignment of IIOD_EXTRA_OPTS in the service file.

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
dennis-ju added a commit to dennis-ju/libiio that referenced this issue Oct 24, 2024
Fixed an invalid assignment of IIOD_EXTRA_OPTS in the service file.

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
dennis-ju added a commit to dennis-ju/libiio that referenced this issue Oct 28, 2024
Removing extraneous $ in the assignment of IIOD_EXTRA_OPTS in the
service file that was part of analogdevicesinc@a436ad6

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
dennis-ju added a commit to dennis-ju/libiio that referenced this issue Oct 28, 2024
Removing extraneous $ in the assignment of IIOD_EXTRA_OPTS in the
service file that was part of analogdevicesinc@a436ad6

Fixes analogdevicesinc#1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
mhennerich pushed a commit that referenced this issue Nov 8, 2024
Removing extraneous $ in the assignment of IIOD_EXTRA_OPTS in the
service file that was part of a436ad6

Fixes #1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
mhennerich pushed a commit that referenced this issue Nov 8, 2024
Removing extraneous $ in the assignment of IIOD_EXTRA_OPTS in the
service file that was part of a436ad6

Fixes #1142.

Signed-off-by: Dennis Jusufovic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants