X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fservice.h;h=6c1612d0f5abb53c43a8010a6bf901537e244269;hp=40bd57e256a4a4ef0295a5c610fb276d4725a9a3;hb=ad678a066b4ba5d8914dd7d5a4093572841205cf;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/service.h b/src/service.h index 40bd57e25..6c1612d0f 100644 --- a/src/service.h +++ b/src/service.h @@ -41,7 +41,7 @@ typedef enum ServiceState { SERVICE_STOP_POST, SERVICE_FINAL_SIGTERM, /* In case the STOP_POST executable hangs, we shoot that down, too */ SERVICE_FINAL_SIGKILL, - SERVICE_MAINTAINANCE, + SERVICE_MAINTENANCE, SERVICE_AUTO_RESTART, _SERVICE_STATE_MAX, _SERVICE_STATE_INVALID = -1 @@ -56,10 +56,11 @@ typedef enum ServiceRestart { } ServiceRestart; typedef enum ServiceType { - SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */ SERVICE_SIMPLE, /* we fork and go on right-away (i.e. modern socket activated daemons) */ + SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */ SERVICE_FINISH, /* we fork and wait until the program finishes (i.e. programs like fsck which run and need to finish before we continue) */ SERVICE_DBUS, /* we fork and wait until a specific D-Bus name appears on the bus */ + SERVICE_NOTIFY, /* we fork and wait until a daemon sends us a ready message with sd_notify() */ _SERVICE_TYPE_MAX, _SERVICE_TYPE_INVALID = -1 } ServiceType; @@ -75,12 +76,22 @@ typedef enum ServiceExecCommand { _SERVICE_EXEC_COMMAND_INVALID = -1 } ServiceExecCommand; +typedef enum NotifyAccess { + NOTIFY_NONE, + NOTIFY_ALL, + NOTIFY_MAIN, + _NOTIFY_ACCESS_MAX, + _NOTIFY_ACCESS_INVALID = -1 +} NotifyAccess; + struct Service { Meta meta; ServiceType type; ServiceRestart restart; + NotifyAccess notify_access; + /* If set we'll read the main daemon PID from this file */ char *pid_file; @@ -121,16 +132,19 @@ struct Service { char *bus_name; + char *status_text; + RateLimit ratelimit; int socket_fd; + struct Socket *socket; Watch timer_watch; }; extern const UnitVTable service_vtable; -int service_set_socket_fd(Service *s, int fd); +int service_set_socket_fd(Service *s, int fd, struct Socket *socket); const char* service_state_to_string(ServiceState i); ServiceState service_state_from_string(const char *s); @@ -144,4 +158,7 @@ ServiceType service_type_from_string(const char *s); const char* service_exec_command_to_string(ServiceExecCommand i); ServiceExecCommand service_exec_command_from_string(const char *s); +const char* notify_access_to_string(NotifyAccess i); +NotifyAccess notify_access_from_string(const char *s); + #endif