1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
7 #include "common-signal.h"
11 #include "path-lookup.h"
12 #include "show-status.h"
15 struct libmnt_monitor
;
17 /* Enforce upper limit how many names we allow */
18 #define MANAGER_MAX_NAMES 131072 /* 128K */
20 /* On sigrtmin+18, private commands */
22 MANAGER_SIGNAL_COMMAND_DUMP_JOBS
= _COMMON_SIGNAL_COMMAND_PRIVATE_BASE
+ 0,
23 _MANAGER_SIGNAL_COMMAND_MAX
,
26 assert_cc((int) _MANAGER_SIGNAL_COMMAND_MAX
<= (int) _COMMON_SIGNAL_COMMAND_PRIVATE_END
);
28 /* An externally visible state. We don't actually maintain this as state variable, but derive it from various fields
30 typedef enum ManagerState
{
38 _MANAGER_STATE_INVALID
= -EINVAL
,
41 typedef enum ManagerObjective
{
52 _MANAGER_OBJECTIVE_MAX
,
53 _MANAGER_OBJECTIVE_INVALID
= -EINVAL
,
57 * 1. TIMESTAMP_FIRMWARE, TIMESTAMP_LOADER, TIMESTAMP_KERNEL, TIMESTAMP_INITRD,
58 * TIMESTAMP_SECURITY_START, and TIMESTAMP_SECURITY_FINISH are set only when
59 * the manager is system and not running under container environment.
61 * 2. The monotonic timestamp of TIMESTAMP_KERNEL is always zero.
63 * 3. The realtime timestamp of TIMESTAMP_KERNEL will be unset if the system does not
66 * 4. TIMESTAMP_FIRMWARE and TIMESTAMP_LOADER will be unset if the system does not
67 * have RTC, or systemd is built without EFI support.
69 * 5. The monotonic timestamps of TIMESTAMP_FIRMWARE and TIMESTAMP_LOADER are stored as
70 * negative of the actual value.
72 * 6. TIMESTAMP_USERSPACE is the timestamp of when the manager was started.
74 * 7. TIMESTAMP_INITRD_* are set only when the system is booted with an initrd.
77 typedef enum ManagerTimestamp
{
78 MANAGER_TIMESTAMP_FIRMWARE
,
79 MANAGER_TIMESTAMP_LOADER
,
80 MANAGER_TIMESTAMP_KERNEL
,
81 MANAGER_TIMESTAMP_INITRD
,
82 MANAGER_TIMESTAMP_USERSPACE
,
83 MANAGER_TIMESTAMP_FINISH
,
85 MANAGER_TIMESTAMP_SECURITY_START
,
86 MANAGER_TIMESTAMP_SECURITY_FINISH
,
87 MANAGER_TIMESTAMP_GENERATORS_START
,
88 MANAGER_TIMESTAMP_GENERATORS_FINISH
,
89 MANAGER_TIMESTAMP_UNITS_LOAD_START
,
90 MANAGER_TIMESTAMP_UNITS_LOAD_FINISH
,
91 MANAGER_TIMESTAMP_UNITS_LOAD
,
93 MANAGER_TIMESTAMP_INITRD_SECURITY_START
,
94 MANAGER_TIMESTAMP_INITRD_SECURITY_FINISH
,
95 MANAGER_TIMESTAMP_INITRD_GENERATORS_START
,
96 MANAGER_TIMESTAMP_INITRD_GENERATORS_FINISH
,
97 MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_START
,
98 MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_FINISH
,
100 MANAGER_TIMESTAMP_SHUTDOWN_START
,
102 _MANAGER_TIMESTAMP_MAX
,
103 _MANAGER_TIMESTAMP_INVALID
= -EINVAL
,
106 typedef enum WatchdogType
{
114 typedef enum ManagerTestRunFlags
{
115 MANAGER_TEST_NORMAL
= 0, /* run normally */
116 MANAGER_TEST_RUN_MINIMAL
= 1 << 0, /* create basic data structures */
117 MANAGER_TEST_RUN_BASIC
= 1 << 1, /* interact with the environment */
118 MANAGER_TEST_RUN_ENV_GENERATORS
= 1 << 2, /* also run env generators */
119 MANAGER_TEST_RUN_GENERATORS
= 1 << 3, /* also run unit generators */
120 MANAGER_TEST_RUN_IGNORE_DEPENDENCIES
= 1 << 4, /* run while ignoring dependencies */
121 MANAGER_TEST_DONT_OPEN_EXECUTOR
= 1 << 5, /* avoid trying to load sd-executor */
122 MANAGER_TEST_FULL
= MANAGER_TEST_RUN_BASIC
| MANAGER_TEST_RUN_ENV_GENERATORS
| MANAGER_TEST_RUN_GENERATORS
,
123 } ManagerTestRunFlags
;
125 assert_cc((MANAGER_TEST_FULL
& UINT8_MAX
) == MANAGER_TEST_FULL
);
127 /* Various defaults for unit file settings. */
128 typedef struct UnitDefaults
{
129 ExecOutput std_output
, std_error
;
131 usec_t restart_usec
, timeout_start_usec
, timeout_stop_usec
, timeout_abort_usec
, device_timeout_usec
;
132 bool timeout_abort_set
;
134 RateLimit start_limit
;
136 bool memory_accounting
;
138 bool tasks_accounting
;
141 CGroupTasksMax tasks_max
;
142 usec_t timer_accuracy_usec
;
144 OOMPolicy oom_policy
;
145 int oom_score_adjust
;
146 bool oom_score_adjust_set
;
148 CGroupPressureWatch memory_pressure_watch
;
149 usec_t memory_pressure_threshold_usec
;
151 char *smack_process_label
;
153 struct rlimit
*rlimit
[_RLIMIT_MAX
];
156 typedef struct Manager
{
157 /* Note that the set of units we know of is allowed to be
158 * inconsistent. However the subset of it that is loaded may
159 * not, and the list of jobs may neither. */
161 /* Active jobs and units */
162 Hashmap
*units
; /* name string => Unit object n:1 */
163 Hashmap
*units_by_invocation_id
;
164 Hashmap
*jobs
; /* job id => Job object 1:1 */
166 /* To make it easy to iterate through the units of a specific
167 * type we maintain a per type linked list */
168 LIST_HEAD(Unit
, units_by_type
[_UNIT_TYPE_MAX
]);
170 /* Units that need to be loaded */
171 LIST_HEAD(Unit
, load_queue
); /* this is actually more a stack than a queue, but uh. */
173 /* Jobs that need to be run */
174 struct Prioq
*run_queue
;
176 /* Units and jobs that have not yet been announced via
177 * D-Bus. When something about a job changes it is added here
178 * if it is not in there yet. This allows easy coalescing of
179 * D-Bus change signals. */
180 LIST_HEAD(Unit
, dbus_unit_queue
);
181 LIST_HEAD(Job
, dbus_job_queue
);
183 /* Units to remove */
184 LIST_HEAD(Unit
, cleanup_queue
);
186 /* Units and jobs to check when doing GC */
187 LIST_HEAD(Unit
, gc_unit_queue
);
188 LIST_HEAD(Job
, gc_job_queue
);
190 /* Units that should be realized */
191 LIST_HEAD(Unit
, cgroup_realize_queue
);
193 /* Units whose cgroup ran empty */
194 LIST_HEAD(Unit
, cgroup_empty_queue
);
196 /* Units whose memory.event fired */
197 LIST_HEAD(Unit
, cgroup_oom_queue
);
199 /* Target units whose default target dependencies haven't been set yet */
200 LIST_HEAD(Unit
, target_deps_queue
);
202 /* Units that might be subject to StopWhenUnneeded= clean-up */
203 LIST_HEAD(Unit
, stop_when_unneeded_queue
);
205 /* Units which are upheld by another other which we might need to act on */
206 LIST_HEAD(Unit
, start_when_upheld_queue
);
208 /* Units that have BindsTo= another unit, and might need to be shutdown because the bound unit is not active. */
209 LIST_HEAD(Unit
, stop_when_bound_queue
);
211 /* Units that have resources open, and where it might be good to check if they can be released now */
212 LIST_HEAD(Unit
, release_resources_queue
);
214 /* Units that perform certain actions after some other unit deactivates */
215 LIST_HEAD(Unit
, stop_notify_queue
);
219 /* This maps PIDs we care about to units that are interested in them. We allow multiple units to be
220 * interested in the same PID and multiple PIDs to be relevant to the same unit. Since in most cases
221 * only a single unit will be interested in the same PID though, we use a somewhat special structure
222 * here: the first unit interested in a PID is stored in the hashmap 'watch_pids', keyed by the
223 * PID. If there are other units interested too they'll be stored in a NULL-terminated array, stored
224 * in the hashmap 'watch_pids_more', keyed by the PID. Thus to go through the full list of units
225 * interested in a PID we must look into both hashmaps.
227 * NB: the ownership of PidRefs is held by Unit.pids! */
228 Hashmap
*watch_pids
; /* PidRef* → Unit* */
229 Hashmap
*watch_pids_more
; /* PidRef* → NUL terminated array of Unit* */
231 /* A set contains all units which cgroup should be refreshed after startup */
234 /* A set which contains all currently failed units */
237 sd_event_source
*run_queue_event_source
;
241 sd_event_source
*notify_event_source
;
244 sd_event_source
*signal_event_source
;
246 sd_event_source
*sigchld_event_source
;
248 sd_event_source
*time_change_event_source
;
250 sd_event_source
*timezone_change_event_source
;
252 sd_event_source
*jobs_in_progress_event_source
;
254 int user_lookup_fds
[2];
255 sd_event_source
*user_lookup_event_source
;
257 int handoff_timestamp_fds
[2];
258 sd_event_source
*handoff_timestamp_event_source
;
260 int pidref_transport_fds
[2];
261 sd_event_source
*pidref_event_source
;
263 RuntimeScope runtime_scope
;
265 LookupPaths lookup_paths
;
266 Hashmap
*unit_id_map
;
267 Hashmap
*unit_name_map
;
268 Set
*unit_path_cache
;
269 uint64_t unit_cache_timestamp_hash
;
271 /* We don't have support for atomically enabling/disabling units, and unit_file_state might become
272 * outdated if such operations failed half-way. Therefore, we set this flag if changes to unit files
273 * are made, and reset it after daemon-reload. If set, we report that daemon-reload is needed through
274 * unit's NeedDaemonReload property. */
275 bool unit_file_state_outdated
;
277 char **transient_environment
; /* The environment, as determined from config files, kernel cmdline and environment generators */
278 char **client_environment
; /* Environment variables created by clients through the bus API */
280 usec_t watchdog
[_WATCHDOG_TYPE_MAX
];
281 usec_t watchdog_overridden
[_WATCHDOG_TYPE_MAX
];
282 char *watchdog_pretimeout_governor
;
283 char *watchdog_pretimeout_governor_overridden
;
285 dual_timestamp timestamps
[_MANAGER_TIMESTAMP_MAX
];
287 /* Data specific to the device subsystem */
288 sd_device_monitor
*device_monitor
;
289 Hashmap
*devices_by_sysfs
;
291 /* Data specific to the mount subsystem */
292 struct libmnt_monitor
*mount_monitor
;
293 sd_event_source
*mount_event_source
;
295 /* Data specific to the swap filesystem */
297 sd_event_source
*swap_event_source
;
298 Hashmap
*swaps_by_devnode
;
300 /* Data specific to the D-Bus subsystem */
301 sd_bus
*api_bus
, *system_bus
;
303 int private_listen_fd
;
304 sd_event_source
*private_listen_event_source
;
306 /* Contains all the clients that are subscribed to signals via the API bus. Note that private bus
307 * connections are always considered subscribes, since they last for very short only, and it is
308 * much simpler that way. */
309 sd_bus_track
*subscribed
;
310 char **subscribed_as_strv
;
312 /* The bus id of API bus acquired through org.freedesktop.DBus.GetId, which before deserializing
313 * subscriptions we'd use to verify the bus is still the same instance as before. */
314 sd_id128_t bus_id
, deserialized_bus_id
;
316 /* This is used during reloading: before the reload we queue
317 * the reply message here, and afterwards we send it */
318 sd_bus_message
*pending_reload_message
;
320 Hashmap
*watch_bus
; /* D-Bus names => Unit object n:1 */
322 bool send_reloading_done
;
324 uint32_t current_job_id
;
325 uint32_t default_unit_job_id
;
327 /* Data specific to the Automount subsystem */
330 /* Data specific to the cgroup subsystem */
331 Hashmap
*cgroup_unit
;
332 CGroupMask cgroup_supported
;
335 /* Notifications from cgroups, when the unified hierarchy is used is done via inotify. */
336 int cgroup_inotify_fd
;
337 sd_event_source
*cgroup_inotify_event_source
;
339 /* Maps for finding the unit for each inotify watch descriptor for the cgroup.events and
340 * memory.events cgroupv2 attributes. */
341 Hashmap
*cgroup_control_inotify_wd_unit
;
342 Hashmap
*cgroup_memory_inotify_wd_unit
;
344 /* A defer event for handling cgroup empty events and processing them after SIGCHLD in all cases. */
345 sd_event_source
*cgroup_empty_event_source
;
346 sd_event_source
*cgroup_oom_event_source
;
348 /* Make sure the user cannot accidentally unmount our cgroup
354 /* The stat() data the last time we saw /etc/localtime */
355 usec_t etc_localtime_mtime
;
356 bool etc_localtime_accessible
;
358 ManagerObjective objective
;
359 /* Objective as it was before serialization, mostly to detect soft-reboots */
360 ManagerObjective previous_objective
;
363 bool dispatching_load_queue
;
364 int may_dispatch_stop_notify_queue
; /* tristate */
366 /* Have we already sent out the READY=1 notification? */
369 /* Was the last status sent "STATUS=Ready."? */
372 /* Have we already printed the taint line if necessary? */
375 /* Have we ever changed the "kernel.pid_max" sysctl? */
376 bool sysctl_pid_max_changed
;
378 ManagerTestRunFlags test_run_flags
;
380 /* If non-zero, exit with the following value when the systemd
381 * process terminate. Useful for containers: systemd-nspawn could get
382 * the return value. */
383 uint8_t return_value
;
385 ShowStatus show_status
;
386 ShowStatus show_status_overridden
;
387 StatusUnitFormat status_unit_format
;
389 bool no_console_output
;
390 bool service_watchdogs
;
392 UnitDefaults defaults
;
394 int original_log_level
;
395 LogTarget original_log_target
;
396 bool log_level_overridden
;
397 bool log_target_overridden
;
399 /* non-zero if we are reloading or reexecuting, */
402 unsigned n_installed_jobs
;
403 unsigned n_failed_jobs
;
405 /* Jobs in progress watching */
406 unsigned n_running_jobs
;
407 unsigned n_on_console
;
408 unsigned jobs_in_progress_iteration
;
410 /* Do we have any outstanding password prompts? */
411 int have_ask_password
;
412 sd_event_source
*ask_password_event_source
;
414 /* Type=idle pipes */
416 sd_event_source
*idle_pipe_event_source
;
419 char *switch_root_init
;
421 /* This is true before and after switching root. */
424 /* These map all possible path prefixes to the units needing them. They are hashmaps with a path
425 * string as key, and a Set as value where Unit objects are contained. */
426 Hashmap
*units_needing_mounts_for
[_UNIT_MOUNT_DEPENDENCY_TYPE_MAX
];
428 /* Used for processing polkit authorization responses */
429 Hashmap
*polkit_registry
;
431 /* Dynamic users/groups, indexed by their name */
432 Hashmap
*dynamic_users
;
434 /* Keep track of all UIDs and GIDs any of our services currently use. This is useful for the RemoveIPC= logic. */
438 /* ExecSharedRuntime, indexed by their owner unit id */
439 Hashmap
*exec_shared_runtime_by_id
;
441 /* When the user hits C-A-D more than 7 times per 2s, do something immediately... */
442 RateLimit ctrl_alt_del_ratelimit
;
443 EmergencyAction cad_burst_action
;
445 int first_boot
; /* tri-state */
447 /* Prefixes of e.g. RuntimeDirectory= */
448 char *prefix
[_EXEC_DIRECTORY_TYPE_MAX
];
449 char *received_credentials_directory
;
450 char *received_encrypted_credentials_directory
;
452 /* Used in the SIGCHLD and sd_notify() message invocation logic to avoid that we dispatch the same event
453 * multiple times on the same unit. */
457 sd_varlink_server
*varlink_server
;
458 /* When we're a system manager, this object manages the subscription from systemd-oomd to PID1 that's
459 * used to report changes in ManagedOOM settings (systemd server - oomd client). When
460 * we're a user manager, this object manages the client connection from the user manager to
461 * systemd-oomd to report changes in ManagedOOM settings (systemd client - oomd server). */
462 sd_varlink
*managed_oom_varlink
;
464 /* Reference to RestrictFileSystems= BPF program */
465 struct restrict_fs_bpf
*restrict_fs
;
467 /* Allow users to configure a rate limit for Reload()/Reexecute() operations */
468 RateLimit reload_reexec_ratelimit
;
469 /* Dump*() are slow, so always rate limit them to 10 per 10 minutes */
470 RateLimit dump_ratelimit
;
472 sd_event_source
*memory_pressure_event_source
;
475 FirewallContext
*fw_ctx
;
477 /* Pin the systemd-executor binary, so that it never changes until re-exec, ensuring we don't have
478 * serialization/deserialization compatibility issues during upgrades. */
482 unsigned soft_reboots_count
;
484 /* Original ambient capabilities when we were initialized */
485 uint64_t saved_ambient_set
;
488 static inline usec_t
manager_default_timeout_abort_usec(Manager
*m
) {
490 return m
->defaults
.timeout_abort_set
? m
->defaults
.timeout_abort_usec
: m
->defaults
.timeout_stop_usec
;
493 #define MANAGER_IS_SYSTEM(m) ((m)->runtime_scope == RUNTIME_SCOPE_SYSTEM)
494 #define MANAGER_IS_USER(m) ((m)->runtime_scope == RUNTIME_SCOPE_USER)
496 #define MANAGER_IS_RELOADING(m) ((m)->n_reloading > 0)
498 #define MANAGER_IS_FINISHED(m) (dual_timestamp_is_set((m)->timestamps + MANAGER_TIMESTAMP_FINISH))
500 /* The objective is set to OK as soon as we enter the main loop, and set otherwise as soon as we are done with it */
501 #define MANAGER_IS_RUNNING(m) ((m)->objective == MANAGER_OK)
503 #define MANAGER_IS_SWITCHING_ROOT(m) ((m)->switching_root)
505 #define MANAGER_IS_TEST_RUN(m) ((m)->test_run_flags != 0)
507 usec_t
manager_default_timeout(RuntimeScope scope
);
509 int manager_new(RuntimeScope scope
, ManagerTestRunFlags test_run_flags
, Manager
**m
);
510 Manager
* manager_free(Manager
*m
);
511 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager
*, manager_free
);
513 int manager_startup(Manager
*m
, FILE *serialization
, FDSet
*fds
, const char *root
);
515 Job
*manager_get_job(Manager
*m
, uint32_t id
);
516 Unit
*manager_get_unit(Manager
*m
, const char *name
);
518 int manager_get_job_from_dbus_path(Manager
*m
, const char *s
, Job
**_j
);
520 bool manager_unit_cache_should_retry_load(Unit
*u
);
521 int manager_load_unit_prepare(Manager
*m
, const char *name
, const char *path
, sd_bus_error
*e
, Unit
**ret
);
522 int manager_load_unit(Manager
*m
, const char *name
, const char *path
, sd_bus_error
*e
, Unit
**ret
);
523 int manager_load_startable_unit_or_warn(Manager
*m
, const char *name
, const char *path
, Unit
**ret
);
524 int manager_load_unit_from_dbus_path(Manager
*m
, const char *s
, sd_bus_error
*e
, Unit
**_u
);
526 int manager_add_job_full(
531 TransactionAddFlags extra_flags
,
543 int manager_add_job_by_name(Manager
*m
, JobType type
, const char *name
, JobMode mode
, Set
*affected_jobs
, sd_bus_error
*e
, Job
**ret
);
544 int manager_add_job_by_name_and_warn(Manager
*m
, JobType type
, const char *name
, JobMode mode
, Set
*affected_jobs
, Job
**ret
);
545 int manager_propagate_reload(Manager
*m
, Unit
*unit
, JobMode mode
, sd_bus_error
*e
);
547 void manager_clear_jobs(Manager
*m
);
549 void manager_unwatch_pidref(Manager
*m
, const PidRef
*pid
);
551 unsigned manager_dispatch_load_queue(Manager
*m
);
553 int manager_setup_memory_pressure_event_source(Manager
*m
);
555 int manager_default_environment(Manager
*m
);
556 int manager_transient_environment_add(Manager
*m
, char **plus
);
557 int manager_client_environment_modify(Manager
*m
, char **minus
, char **plus
);
558 int manager_get_effective_environment(Manager
*m
, char ***ret
);
560 int manager_set_unit_defaults(Manager
*m
, const UnitDefaults
*defaults
);
562 void manager_trigger_run_queue(Manager
*m
);
564 int manager_loop(Manager
*m
);
566 int manager_reload(Manager
*m
);
567 Manager
* manager_reloading_start(Manager
*m
);
568 void manager_reloading_stopp(Manager
**m
);
570 void manager_reset_failed(Manager
*m
);
572 void manager_send_unit_audit(Manager
*m
, Unit
*u
, int type
, bool success
);
573 void manager_send_unit_plymouth(Manager
*m
, Unit
*u
);
574 void manager_send_unit_supervisor(Manager
*m
, Unit
*u
, bool active
);
576 bool manager_unit_inactive_or_pending(Manager
*m
, const char *name
);
578 void manager_check_finished(Manager
*m
);
579 void manager_send_reloading(Manager
*m
);
581 void disable_printk_ratelimit(void);
582 void manager_recheck_dbus(Manager
*m
);
583 void manager_recheck_journal(Manager
*m
);
585 bool manager_get_show_status_on(Manager
*m
);
586 void manager_set_show_status(Manager
*m
, ShowStatus mode
, const char *reason
);
587 void manager_override_show_status(Manager
*m
, ShowStatus mode
, const char *reason
);
589 void manager_set_first_boot(Manager
*m
, bool b
);
590 void manager_set_switching_root(Manager
*m
, bool switching_root
);
592 double manager_get_progress(Manager
*m
);
594 void manager_status_printf(Manager
*m
, StatusType type
, const char *status
, const char *format
, ...) _printf_(4,5);
596 Set
* manager_get_units_needing_mounts_for(Manager
*m
, const char *path
, UnitMountDependencyType t
);
598 ManagerState
manager_state(Manager
*m
);
600 int manager_update_failed_units(Manager
*m
, Unit
*u
, bool failed
);
602 void manager_unref_uid(Manager
*m
, uid_t uid
, bool destroy_now
);
603 int manager_ref_uid(Manager
*m
, uid_t uid
, bool clean_ipc
);
605 void manager_unref_gid(Manager
*m
, gid_t gid
, bool destroy_now
);
606 int manager_ref_gid(Manager
*m
, gid_t gid
, bool clean_ipc
);
608 void manager_ref_console(Manager
*m
);
609 void manager_unref_console(Manager
*m
);
611 void manager_override_log_level(Manager
*m
, int level
);
612 void manager_restore_original_log_level(Manager
*m
);
614 void manager_override_log_target(Manager
*m
, LogTarget target
);
615 void manager_restore_original_log_target(Manager
*m
);
617 const char* manager_get_confirm_spawn(Manager
*m
);
618 void manager_disable_confirm_spawn(void);
620 const char* manager_state_to_string(ManagerState m
) _const_
;
621 ManagerState
manager_state_from_string(const char *s
) _pure_
;
623 const char* manager_objective_to_string(ManagerObjective m
) _const_
;
624 ManagerObjective
manager_objective_from_string(const char *s
) _pure_
;
626 const char* manager_timestamp_to_string(ManagerTimestamp m
) _const_
;
627 ManagerTimestamp
manager_timestamp_from_string(const char *s
) _pure_
;
628 ManagerTimestamp
manager_timestamp_initrd_mangle(ManagerTimestamp s
);
630 usec_t
manager_get_watchdog(Manager
*m
, WatchdogType t
);
631 void manager_set_watchdog(Manager
*m
, WatchdogType t
, usec_t timeout
);
632 void manager_override_watchdog(Manager
*m
, WatchdogType t
, usec_t timeout
);
633 int manager_set_watchdog_pretimeout_governor(Manager
*m
, const char *governor
);
634 int manager_override_watchdog_pretimeout_governor(Manager
*m
, const char *governor
);
636 LogTarget
manager_get_executor_log_target(Manager
*m
);
638 int manager_allocate_idle_pipe(Manager
*m
);
640 void unit_defaults_init(UnitDefaults
*defaults
, RuntimeScope scope
);
641 void unit_defaults_done(UnitDefaults
*defaults
);
644 /* most important … */
645 EVENT_PRIORITY_USER_LOOKUP
= SD_EVENT_PRIORITY_NORMAL
-12,
646 EVENT_PRIORITY_MOUNT_TABLE
= SD_EVENT_PRIORITY_NORMAL
-11,
647 EVENT_PRIORITY_SWAP_TABLE
= SD_EVENT_PRIORITY_NORMAL
-11,
648 EVENT_PRIORITY_CGROUP_INOTIFY
= SD_EVENT_PRIORITY_NORMAL
-10,
649 EVENT_PRIORITY_CGROUP_OOM
= SD_EVENT_PRIORITY_NORMAL
-9,
650 EVENT_PRIORITY_PIDREF
= SD_EVENT_PRIORITY_NORMAL
-8,
651 EVENT_PRIORITY_HANDOFF_TIMESTAMP
= SD_EVENT_PRIORITY_NORMAL
-7,
652 EVENT_PRIORITY_EXEC_FD
= SD_EVENT_PRIORITY_NORMAL
-6,
653 EVENT_PRIORITY_NOTIFY
= SD_EVENT_PRIORITY_NORMAL
-5,
654 EVENT_PRIORITY_SIGCHLD
= SD_EVENT_PRIORITY_NORMAL
-4,
655 EVENT_PRIORITY_SIGNALS
= SD_EVENT_PRIORITY_NORMAL
-3,
656 EVENT_PRIORITY_CGROUP_EMPTY
= SD_EVENT_PRIORITY_NORMAL
-2,
657 EVENT_PRIORITY_TIME_CHANGE
= SD_EVENT_PRIORITY_NORMAL
-1,
658 EVENT_PRIORITY_TIME_ZONE
= SD_EVENT_PRIORITY_NORMAL
-1,
659 EVENT_PRIORITY_IPC
= SD_EVENT_PRIORITY_NORMAL
,
660 EVENT_PRIORITY_SERVICE_WATCHDOG
= SD_EVENT_PRIORITY_IDLE
,
661 EVENT_PRIORITY_RUN_QUEUE
= SD_EVENT_PRIORITY_IDLE
+1,
662 /* … to least important */