summaryrefslogtreecommitdiff
path: root/src/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit.c')
-rw-r--r--src/unit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unit.c b/src/unit.c
index b2cdd4c..1b4a603 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -176,6 +176,10 @@ int unit_load_file(const char *path, Unit *out) {
strncpy(out->broadcast_cmd, val, sizeof(out->broadcast_cmd) - 1);
else if (strcmp(last_key, "log_filter") == 0)
strncpy(out->log_filter, val, MAX_PATH - 1);
+ else if (strcmp(last_key, "log_dir") == 0)
+ strncpy(out->log_dir, val, MAX_PATH - 1);
+ else if (strcmp(last_key, "log_pattern") == 0)
+ strncpy(out->log_dir_pattern, val, MAX_PATH - 1);
break;
case SECTION_CONSOLE:
@@ -261,6 +265,13 @@ int unit_load_file(const char *path, Unit *out) {
out->name, out->console.password_env);
}
+ /* log_dir and logs: are mutually exclusive */
+ if (out->log_dir[0] && out->log_count > 0) {
+ log_warn("Unit %s: 'log_dir' and 'logs' are mutually exclusive; "
+ "ignoring 'logs'", out->name);
+ out->log_count = 0;
+ }
+
/* Allocate ring buffer */
out->output = ring_init();
if (!out->output) {