};
if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM)
- (void) config_parse_config_file("system.conf",
+ (void) config_parse_config_file("systemd/system.conf",
"Manager\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN,
int r;
r = config_parse_config_file(
- "coredump.conf",
+ "systemd/coredump.conf",
"Coredump\0",
config_item_table_lookup,
items,
assert(m);
- return config_parse_config_file("homed.conf", "Home\0",
+ return config_parse_config_file("systemd/homed.conf", "Home\0",
config_item_perf_lookup, homed_gperf_lookup,
CONFIG_PARSE_WARN, m);
}
{}
};
- return config_parse_config_file("journal-remote.conf", "Remote\0",
+ return config_parse_config_file("systemd/journal-remote.conf", "Remote\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN, NULL);
}
{}
};
- return config_parse_config_file("journal-upload.conf", "Upload\0",
+ return config_parse_config_file("systemd/journal-upload.conf", "Upload\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN, NULL);
}
}
static int server_parse_config_file(Server *s) {
- const char *conf_file = "journald.conf";
+ const char *conf_file;
assert(s);
if (s->namespace)
- conf_file = strjoina("journald@", s->namespace, ".conf");
+ conf_file = strjoina("systemd/journald@", s->namespace, ".conf");
+ else
+ conf_file = "systemd/journald.conf";
return config_parse_config_file(conf_file, "Journal\0",
config_item_perf_lookup, journald_gperf_lookup,
int manager_parse_config_file(Manager *m) {
assert(m);
- return config_parse_config_file("logind.conf", "Login\0",
+ return config_parse_config_file("systemd/logind.conf", "Login\0",
config_item_perf_lookup, logind_gperf_lookup,
CONFIG_PARSE_WARN, m);
}
assert(m);
- r = config_parse_config_file("networkd.conf",
+ r = config_parse_config_file("systemd/networkd.conf",
"Network\0"
"DHCPv4\0"
"DHCPv6\0"
{}
};
- return config_parse_config_file("oomd.conf", "OOM\0",
+ return config_parse_config_file("systemd/oomd.conf", "OOM\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN, NULL);
}
{}
};
- return config_parse_config_file("pstore.conf", "PStore\0",
+ return config_parse_config_file("systemd/pstore.conf", "PStore\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN, NULL);
}
assert(m);
- r = config_parse_config_file("resolved.conf", "Resolve\0",
+ r = config_parse_config_file("systemd/resolved.conf", "Resolve\0",
config_item_perf_lookup, resolved_gperf_lookup,
CONFIG_PARSE_WARN, m);
if (r < 0)
/* Parse one main config file located in /etc/$pkgdir and its drop-ins, which is what all systemd daemons
* do. */
-int config_parse_config_file_full(
+int config_parse_config_file(
const char *conf_file,
- const char *pkgdir,
const char *sections,
ConfigItemLookup lookup,
const void *table,
int r;
assert(conf_file);
- assert(pkgdir);
/* build the dropin dir list */
dropin_dirs = new0(char*, strv_length(conf_paths) + 1);
STRV_FOREACH(p, conf_paths) {
char *d;
- d = strjoin(*p, pkgdir, "/", conf_file, ".d");
+ d = strjoin(*p, conf_file, ".d");
if (!d) {
if (flags & CONFIG_PARSE_WARN)
- return log_oom();
+ log_oom();
return -ENOMEM;
}
if (r < 0)
return r;
- const char *sysconf_file = strjoina(SYSCONF_DIR, "/", pkgdir, "/", conf_file);
+ const char *sysconf_file = strjoina(SYSCONF_DIR, "/", conf_file);
return config_parse_many_files(STRV_MAKE_CONST(sysconf_file), dropins,
sections, lookup, table, flags, userdata, NULL);
void *userdata,
struct stat *ret_stat); /* possibly NULL */
-int config_parse_config_file_full(
- const char *conf_file,
- const char *pkgdir,
+int config_parse_config_file(
+ const char *conf_file, /* a path like "systemd/frobnicator.conf" */
const char *sections, /* nulstr */
ConfigItemLookup lookup,
const void *table,
ConfigParseFlags flags,
void *userdata);
-static inline int config_parse_config_file(
- const char *conf_file,
- const char *sections, /* nulstr */
- ConfigItemLookup lookup,
- const void *table,
- ConfigParseFlags flags,
- void *userdata) {
- return config_parse_config_file_full(conf_file, "systemd", sections, lookup, table, flags, userdata);
-}
-
int config_parse_many(
const char* const* conf_files, /* possibly empty */
const char* const* conf_file_dirs,
{}
};
- (void) config_parse_config_file("sleep.conf", "Sleep\0",
+ (void) config_parse_config_file("systemd/sleep.conf", "Sleep\0",
config_item_table_lookup, items,
CONFIG_PARSE_WARN, NULL);
assert(config_table);
- r = config_parse_config_file_full(
- "udev.conf",
- "udev",
+ r = config_parse_config_file(
+ "udev/udev.conf",
/* sections = */ NULL,
config_item_table_lookup,
config_table,
assert(m);
- r = config_parse_config_file("timesyncd.conf", "Time\0",
+ r = config_parse_config_file("systemd/timesyncd.conf", "Time\0",
config_item_perf_lookup, timesyncd_gperf_lookup,
CONFIG_PARSE_WARN, m);
if (r < 0)