Add truncate: to StandardOutput= etc.

This adds the ability to specify truncate:PATH for StandardOutput= and
StandardError=, similar to the existing append:PATH. The code is mostly
copied from the related append: code. Fixes #8983.
This commit is contained in:
Lucas Werkmeister
2021-01-15 09:54:50 +01:00
committed by Lennart Poettering
parent e2ebc406ac
commit 8d7dab1fda
9 changed files with 80 additions and 14 deletions
+5
View File
@@ -811,6 +811,10 @@ static void test_exec_standardoutput_append(Manager *m) {
test(m, "exec-standardoutput-append.service", 0, CLD_EXITED);
}
static void test_exec_standardoutput_truncate(Manager *m) {
test(m, "exec-standardoutput-truncate.service", 0, CLD_EXITED);
}
static void test_exec_condition(Manager *m) {
test_service(m, "exec-condition-failed.service", SERVICE_FAILURE_EXIT_CODE);
test_service(m, "exec-condition-skip.service", SERVICE_SKIP_CONDITION);
@@ -876,6 +880,7 @@ int main(int argc, char *argv[]) {
entry(test_exec_standardinput),
entry(test_exec_standardoutput),
entry(test_exec_standardoutput_append),
entry(test_exec_standardoutput_truncate),
entry(test_exec_supplementarygroups),
entry(test_exec_systemcallerrornumber),
entry(test_exec_systemcallfilter),