test: Don't allocate scope if already running in unit with delegated cgroup
If we're already running in a unit with delegation turned on, let's skip allocation of a scope unit and cgroup subroot. This allows journald to correctly attribute the logs of all subprocesses spawned by tests such as test-execute to the test-execute service when the test is running in a service.
This commit is contained in:
+1
-1
@@ -256,7 +256,7 @@ fail:
|
||||
return r;
|
||||
}
|
||||
|
||||
static bool stderr_is_journal(void) {
|
||||
bool stderr_is_journal(void) {
|
||||
_cleanup_free_ char *w = NULL;
|
||||
const char *e;
|
||||
uint64_t dev, ino;
|
||||
|
||||
@@ -85,6 +85,7 @@ int log_show_tid_from_string(const char *e);
|
||||
assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
|
||||
#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
|
||||
|
||||
bool stderr_is_journal(void);
|
||||
int log_open(void);
|
||||
void log_close(void);
|
||||
void log_forget_fds(void);
|
||||
|
||||
Reference in New Issue
Block a user