diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-07-29 00:45:39 +0200 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-07-29 00:45:39 +0200 |
commit | d335c1e2b5b765a8586c90fbf6a89ec8eb03963e (patch) | |
tree | c458bbd9a3c4c13f1bda0ab91a2983f2b6f30ebc | |
parent | bde609206c312911958a06be4b418a9daf87884f (diff) |
openrc-run: print proper errors when exclusive_fd failsorigin/proper-errors
-rw-r--r-- | src/openrc-run/openrc-run.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/openrc-run/openrc-run.c b/src/openrc-run/openrc-run.c index de653ea7..d4a2715a 100644 --- a/src/openrc-run/openrc-run.c +++ b/src/openrc-run/openrc-run.c @@ -588,8 +588,10 @@ svc_start_check(void) if (exclusive_fd == -1) { if (state & RC_SERVICE_STOPPING) ewarnx("WARNING: %s is stopping", applet); - else + else if (state & RC_SERVICE_STARTING) ewarnx("WARNING: %s is already starting", applet); + else + eerrorx("%s: %s", applet, strerror(errno)); } fcntl(exclusive_fd, F_SETFD, fcntl(exclusive_fd, F_GETFD, 0) | FD_CLOEXEC); @@ -838,7 +840,10 @@ svc_stop_check(RC_SERVICE *state) if (exclusive_fd == -1) { if (*state & RC_SERVICE_STOPPING) ewarnx("WARNING: %s is already stopping", applet); - eerrorx("ERROR: %s stopped by something else", applet); + else if (errno == EACCES) + eerrorx("%s: %s", applet, strerror(errno)); + else + eerrorx("ERROR: %s stopped by something else", applet); } fcntl(exclusive_fd, F_SETFD, fcntl(exclusive_fd, F_GETFD, 0) | FD_CLOEXEC); |