1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
6 typedef struct Service Service;
11 typedef enum ServiceState {
18 SERVICE_STOP, /* No STOP_PRE state, instead just register multiple STOP executables */
22 SERVICE_FINAL_SIGTERM, /* In case the STOP_POST executable hangs, we shoot that down, too */
23 SERVICE_FINAL_SIGKILL,
29 typedef enum ServiceRestart {
31 SERVICE_RESTART_ON_SUCCESS,
32 SERVICE_RESTART_ALWAYS
35 typedef enum ServiceType {
40 typedef enum ServiceExecCommand {
41 SERVICE_EXEC_START_PRE,
43 SERVICE_EXEC_START_POST,
46 SERVICE_EXEC_STOP_POST,
54 ServiceRestart restart;
56 /* If set we'll read the main daemon PID from this file */
62 ExecCommand* exec_command[_SERVICE_EXEC_MAX];
63 ExecContext exec_context;
67 ExecStatus main_exec_status;
69 ExecCommand *control_command;
70 pid_t main_pid, control_pid;
71 bool main_pid_known:1;
73 bool failure:1; /* if we shut down, remember why */
79 const UnitVTable service_vtable;