manager.h revision c2f1db8f83618e60dcded8303d14656d7d26b436
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering#pragma once
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering/***
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering This file is part of systemd.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering Copyright 2010 Lennart Poettering
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering systemd is free software; you can redistribute it and/or modify it
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering under the terms of the GNU Lesser General Public License as published by
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering (at your option) any later version.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering systemd is distributed in the hope that it will be useful, but
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering Lesser General Public License for more details.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering You should have received a copy of the GNU Lesser General Public License
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering***/
0ac38b707212e9aa40e25d65ffbae648cc9116f5Lennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering#include <stdbool.h>
0284adc6a60ce0af1107cb0b50041a65d731f39eLennart Poettering#include <inttypes.h>
cf0fbc49e67b55f8d346fc94de28c90113505297Thomas Hindoe Paaboel Andersen#include <stdio.h>
0284adc6a60ce0af1107cb0b50041a65d731f39eLennart Poettering#include <dbus/dbus.h>
cf0fbc49e67b55f8d346fc94de28c90113505297Thomas Hindoe Paaboel Andersen
cf0fbc49e67b55f8d346fc94de28c90113505297Thomas Hindoe Paaboel Andersen#include "fdset.h"
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek/* Enforce upper limit how many names we allow */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek#define MANAGER_MAX_NAMES 131072 /* 128K */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringtypedef struct Manager Manager;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringtypedef enum WatchType WatchType;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringtypedef struct Watch Watch;
3c1668da6202f1ead3d4d3981b89e9da1a0e98e3Lennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringtypedef enum ManagerExitCode {
de190aef08bb267b645205a747762df573b36834Lennart Poettering MANAGER_RUNNING,
95ea1b90cc61f464f3b9bc147119dee4ba9620b8Lennart Poettering MANAGER_EXIT,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering MANAGER_RELOAD,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering MANAGER_REEXECUTE,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering MANAGER_REBOOT,
95ea1b90cc61f464f3b9bc147119dee4ba9620b8Lennart Poettering MANAGER_POWEROFF,
95ea1b90cc61f464f3b9bc147119dee4ba9620b8Lennart Poettering MANAGER_HALT,
0ac38b707212e9aa40e25d65ffbae648cc9116f5Lennart Poettering MANAGER_KEXEC,
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering MANAGER_SWITCH_ROOT,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering _MANAGER_EXIT_CODE_MAX,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering _MANAGER_EXIT_CODE_INVALID = -1
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering} ManagerExitCode;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringtypedef enum ManagerRunningAs {
c2373f848dddcc1827cf715c5ef778dc8d475761Lennart Poettering MANAGER_SYSTEM,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering MANAGER_USER,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering _MANAGER_RUNNING_AS_MAX,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering _MANAGER_RUNNING_AS_INVALID = -1
c2373f848dddcc1827cf715c5ef778dc8d475761Lennart Poettering} ManagerRunningAs;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringenum WatchType {
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering WATCH_INVALID,
c2373f848dddcc1827cf715c5ef778dc8d475761Lennart Poettering WATCH_SIGNAL,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering WATCH_NOTIFY,
feb12d3ed2c7f9132c64773c7c41b9e3a608a814Lennart Poettering WATCH_FD,
b0af6f41ea67c97b8beb16fd1d63042379bbf103Lennart Poettering WATCH_UNIT_TIMER,
feb12d3ed2c7f9132c64773c7c41b9e3a608a814Lennart Poettering WATCH_JOB_TIMER,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering WATCH_MOUNT,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering WATCH_SWAP,
f534928ad7aaeec0bec2d653b4a50e79b0fc8418Michal Schmidt WATCH_UDEV,
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier WATCH_DBUS_WATCH,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering WATCH_DBUS_TIMEOUT
f534928ad7aaeec0bec2d653b4a50e79b0fc8418Michal Schmidt};
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringstruct Watch {
f534928ad7aaeec0bec2d653b4a50e79b0fc8418Michal Schmidt int fd;
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier WatchType type;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering union {
f534928ad7aaeec0bec2d653b4a50e79b0fc8418Michal Schmidt struct Unit *unit;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering struct Job *job;
f534928ad7aaeec0bec2d653b4a50e79b0fc8418Michal Schmidt DBusWatch *bus_watch;
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier DBusTimeout *bus_timeout;
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering } data;
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier bool fd_is_dupped:1;
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier bool socket_accept:1;
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier};
de190aef08bb267b645205a747762df573b36834Lennart Poettering
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier#include "unit.h"
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier#include "job.h"
de190aef08bb267b645205a747762df573b36834Lennart Poettering#include "hashmap.h"
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier#include "list.h"
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier#include "set.h"
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier#include "dbus.h"
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering#include "path-lookup.h"
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalierstruct Manager {
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering /* Note that the set of units we know of is allowed to be
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier * inconsistent. However the subset of it that is loaded may
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering * not, and the list of jobs may neither. */
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier /* Active jobs and units */
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering Hashmap *units; /* name string => Unit object n:1 */
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier Hashmap *jobs; /* job id => Job object 1:1 */
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering /* To make it easy to iterate through the units of a specific
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier * type we maintain a per type linked list */
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]);
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
787784c4c1b24a13207d18b415d60483cfbdeaa3Ronny Chevalier /* To optimize iteration of units that have requires_mounts_for set */
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering LIST_HEAD(Unit, has_requires_mounts_for);
7560fffcd2531786b9c1ca657667a43e90331326Lennart Poettering
7560fffcd2531786b9c1ca657667a43e90331326Lennart Poettering /* Units that need to be loaded */
0ac38b707212e9aa40e25d65ffbae648cc9116f5Lennart Poettering LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering /* Jobs that need to be run */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek LIST_HEAD(Job, run_queue); /* more a stack than a queue, too */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek /* Units and jobs that have not yet been announced via
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek * D-Bus. When something about a job changes it is added here
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek * if it is not in there yet. This allows easy coalescing of
8580d1f73db36e9383e674e388b4fb55828c0c66Lennart Poettering * D-Bus change signals. */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek LIST_HEAD(Unit, dbus_unit_queue);
c6878637502b1717a110a9a7e8bba32a8583fcdfLennart Poettering LIST_HEAD(Job, dbus_job_queue);
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek /* Units to remove */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek LIST_HEAD(Unit, cleanup_queue);
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek /* Units to check when doing GC */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek LIST_HEAD(Unit, gc_queue);
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Hashmap *watch_pids; /* pid => Unit object n:1 */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char *notify_socket;
0ac38b707212e9aa40e25d65ffbae648cc9116f5Lennart Poettering
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Watch notify_watch;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Watch signal_watch;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek int epoll_fd;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek unsigned n_snapshots;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek LookupPaths lookup_paths;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Set *unit_path_cache;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char **environment;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char **default_controllers;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek usec_t runtime_watchdog;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek usec_t shutdown_watchdog;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek dual_timestamp initrd_timestamp;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek dual_timestamp startup_timestamp;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek dual_timestamp finish_timestamp;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char *generator_unit_path;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char *generator_unit_path_early;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek char *generator_unit_path_late;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek /* Data specific to the device subsystem */
8580d1f73db36e9383e674e388b4fb55828c0c66Lennart Poettering struct udev* udev;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek struct udev_monitor* udev_monitor;
c6878637502b1717a110a9a7e8bba32a8583fcdfLennart Poettering Watch udev_watch;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Hashmap *devices_by_sysfs;
510b857f7d1e7e8d38912890536342dd5dd647ddLennart Poettering
510b857f7d1e7e8d38912890536342dd5dd647ddLennart Poettering /* Data specific to the mount subsystem */
510b857f7d1e7e8d38912890536342dd5dd647ddLennart Poettering FILE *proc_self_mountinfo;
510b857f7d1e7e8d38912890536342dd5dd647ddLennart Poettering Watch mount_watch;
510b857f7d1e7e8d38912890536342dd5dd647ddLennart Poettering
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek /* Data specific to the swap filesystem */
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek FILE *proc_swaps;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Hashmap *swaps_by_proc_swaps;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek bool request_reload;
6ad1d1c30621280bfad3e63fcc1c7ceb7d8ffa98Lennart Poettering Watch swap_watch;
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther /* Data specific to the D-Bus subsystem */
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther DBusConnection *api_bus, *system_bus;
143bfdaf0b890fa7acadf02d1eafacaef1b696bdHolger Hans Peter Freyther DBusServer *private_bus;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek Set *bus_connections, *bus_connections_for_dispatch;
6eb7a9a0010d035e5bdbbf70227088ce02b2120eZbigniew Jędrzejewski-Szmek
95ea1b90cc61f464f3b9bc147119dee4ba9620b8Lennart Poettering DBusMessage *queued_message; /* This is used during reloading:
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering * before the reload we queue the
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering * reply message here, and
* afterwards we send it */
DBusConnection *queued_message_connection; /* The connection to send the queued message on */
Hashmap *watch_bus; /* D-Bus names => Unit object n:1 */
int32_t name_data_slot;
int32_t conn_data_slot;
int32_t subscribed_data_slot;
uint32_t current_job_id;
uint32_t default_unit_job_id;
/* Data specific to the Automount subsystem */
int dev_autofs_fd;
/* Data specific to the cgroup subsystem */
Hashmap *cgroup_bondings; /* path string => CGroupBonding object 1:n */
char *cgroup_hierarchy;
usec_t gc_queue_timestamp;
int gc_marker;
unsigned n_in_gc_queue;
/* Make sure the user cannot accidentally unmount our cgroup
* file system */
int pin_cgroupfs_fd;
/* Audit fd */
#ifdef HAVE_AUDIT
int audit_fd;
#endif
/* Flags */
ManagerRunningAs running_as;
ManagerExitCode exit_code:5;
bool dispatching_load_queue:1;
bool dispatching_run_queue:1;
bool dispatching_dbus_queue:1;
bool taint_usr:1;
bool show_status;
bool confirm_spawn;
ExecOutput default_std_output, default_std_error;
struct rlimit *rlimit[RLIMIT_NLIMITS];
/* non-zero if we are reloading or reexecuting, */
int n_reloading;
unsigned n_installed_jobs;
unsigned n_failed_jobs;
/* Type=idle pipes */
int idle_pipe[2];
char *switch_root;
char *switch_root_init;
};
int manager_new(ManagerRunningAs running_as, Manager **m);
void manager_free(Manager *m);
int manager_enumerate(Manager *m);
int manager_coldplug(Manager *m);
int manager_startup(Manager *m, FILE *serialization, FDSet *fds);
Job *manager_get_job(Manager *m, uint32_t id);
Unit *manager_get_unit(Manager *m, const char *name);
int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j);
int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DBusError *e, Unit **_ret);
int manager_load_unit(Manager *m, const char *name, const char *path, DBusError *e, Unit **_ret);
int manager_load_unit_from_dbus_path(Manager *m, const char *s, DBusError *e, Unit **_u);
int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool force, DBusError *e, Job **_ret);
int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode mode, bool force, DBusError *e, Job **_ret);
void manager_dump_units(Manager *s, FILE *f, const char *prefix);
void manager_dump_jobs(Manager *s, FILE *f, const char *prefix);
void manager_clear_jobs(Manager *m);
unsigned manager_dispatch_load_queue(Manager *m);
unsigned manager_dispatch_run_queue(Manager *m);
unsigned manager_dispatch_dbus_queue(Manager *m);
int manager_set_default_controllers(Manager *m, char **controllers);
int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit);
int manager_loop(Manager *m);
void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name, const char* old_owner, const char *new_owner);
void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_t pid);
int manager_open_serialization(Manager *m, FILE **_f);
int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool serialize_jobs);
int manager_deserialize(Manager *m, FILE *f, FDSet *fds);
int manager_reload(Manager *m);
bool manager_is_booting_or_shutting_down(Manager *m);
void manager_reset_failed(Manager *m);
void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success);
void manager_send_unit_plymouth(Manager *m, Unit *u);
bool manager_unit_pending_inactive(Manager *m, const char *name);
void manager_check_finished(Manager *m);
void manager_run_generators(Manager *m);
void manager_undo_generators(Manager *m);
void manager_recheck_journal(Manager *m);
void manager_set_show_status(Manager *m, bool b);
bool manager_get_show_status(Manager *m);
const char *manager_running_as_to_string(ManagerRunningAs i);
ManagerRunningAs manager_running_as_from_string(const char *s);