Systemd/src/core
Zbigniew Jędrzejewski-Szmek 581fef8d56 core: stop removing non-existent and duplicate lookup paths
When we would iterate over the lookup paths for each unit, making the list as
short as possible was important for performance. With the current cache, it
doesn't matter much. Two classes of paths were being removed:
- paths which don't exist in the filesystem
- paths which symlink to a path earlier in the search list
Both of those points cause problems with the caching code:
- if a user creates a directory that didn't exist before and puts units there,
  now we will notice the new mtime an properly load the unit. When the path
  was removed from list, we wouldn't.
- we now properly detect whether a unit path is on the path or not.
  Before, if e.g. /lib/systemd/system, /usr/lib/systemd/systemd were both on
  the path, and /lib was a symlink to /usr/lib, the second directory would be
  pruned from the path. Then, the code would think that a symlink
  /etc/systemd/system/foo.service→/lib/systemd/system/foo.service is an alias,
  but /etc/systemd/system/foo.service→/usr/lib/systemd/system/foo.service would
  be considered a link (in the systemctl link sense).

Removing the pruning has a slight negative performance impact in case of
usr-merge systems which have systemd compiled with non-usr-merge paths.
Non-usr-merge systems are deprecated, and this impact should be very small, so
I think it's OK. If it turns out to be an issue, the loop in function that
builds the cache could be improved to skip over "duplicate" directories with
same logic that the cache pruning did before. I didn't want to add this,
becuase it complicates the code to improve a corner case.

Fixes #13272.
2019-08-27 18:12:20 +02:00
..
all-units.h core: add spdx header to all-units.h 2019-07-24 05:06:21 +09:00
audit-fd.c
audit-fd.h
automount.c Merge pull request #12115 from poettering/verbose-job-enqueue 2019-03-28 11:04:26 +01:00
automount.h
bpf-devices.c tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
bpf-devices.h cgroups: beef up DeviceAllow= syntax a bit 2018-11-29 20:21:39 +01:00
bpf-firewall.c Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
bpf-firewall.h bpf-firewall: custom BPF programs through IP(Ingress|Egress)FilterPath= 2019-06-25 09:56:16 +02:00
cgroup.c cgroup: Also set io.bfq.weight 2019-08-20 11:50:59 +02:00
cgroup.h job: make the run queue order deterministic 2019-07-18 10:28:39 +02:00
chown-recursive.c tree-wide: port various places over to use chmod_and_chown() 2019-05-24 15:07:55 +02:00
chown-recursive.h core: drop suid/sgid bit of files/dirs when doing recursive chown 2019-03-26 08:29:37 +01:00
dbus-automount.c
dbus-automount.h
dbus-cgroup.c tree-wide: make use of errno_or_else() everywhere 2019-07-11 23:20:31 +02:00
dbus-cgroup.h
dbus-device.c
dbus-device.h
dbus-execute.c pid1: replace asprintf() with strjoin() 2019-08-03 17:46:56 +02:00
dbus-execute.h core: add ExecStartXYZEx= with dbus support for executable prefixes 2019-05-30 20:41:42 -07:00
dbus-job.c Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
dbus-job.h core: before returning new job path to clients, force out JobNew signals 2018-12-01 12:53:26 +01:00
dbus-kill.c
dbus-kill.h
dbus-manager.c core: rename ShutdownWatchdogSec to RebootWatchdogSec 2019-07-23 20:29:03 +01:00
dbus-manager.h core: implement OOMPolicy= and watch cgroups for OOM killings 2019-04-09 11:17:58 +02:00
dbus-mount.c cgroup: drastically simplify caching of cgroups members mask 2018-11-23 13:41:37 +01:00
dbus-mount.h
dbus-path.c
dbus-path.h
dbus-scope.c core: reduce the number of stalled PIDs from the watched processes list when possible 2019-03-20 10:51:49 +01:00
dbus-scope.h pid1: add a new AbandonScope() method call on the Manager object 2018-11-09 17:08:59 +01:00
dbus-service.c shared/bus-util: fix dbus serialization of {RestartPrevent,RestartForce,Success}ExitStatus 2019-07-29 15:54:53 +02:00
dbus-service.h
dbus-slice.c cgroup: drastically simplify caching of cgroups members mask 2018-11-23 13:41:37 +01:00
dbus-slice.h
dbus-socket.c tree-wide: drop duplicated blank lines 2019-07-15 18:41:27 +02:00
dbus-socket.h
dbus-swap.c cgroup: drastically simplify caching of cgroups members mask 2018-11-23 13:41:37 +01:00
dbus-swap.h
dbus-target.c
dbus-target.h
dbus-timer.c core: TAKE_PTR in timer_add_one_calendar_spec 2019-08-22 11:02:56 +02:00
dbus-timer.h
dbus-unit.c Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
dbus-unit.h core: expose new clean operation on the bus 2019-07-11 12:18:51 +02:00
dbus-util.c
dbus-util.h
dbus.c core: Avoid race when starting dbus services 2019-08-14 16:12:31 +02:00
dbus.h core: rename queued_message → pending_reload_message 2018-11-13 11:59:06 +01:00
device.c Rename EXTRACT_QUOTES to EXTRACT_UNQUOTE 2019-06-28 11:35:05 +02:00
device.h
dynamic-user.c Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
dynamic-user.h tree-wide: reorder various structures to make them smaller and use fewer cache lines 2019-03-27 18:11:11 +01:00
efi-random.c core: take random seed from boot loader and credit it to kernel entropy pool 2019-07-25 18:16:46 +02:00
efi-random.h core: take random seed from boot loader and credit it to kernel entropy pool 2019-07-25 18:16:46 +02:00
emergency-action.c core: add new API for enqueing a job with returning the transaction data 2019-03-27 12:37:37 +01:00
emergency-action.h core: change emergency_action() to return void 2019-03-18 16:06:36 +01:00
execute.c exit-status: rename EXIT_STATUS_GLIBC → EXIT_STATUS_LIBC 2019-07-29 19:05:25 +02:00
execute.h core: add type of resource string table 2019-07-11 12:18:51 +02:00
hostname-setup.c
hostname-setup.h
ima-setup.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
ima-setup.h
ip-address-access.c bpf-firewall: optimization for IPAddressXYZ="any" (and unprivileged users) 2019-06-22 19:56:06 +02:00
ip-address-access.h bpf-firewall: optimization for IPAddressXYZ="any" (and unprivileged users) 2019-06-22 19:56:06 +02:00
job.c job: fix coverity issue 2019-07-31 09:45:03 +02:00
job.h job: make the run queue order deterministic 2019-07-18 10:28:39 +02:00
kill.c
kill.h tree-wide: reorder various structures to make them smaller and use fewer cache lines 2019-03-27 18:11:11 +01:00
killall.c killall: bump log message about unkilled processes to LOG_WARNING 2019-07-13 11:05:07 +02:00
killall.h core/killall: Propagate errors and return the number of process left 2019-04-08 19:41:16 +02:00
kmod-setup.c tree-wide: replace 'unsigned int' with 'unsigned' 2018-10-19 22:19:12 +02:00
kmod-setup.h
load-dropin.c
load-dropin.h pid1: kill unit_file_find_dropin_paths() helper 2019-07-17 14:27:23 +02:00
load-fragment-gperf-nulstr.awk
load-fragment-gperf.gperf.m4 core: ExecCondition= for services 2019-07-17 11:35:02 +02:00
load-fragment.c load-fragment: use path_join() where appropriate 2019-08-20 17:32:34 +02:00
load-fragment.h core: move config_parse_* functions to a shared module 2019-06-25 22:35:02 +09:00
locale-setup.c Make default locale a compile time option 2018-12-29 21:43:04 +09:00
locale-setup.h
loopback-setup.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
loopback-setup.h
machine-id-setup.c util: split out namespace related stuff into a new namespace-util.[ch] pair 2019-03-13 12:16:38 +01:00
machine-id-setup.h
macros.systemd.in rpm: avoid hiding errors from systemd commands 2019-03-22 20:54:59 +01:00
main.c exit-status: rename EXIT_STATUS_GLIBC → EXIT_STATUS_LIBC 2019-07-29 19:05:25 +02:00
manager.c core: stop removing non-existent and duplicate lookup paths 2019-08-27 18:12:20 +02:00
manager.h Merge pull request #13119 from keszybz/unit-loading-2 2019-07-30 17:55:37 +02:00
meson.build meson: create (empty) /etc/systemd/system during installation 2019-08-06 03:11:09 +09:00
mount-setup.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
mount-setup.h core: remove JoinControllers= configuration setting 2018-11-16 14:54:13 +01:00
mount.c pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
mount.h mount: replace three closely related mount flags into a proper flags enum 2018-12-07 17:35:32 +01:00
namespace.c tree-wide: some more [static] related fixes 2019-07-12 16:40:10 +02:00
namespace.h tree-wide: some more [static] related fixes 2019-07-12 16:40:10 +02:00
org.freedesktop.systemd1.conf
org.freedesktop.systemd1.policy.in
org.freedesktop.systemd1.service
path.c tree-wide: introduce strerror_safe() 2019-07-05 02:43:56 +09:00
path.h
scope.c core: add new call unit_reset_accounting() 2019-04-12 14:25:44 +02:00
scope.h
selinux-access.c Merge pull request #12926 from keszybz/urlify-logs 2019-07-11 00:00:34 +02:00
selinux-access.h
selinux-setup.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
selinux-setup.h
service.c pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
service.h core: ExecCondition= for services 2019-07-17 11:35:02 +02:00
show-status.c Add config and kernel commandline option to use short identifiers 2019-07-10 13:35:26 +02:00
show-status.h Add config and kernel commandline option to use short identifiers 2019-07-10 13:35:26 +02:00
slice.c core: add new call unit_reset_accounting() 2019-04-12 14:25:44 +02:00
slice.h
smack-setup.c Add open_memstream_unlocked() wrapper 2019-04-12 11:44:57 +02:00
smack-setup.h
socket.c pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
socket.h
swap.c pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
swap.h
system.conf.in core: rename ShutdownWatchdogSec to RebootWatchdogSec 2019-07-23 20:29:03 +01:00
systemd.pc.in pkgconfig: avoid double slash with split-usr configuration 2019-03-05 18:49:28 +01:00
target.c core: whenever we change state of a unit, force out PropertiesChanged bus signal 2018-12-01 12:53:26 +01:00
target.h
timer.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
timer.h core: optionally, trigger .timer units on timezone and clock changes 2019-04-02 08:20:10 +02:00
transaction.c Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
transaction.h core: add new API for enqueing a job with returning the transaction data 2019-03-27 12:37:37 +01:00
triggers.systemd.in
unit-printf.c core: move assert before actual use of the variable 2019-06-26 16:24:48 +02:00
unit-printf.h tree-wide: remove various unused functions 2018-12-02 13:35:34 +09:00
unit.c pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
unit.h pid1: always log successfull process termination quietly 2019-08-22 09:09:45 +02:00
user.conf.in Add config and kernel commandline option to use short identifiers 2019-07-10 13:35:26 +02:00