summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15547 from kkdwivedi/notify-barrierLennart Poettering2020-05-019-12/+163
|\ | | | | Introduce sd_notify_barrier
| * man: sd_notify() race is gone with sd_notify_barrier()Kumar Kartikeya Dwivedi2020-05-013-11/+33
| | | | | | | | | | | | | | Add note for change of behaviour in systemd-notify, where parent pid trick is only used when --no-block is passed, and with enough privileges ofcourse. Also, fix a small error in systemd(1).
| * Introduce sd_notify_barrierKumar Kartikeya Dwivedi2020-05-016-1/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the sd_notify_barrier function, to allow users to synchronize against the reception of sd_notify(3) status messages. It acts as a synchronization point, and a successful return gurantees that all previous messages have been consumed by the manager. This can be used to eliminate race conditions where the sending process exits too early for systemd to associate its PID to a cgroup and attribute the status message to a unit correctly. systemd-notify now uses this function for proper notification delivery and be useful for NotifyAccess=all units again in user mode, or in cases where it doesn't have a control process as parent. Fixes: #2739
* | Merge pull request #13512 from msekletar/freezerZbigniew Jędrzejewski-Szmek2020-05-0127-24/+926
|\ \ | |/ |/| core: introduce support for cgroup freezer
| * test: add test for cgroup v2 freezer supportMichal Sekletár2020-04-306-0/+310
| |
| * core: introduce support for cgroup freezerMichal Sekletár2020-04-3019-14/+566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With cgroup v2 the cgroup freezer is implemented as a cgroup attribute called cgroup.freeze. cgroup can be frozen by writing "1" to the file and kernel will send us a notification through "cgroup.events" after the operation is finished and processes in the cgroup entered quiescent state, i.e. they are not scheduled to run. Writing "0" to the attribute file does the inverse and process execution is resumed. This commit exposes above low-level functionality through systemd's DBus API. Each unit type must provide specialized implementation for these methods, otherwise, we return an error. So far only service, scope, and slice unit types provide the support. It is possible to check if a given unit has the support using CanFreeze() DBus property. Note that DBus API has a synchronous behavior and we dispatch the reply to freeze/thaw requests only after the kernel has notified us that requested operation was completed.
| * basic/cgroup-util: introduce cg_get_keyed_attribute_full()Michal Sekletár2020-04-293-4/+53
| | | | | | | | | | | | Callers of cg_get_keyed_attribute_full() can now specify via the flag whether the missing keyes in cgroup attribute file are OK or not. Also the wrappers for both strict and graceful version are provided.
| * selinux: do preprocessor check only in selinux-access.cMichal Sekletár2020-04-291-9/+0
| | | | | | | | | | | | | | This has the advantage that mac_selinux_access_check() can be used as a function in all contexts. For example, parameters passed to it won't be reported as unused if the "function" call is replaced with 0 on SELinux disabled builds.
* | test: find path for systemd-journal-remoteDan Streetman2020-04-301-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | As Debian/Ubuntu use /lib/systemd instead of /usr/lib/systemd, add systemd-journal-remote to the list of programs that test-functions detects the correct path to, and replace its direct usage with $SYSTEMD_JOURNAL_REMOTE Also use $JOURNALCTL instead of journalctl. Also minor correction in install_plymouth() to look in /lib/... as well as /usr/lib/... and /etc/...
* | Merge pull request #15592 from kennylevinsen/fdpoll-standaloneLennart Poettering2020-04-303-31/+51
|\ \ | | | | | | Introduce FDPOLL=0
| * | core: (De-)Serialize poll flag for fds in fdstoreKenny Levinsen2020-04-302-18/+26
| | | | | | | | | | | | | | | This replaces manual string splitting and unescaping with extract_first_word.
| * | core: Add optional FDPOLL=0 argument to fdstoreKenny Levinsen2020-04-302-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | A service can specify FDSTORE=1 FDPOLL=0 to request that PID1 does not poll the fd to remove them on error. If set, fds will only be removed on FDSTOREREMOVE=1 or when the service is done. Fixes: #12086
* | | Add SetType method to login Session interfaceCorey Hinshaw2020-04-305-2/+68
|/ /
* | notify: beef up --pid= logicLennart Poettering2020-04-302-12/+56
| | | | | | | | Prompted by the discussions on #15547.
* | efi: honour SYSTEMD_EFI_OPTIONS even if we wouldn't honour SystemdOptions ↵Lennart Poettering2020-04-302-14/+25
| | | | | | | | | | | | EFI var due to SecureBoot Fixes: #14864
* | efi: cache test results of boolean EFI state functionsLennart Poettering2020-04-301-5/+21
| | | | | | | | | | | | | | | | EFI variable access is nowadays subject to rate limiting by the kernel. Thus, let's cache the results of checking them, in order to minimize how often we access them. Fixes: #14828
* | Merge pull request #15630 from nabijaczleweli/symmetric-buffersLennart Poettering2020-04-306-13/+49
|\ \ | | | | | | link: Allow configuring RX mini and jumbo ring sizes, too
| * | link: Allow configuring RX mini and jumbo ring sizes, toonabijaczleweli2020-04-296-1/+39
| | | | | | | | | | | | | | | This now covers all ethtool_ringparam configurables (as of v5.6; https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/ethtool.h?h=v5.6#n488)
| * | link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the ↵nabijaczleweli2020-04-292-12/+10
|/ / | | | | | | implementation slightly
* | docs: reorder the section about security reporting to emphasize the sekrit listZbigniew Jędrzejewski-Szmek2020-04-291-1/+3
|/
* Merge pull request #15626 from poettering/more-specifiersFrantisek Sumsal2020-04-2915-23/+181
|\ | | | | tmpfiles,sysusers,pid1: add a bunch of more specifiers
| * update TODOLennart Poettering2020-04-281-3/+0
| |
| * man: document new specifiersLennart Poettering2020-04-285-8/+69
| |
| * tree-wide: support a bunch of additional specifiersLennart Poettering2020-04-289-12/+112
| |
* | Merge pull request #15628 from poettering/tmpfiles-fuzz-fixLennart Poettering2020-04-291-50/+37
|\ \ | |/ |/| systemd-tmpfiles fuzz issue fix
| * tmpfiles: remove unnecessary assertLennart Poettering2020-04-291-3/+1
| | | | | | | | | | | | | | if we parse an xattr line that has no valid assignment, we might end up with an empty ->xattr list. Don't hit assert on that, just go on. Fixes: #15610
| * tmpfiles: use log_syntax() for all parse errorsLennart Poettering2020-04-291-47/+36
|/
* update TODOLennart Poettering2020-04-281-0/+2
|
* main: bump RLIMIT_MEMLOCK by physical RAM sizeLennart Poettering2020-04-281-2/+6
| | | | | | | | | | Let's allow more memory to be locked on beefy machines than on small ones. The previous limit of 64M is the lower bound still. This effectively means on a 4GB machine we can lock 512M, which should be more than enough, but still not lock up the machine entirely under pressure. Fixes: #15053
* nspawn: be more careful with creating/chowning directories to overmountLennart Poettering2020-04-282-19/+22
| | | | | | We should never re-chown selinuxfs. Fixes: #15475
* update TODOLennart Poettering2020-04-281-4/+3
|
* sd-bus: Add sd_bus_query_sender_creds/privilege docsDaan De Meyer2020-04-284-2/+138
|
* Merge pull request #15618 from keszybz/help-outputZbigniew Jędrzejewski-Szmek2020-04-283-1106/+1179
|\ | | | | Small adjustments to --help output
| * homectl: say "home area" in more placesZbigniew Jędrzejewski-Szmek2020-04-281-12/+12
| | | | | | | | Follow-up for b5947b5b100f694c93857a82018fb0656d08be34.
| * meson: test userdbctl and homectl --helpZbigniew Jędrzejewski-Szmek2020-04-281-2/+2
| |
| * userdbctl: make --help fit in 80 columnsZbigniew Jędrzejewski-Szmek2020-04-281-16/+16
| |
| * meson: modernize indentationZbigniew Jędrzejewski-Szmek2020-04-281-1078/+1151
| | | | | | | | | | | | By using a newline after executable( and run_target(, we get less indentation and the indentation level does not change when the returned object is saved to a variable.
* | sd-bus: Add sd_bus_get_creds_mask docsDaan De Meyer2020-04-283-46/+68
| |
* | Revert "detect-virt: also detect "microsoft" as WSL"Luca Boccassi2020-04-281-4/+2
|/ | | | | | | | | | | | WSL2 will soon (TM) include the "WSL2" string in /proc/sys/kernel/osrelease so the workaround will no longer be necessary. We have several different cloud images which do include the "microsoft" string already, which would break this detection. They are for internal usage at the moment, but the userspace side can come from all over the place so it would be quite hard to track and downstream-patch to avoid breakages. This reverts commit a2f838d59075a49b012f9b7056664f7ffeed44d2.
* efivars: retry open and read operationsZbigniew Jędrzejewski-Szmek2020-04-281-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my laptop (Lenovo X1carbo 4th) I very occasionally see test-boot-timestamps fail with this tb: 262/494 test-boot-timestamps FAIL 0.7348453998565674 s (killed by signal 6 SIGABRT) 08:12:48 SYSTEMD_LANGUAGE_FALLBACK_MAP='/home/zbyszek/src/systemd/src/locale/language-fallback-map' SYSTEMD_KBD_MODEL_MAP='/home/zbyszek/src/systemd/src/locale/kbd-model-map' PATH='/home/zbyszek/src/systemd/build:/home/zbyszek/.local/bin:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/condabin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/zbyszek/bin:/var/lib/snapd/snap/bin' /home/zbyszek/src/systemd/build/test-boot-timestamps --- stderr --- Failed to read $container of PID 1, ignoring: Permission denied Found container virtualization none. Failed to get SystemdOptions EFI variable, ignoring: Interrupted system call Failed to read ACPI FPDT: Permission denied Failed to read LoaderTimeInitUSec: Interrupted system call Failed to read EFI loader data: Interrupted system call Assertion 'q >= 0' failed at src/test/test-boot-timestamps.c:84, function main(). Aborting. Normally it takes ~0.02s, but here there's a slowdown to 0.73 and things fail with EINTR. This happens only occasionally, and I haven't been able to capture a strace. It would be to ignore that case in test-boot-timestamps or always translate EINTR to -ENODATA. Nevertheless, I think it's better to retry, since this gives as more resilient behaviour and avoids a transient failure. See https://github.com/torvalds/linux/blob/master/fs/efivarfs/file.c#L75 and https://github.com/torvalds/linux/commit/bef3efbeb897b56867e271cdbc5f8adaacaeb9cd.
* shell-completion/zsh: update systemd-analyze completionsRonan Pigott2020-04-271-3/+20
|
* zsh: fix disable/enable completionHaochen Tong2020-04-271-1/+5
| | | | | | | The "preset" column introduced in b01c1f305c044a381ad110709a62507d74bf6d86 breaks zsh completion for systemctl disable/enable. Fix by ignoring everything after the last space in a line.
* tests: various small fixes for strict systemsTopi Miettinen2020-04-2616-25/+90
| | | | | | | | | | | | | | | | | | | | | | Don't assume that 4MB can be allocated from stack since there could be smaller DefaultLimitSTACK= in force, so let's use malloc(). NUL terminate the huge strings by hand, also ensure termination in test_lz4_decompress_partial() and optimize the memset() for the string. Some items in /proc and /etc may not be accessible to poor unprivileged users due to e.g. SELinux, BOFH or both, so check for EACCES and EPERM. /var/tmp may be a symlink to /tmp and then path_compare() will always fail, so let's stick to /tmp like elsewhere. /tmp may be mounted with noexec option and then trying to execute scripts from there would fail. Detect and warn if seccomp is already in use, which could make seccomp test fail if the syscalls are already blocked. Unset $TMPDIR so it will not break specifier tests where %T is assumed to be /tmp and %V /var/tmp.
* sd-bus: Cite sd_bus_creds_unref in sd_bus_get_name_creds docsDaan De Meyer2020-04-251-3/+4
|
* test-cgroup: skip if /sys/fs/cgroup unknown fsDan Streetman2020-04-251-1/+7
| | | | | | It's not always mounted, e.g. during the build-time tests, it's running inside a chroot (that's how Debian/Ubuntu build packages, in chroots) so this test always fails because /sys/fs/cgroup isn't mounted.
* cgroup-util: check for SYSFS_MAGIC when detecting cgroup formatDan Streetman2020-04-251-0/+3
| | | | | | | | | | | When nothing at all is mounted at /sys/fs/cgroup, the fs.f_type is SYSFS_MAGIC (0x62656572) which results in the confusing debug log: "Unknown filesystem type 62656572 mounted on /sys/fs/cgroup." Instead, if the f_type is SYSFS_MAGIC, a more accurate message is: "No filesystem is currently mounted on /sys/fs/cgroup."
* Improve help for clang-formatNorbert Lange2020-04-251-2/+16
| | | | The comments lack the most important usecase: fixing up your commits.
* ci: introduce CIFuzzFrantisek Sumsal2020-04-241-0/+27
| | | | | | Per-PR fuzzing provided by OSS-Fuzz using GH workflows. See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/
* dhcp6: make string argument to sd_dhcp6_client_set_request_mud_url() constThomas Haller2020-04-242-2/+2
|
* Merge pull request #15579 from DaanDeMeyer/sd-bus-get-name/owner-creds-docsZbigniew Jędrzejewski-Szmek2020-04-243-0/+123
|\