1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
6 typedef struct Service Service
;
10 typedef enum ServiceState
{
17 SERVICE_STOP
, /* No STOP_PRE state, instead just register multiple STOP executables */
21 SERVICE_FINAL_SIGTERM
, /* In case the STOP_POST executable hangs, we shoot that down, too */
22 SERVICE_FINAL_SIGKILL
,
28 typedef enum ServiceRestart
{
30 SERVICE_RESTART_ON_SUCCESS
,
31 SERVICE_RESTART_ALWAYS
34 typedef enum ServiceType
{
39 typedef enum ServiceExecCommand
{
40 SERVICE_EXEC_START_PRE
,
42 SERVICE_EXEC_START_POST
,
45 SERVICE_EXEC_STOP_POST
,
53 ServiceRestart restart
;
55 /* If set we'll read the main daemon PID from this file */
61 ExecCommand
* exec_command
[_SERVICE_EXEC_MAX
];
62 ExecContext exec_context
;
66 ExecStatus main_exec_status
;
68 ExecCommand
*control_command
;
69 pid_t main_pid
, control_pid
;
70 bool main_pid_known
:1;
72 bool failure
:1; /* if we shut down, remember why */
76 const UnitVTable service_vtable
;