condition: add ConditionEnvironment=
Prompted by the discussions in #15180. This is a bit more complex than I hoped, since for PID 1 we need to pass in the synethetic environment block in we generate on demand.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bond.h"
|
||||
@@ -693,7 +694,7 @@ int netdev_load_one(Manager *manager, const char *filename) {
|
||||
return r;
|
||||
|
||||
/* skip out early if configuration does not match the environment */
|
||||
if (!condition_test_list(netdev_raw->conditions, NULL, NULL, NULL)) {
|
||||
if (!condition_test_list(netdev_raw->conditions, environ, NULL, NULL, NULL)) {
|
||||
log_debug("%s: Conditions in the file do not match the system environment, skipping.", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user