pid1: improve message when setting up namespace fails

I covered the most obvious paths: those where there's a clear problem
with a path specified by the user.

Prints something like this (at error level):
May 21 20:00:01.040418 systemd[125871]: bad-workdir.service: Failed to set up mount namespacing: /run/systemd/unit-root/etc/tomcat9/Catalina: No such file or directory
May 21 20:00:01.040456 systemd[125871]: bad-workdir.service: Failed at step NAMESPACE spawning /bin/true: No such file or directory

Fixes #10972.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-05-22 16:28:02 +02:00
parent 35b966ca23
commit 7cc5ef5f18
4 changed files with 29 additions and 10 deletions
+2 -1
View File
@@ -75,7 +75,8 @@ int main(int argc, char *argv[]) {
PROTECT_HOME_NO,
PROTECT_SYSTEM_NO,
0,
0);
0,
NULL);
if (r < 0) {
log_error_errno(r, "Failed to setup namespace: %m");