service.h revision 8fe914ec81d9f57bcc083036f528b00119ed2e3b
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm/*-*- Mode: C; c-basic-offset: 8 -*-*/
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm This file is part of systemd.
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm Copyright 2010 Lennart Poettering
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm systemd is free software; you can redistribute it and/or modify it
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm under the terms of the GNU General Public License as published by
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm the Free Software Foundation; either version 2 of the License, or
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm (at your option) any later version.
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm systemd is distributed in the hope that it will be useful, but
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm WITHOUT ANY WARRANTY; without even the implied warranty of
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm General Public License for more details.
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm You should have received a copy of the GNU General Public License
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm along with systemd; If not, see <http://www.gnu.org/licenses/>.
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmtypedef enum ServiceState {
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_EXITED, /* Nothing is running anymore, but ValidNoProcess is true, ehnce this is OK */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_STOP, /* No STOP_PRE state, instead just register multiple STOP executables */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_FINAL_SIGTERM, /* In case the STOP_POST executable hangs, we shoot that down, too */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmtypedef enum ServiceRestart {
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmtypedef enum ServiceType {
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_SIMPLE, /* we fork and go on right-away (i.e. modern socket activated daemons) */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_FINISH, /* we fork and wait until the program finishes (i.e. programs like fsck which run and need to finish before we continue) */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_DBUS, /* we fork and wait until a specific D-Bus name appears on the bus */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm SERVICE_NOTIFY, /* we fork and wait until a daemon sends us a ready message with sd_notify() */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmtypedef enum ServiceExecCommand {
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmtypedef enum NotifyAccess {
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm /* If set we'll read the main daemon PID from this file */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gm /* If we shut down, remember why */
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmint service_set_socket_fd(Service *s, int fd, struct Socket *socket);
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmServiceRestart service_restart_from_string(const char *s);
88f8b78a88cbdc6d8c1af5c3e54bc49d25095c98gmconst char* service_exec_command_to_string(ServiceExecCommand i);