Systemd/src/shared
Lennart Poettering 36c16a7cdd core: rework unit timeout handling, and add new setting RuntimeMaxSec=
This clean-ups timeout handling in PID 1. Specifically, instead of storing 0 in internal timeout variables as
indication for a disabled timeout, use USEC_INFINITY which is in-line with how we do this in the rest of our code
(following the logic that 0 means "no", and USEC_INFINITY means "never").

This also replace all usec_t additions with invocations to usec_add(), so that USEC_INFINITY is properly propagated,
and sd-event considers it has indication for turning off the event source.

This also alters the deserialization of the units to restart timeouts from the time they were originally started from.
Before this patch timeouts would be restarted beginning with the time of the deserialization, which could lead to
artificially prolonged timeouts if a daemon reload took place.

Finally, a new RuntimeMaxSec= setting is introduced for service units, that specifies a maximum runtime after which a
specific service is forcibly terminated. This is useful to put time limits on time-intensive processing jobs.

This also simplifies the various xyz_spawn() calls of the various types in that explicit distruction of the timers is
removed, as that is done anyway by the state change handlers, and a state change is always done when the xyz_spawn()
calls fail.

Fixes: #2249
2016-02-01 22:18:16 +01:00
..
linux build-sys: split internal basic/ library from shared/ 2015-06-11 10:52:46 +02:00
acl-util.c acl-util: only set the mask if not present 2015-11-28 18:48:03 -05:00
acl-util.h journal: move the gist of server_fix_perms to acl-util.[hc] 2015-11-27 23:32:32 -05:00
acpi-fpdt.c shared: include what we use 2015-12-06 13:49:33 +01:00
acpi-fpdt.h
apparmor-util.c shared: include what we use 2015-12-06 13:49:33 +01:00
apparmor-util.h mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention 2014-10-23 17:34:30 +02:00
architecture.c shared: include what we use 2015-12-06 13:49:33 +01:00
architecture.h shared: include what we use 2015-12-06 13:49:33 +01:00
ask-password-api.c ask-password-api: only emit a star on valid unicode codepoint 2016-01-26 17:07:14 -05:00
ask-password-api.h ask-password: add support for caching passwords in the kernel keyring 2015-10-07 12:26:14 +02:00
base-filesystem.c shared: include what we use 2015-12-06 13:49:33 +01:00
base-filesystem.h nspawn: finish user namespace support 2015-05-21 16:32:01 +02:00
boot-timestamps.c shared: include what we use 2015-12-06 13:49:33 +01:00
boot-timestamps.h
bus-util.c core: rework unit timeout handling, and add new setting RuntimeMaxSec= 2016-02-01 22:18:16 +01:00
bus-util.h bus-util: print "systemctl --user" on user service manager 2016-01-14 15:33:43 +09:00
cgroup-show.c shared: include what we use 2015-12-06 13:49:33 +01:00
cgroup-show.h shared: include what we use 2015-12-06 13:49:33 +01:00
clean-ipc.c shared: include what we use 2015-12-06 13:49:33 +01:00
clean-ipc.h logind: automatically remove SysV + POSIX IPC objects when the users owning them fully log out 2014-03-14 01:49:44 +01:00
condition.c shared: include what we use 2015-12-06 13:49:33 +01:00
condition.h tree-wide: make condition_free_list return NULL 2014-12-18 19:26:21 -05:00
conf-parser.c shared: include what we use 2015-12-06 13:49:33 +01:00
conf-parser.h shared: include what we use 2015-12-06 13:49:33 +01:00
dev-setup.c shared: include what we use 2015-12-06 13:49:33 +01:00
dev-setup.h nspawn: finish user namespace support 2015-05-21 16:32:01 +02:00
dns-domain.c shared: normalize the root domain to "." rather than "" 2016-01-26 14:42:04 +01:00
dns-domain.h resolved add dns_name_apply_idna() to convert a domain name into its IDNA equivalent 2016-01-18 23:31:15 +01:00
dropin.c tree-wide: check if errno is greater than zero (2) 2016-01-13 15:10:17 -05:00
dropin.h shared: include what we use 2015-12-06 13:49:33 +01:00
efivars.c shared: include what we use 2015-12-06 13:49:33 +01:00
efivars.h shared: include what we use 2015-12-06 13:49:33 +01:00
firewall-util.c shared: include what we use 2015-12-06 13:49:33 +01:00
firewall-util.h shared: include what we use 2015-12-06 13:49:33 +01:00
fstab-util.c shared: include what we use 2015-12-06 13:49:33 +01:00
fstab-util.h util-lib: move fstab_node_to_udev_node() to fstab-util.[ch] 2015-10-27 13:25:55 +01:00
generator.c fstab-gen: don't convert device timeout into seconds when initializing JobTimeoutSec 2015-12-11 10:02:32 +01:00
generator.h generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount 2015-05-04 08:45:07 -04:00
gpt.h Add GPT partition type GUID for Itanium root partition 2016-01-04 06:22:58 -06:00
ima-util.c security: missing header inclusions 2013-10-10 21:22:59 +02:00
ima-util.h security: rework selinux, smack, ima, apparmor detection logic 2013-10-10 16:35:44 +02:00
import-util.c importd: drop dkr support 2015-12-10 16:54:41 +01:00
import-util.h importd: drop dkr support 2015-12-10 16:54:41 +01:00
initreq.h build-sys: move more files from core/ to share/ that are generic enough 2013-11-22 16:31:40 +01:00
install-printf.c shared: include what we use 2015-12-06 13:49:33 +01:00
install-printf.h install: when exporting prefix InstallInfo to become UnitFileInstallInfo 2015-05-11 22:53:54 +02:00
install.c shared: include what we use 2015-12-06 13:49:33 +01:00
install.h shared: include what we use 2015-12-06 13:49:33 +01:00
logs-show.c shared: meanor clean-ups for logs-show.c 2016-01-28 16:28:01 +01:00
logs-show.h shared: include what we use 2015-12-06 13:49:33 +01:00
machine-image.c shared: include what we use 2015-12-06 13:49:33 +01:00
machine-image.h shared: include what we use 2015-12-06 13:49:33 +01:00
machine-pool.c shared: include what we use 2015-12-06 13:49:33 +01:00
machine-pool.h shared: include what we use 2015-12-06 13:49:33 +01:00
Makefile build-sys: add missing Makefile symlink 2015-08-31 13:09:52 +02:00
output-mode.h journalctl: add --utc option 2014-10-02 14:52:32 +02:00
pager.c shared: include what we use 2015-12-06 13:49:33 +01:00
pager.h systemd-verify: check man pages 2014-07-20 19:48:16 -04:00
path-lookup.c shared: include what we use 2015-12-06 13:49:33 +01:00
path-lookup.h shared: include what we use 2015-12-06 13:49:33 +01:00
ptyfwd.c shared: include what we use 2015-12-06 13:49:33 +01:00
ptyfwd.h shared: include what we use 2015-12-06 13:49:33 +01:00
resolve-util.c resolved,networkd: add a per-interface DNSSEC setting 2016-01-05 20:10:31 +01:00
resolve-util.h resolved,networkd: add a per-interface DNSSEC setting 2016-01-05 20:10:31 +01:00
seccomp-util.c shared: include what we use 2015-12-06 13:49:33 +01:00
seccomp-util.h shared: include what we use 2015-12-06 13:49:33 +01:00
sleep-config.c shared: include what we use 2015-12-06 13:49:33 +01:00
sleep-config.h #pragma once here and there 2015-01-23 09:30:44 -05:00
spawn-ask-password-agent.c tree-wide: sort includes 2015-11-16 22:09:36 +01:00
spawn-ask-password-agent.h
spawn-polkit-agent.c shared: include what we use 2015-12-06 13:49:33 +01:00
spawn-polkit-agent.h use #pragma once instead of foo*foo define guards 2013-11-18 20:28:54 -05:00
specifier.c shared: include what we use 2015-12-06 13:49:33 +01:00
specifier.h
switch-root.c tree-wide: use xsprintf() where applicable 2016-01-12 15:36:32 +01:00
switch-root.h shared: include what we use 2015-12-06 13:49:33 +01:00
sysctl-util.c shared: include what we use 2015-12-06 13:49:33 +01:00
sysctl-util.h sysctl: move property handling to shared/ 2015-03-11 10:37:45 +01:00
test-tables.h test-tables: ellide boring parts of sparse mappings 2016-01-29 12:13:08 -05:00
udev-util.h udevd: make udev_ctrl_connection global 2015-05-12 00:43:45 +02:00
uid-range.c shared: include what we use 2015-12-06 13:49:33 +01:00
uid-range.h Add missing includes in header files 2015-02-12 20:44:32 +01:00
utmp-wtmp.c shared: include what we use 2015-12-06 13:49:33 +01:00
utmp-wtmp.h shared: include what we use 2015-12-06 13:49:33 +01:00
watchdog.c shared: include what we use 2015-12-06 13:49:33 +01:00
watchdog.h shared: include what we use 2015-12-06 13:49:33 +01:00