Bug#931867: /lib/init/init-d-script is sourcing /etc/default/* too late
Mark Hindley
mark at hindley.org.uk
Tue Mar 18 11:00:15 GMT 2025
Control: tags -1 patch
The specific src:snmp issue was addressed in #932775.
I think the best solution is to document that /etc/default/$NAME variables are
not available at top-level.
Mark
commit eff6c194b8afabc3c5ba449c0399b9301fa7736f
Author: Mark Hindley <mark at hindley.org.uk>
Date: Tue Mar 18 10:55:24 2025 +0000
init-d-script.5: document that /etc/default/$NAME environment is not available in script top-level.
Closes: #931867
diff --git a/debian/init-d-script.5 b/debian/init-d-script.5
index d649147d..a1e72cdf 100644
--- a/debian/init-d-script.5
+++ b/debian/init-d-script.5
@@ -50,7 +50,9 @@ If unset, this variable defaults to the
value.
.It Ev NAME
Additional environment variables are sourced from
-.Pa /etc/default/${NAME} .
+.Pa /etc/default/${NAME}
+and made available to executed processes and within overridden functions,
+but not at top level.
If unset, this variable defaults to the basename of the
.Dq Ev DAEMON
value.
More information about the Debian-init-diversity
mailing list