show error message when exec fails during service startup

This commit is contained in:
Ivan Djelic 2008-11-23 22:26:39 +01:00 committed by Brian Swetland
parent 5bb44c8ea2
commit 165de92bf1
1 changed files with 3 additions and 1 deletions

View File

@ -253,7 +253,9 @@ void service_start(struct service *svc)
setuid(svc->uid);
}
execve(svc->args[0], (char**) svc->args, (char**) ENV);
if (execve(svc->args[0], (char**) svc->args, (char**) ENV) < 0) {
ERROR("cannot execve('%s'): %s\n", svc->args[0], strerror(errno));
}
_exit(127);
}