Add 'set' keyword for environment variables set in /etc/finit.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-02-22 19:56:29 +01:00
1 parent d363501e21
commit f7bacf8b1b
2 files changed
+10 -3

No files matched your search

+5 -3
View File
@@ -207,10 +207,12 @@ and any `*.conf`, was added. It is worth noting that these are global
and *shared with all* services -- the only way to have service-local and *shared with all* services -- the only way to have service-local
environment is detailed in the next section. environment is detailed in the next section.
The syntax for global environment variables is straight forward: The syntax for global environment variables is straight forward. In
Finit v4.4 the `set` keyword was added for completeness, but the old
syntax (without the `set ` prefix) is still honored:
foo=bar set foo=bar
baz="qux" set baz="qux"
On reload of .conf files, all tracked environment variables are cleared On reload of .conf files, all tracked environment variables are cleared
so if `foo=bar` is removed from `finit.conf`, or any `finit.d/*.conf` so if `foo=bar` is removed from `finit.conf`, or any `finit.d/*.conf`
+5
View File
@@ -708,6 +708,11 @@ static int parse_static(char *line, int is_rcsd)
return 0; return 0;
} }
if (BOOTSTRAP && MATCH_CMD(line, "set ", x)) {
parse_env(x);
return 0;
}
if (MATCH_CMD(line, "include ", x)) { if (MATCH_CMD(line, "include ", x)) {
char *file = strip_line(x); char *file = strip_line(x);