init: Log requested exits
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3e174337ab
commit
4becb2e427
@ -25,18 +25,6 @@ static bool g_is_system = false;
|
|||||||
|
|
||||||
FILE* g_init_log = nullptr;
|
FILE* g_init_log = nullptr;
|
||||||
|
|
||||||
// Request a successful exit from the system (for tests)
|
|
||||||
void sigterm_handler(int)
|
|
||||||
{
|
|
||||||
_exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Request a failure exit from the system (for tests)
|
|
||||||
void sigquit_handler(int)
|
|
||||||
{
|
|
||||||
_exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Service
|
struct Service
|
||||||
{
|
{
|
||||||
String name;
|
String name;
|
||||||
@ -64,6 +52,20 @@ static void do_log(const char* format, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Request a successful exit from the system (for tests)
|
||||||
|
void sigterm_handler(int)
|
||||||
|
{
|
||||||
|
do_log("[init] successful exit requested, complying\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Request a failure exit from the system (for tests)
|
||||||
|
void sigquit_handler(int)
|
||||||
|
{
|
||||||
|
do_log("[init] failure exit requested, complying\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
static Result<void> service_child(const Service& service, SharedPtr<os::File> output, SharedPtr<os::File> error,
|
static Result<void> service_child(const Service& service, SharedPtr<os::File> output, SharedPtr<os::File> error,
|
||||||
SharedPtr<os::File> input)
|
SharedPtr<os::File> input)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user