summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c2
-rw-r--r--src/nspawn/nspawn.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 34d40c6950..f4919bb2b1 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1879,7 +1879,7 @@ static int service_spawn_internal(
}
}
- if (s->restart_mode == SERVICE_RESTART_MODE_DEBUG && UNIT(s)->debug_invocation) {
+ if (UNIT(s)->debug_invocation) {
char *t = strdup("DEBUG_INVOCATION=1");
if (!t)
return -ENOMEM;
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 91700d9282..500725d35f 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -5772,7 +5772,7 @@ static int run_container(
r = wait_for_container(TAKE_PID(*pid), &container_status);
/* Tell machined that we are gone. */
- if (bus)
+ if (arg_register && bus)
(void) unregister_machine(bus, arg_machine);
if (r < 0)
@@ -6200,9 +6200,12 @@ static int run(int argc, char *argv[]) {
goto finish;
}
- if (access_nofollow(p, F_OK) < 0) {
- r = log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "Directory %s doesn't look like it has an OS tree (/usr/ directory is missing). Refusing.", arg_directory);
+ r = access_nofollow(p, F_OK);
+ if (r == -ENOENT) {
+ log_error_errno(r, "Directory %s doesn't look like it has an OS tree (/usr/ directory is missing). Refusing.", arg_directory);
+ goto finish;
+ } else if (r < 0) {
+ log_error_errno(r, "Unable to determine if %s looks like it has an OS tree (i.e. whether /usr/ exists): %m", arg_directory);
goto finish;
}
}