summaryrefslogtreecommitdiffstats
path: root/src/shared (follow)
Commit message (Collapse)AuthorAgeFilesLines
* systemd-sleep: improve /proc/swaps open fail messageZach Smith2019-10-241-1/+1
|
* systemd-sleep: always prefer resume device or fileZach Smith2019-10-242-38/+206
| | | | | | | This change checks each swap partition or file reported in /proc/swaps to see if it matches the values configured with resume= and resume_offset= kernel parameters. If a match is found, the matching swap entry is used as the hibernation location regardless of swap priority.
* log: Add missing "%" in "%m" log format stringsFilipe Brandenburger2019-09-251-1/+1
| | | | | These were clearly intended to be "%m" to display the human readable version of the error stored in errno.
* Merge pull request #13481 from Antique/cgroupv2Chris Down2019-09-241-0/+16
|\ | | | | cgroup: introduce support for cgroup v2 CPUSET controller
| * cgroup: introduce support for cgroup v2 CPUSET controllerPavel Hrdina2019-09-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce support for configuring cpus and mems for processes using cgroup v2 CPUSET controller. This allows users to limit which cpus and memory NUMA nodes can be used by processes to better utilize system resources. The cgroup v2 interfaces to control it are cpuset.cpus and cpuset.mems where the requested configuration is written. However, it doesn't mean that the requested configuration will be actually used as parent cgroup may limit the cpus or mems as well. In order to reflect the real configuration cgroup v2 provides read-only files cpuset.cpus.effective and cpuset.mems.effective which are exported to users as well.
* | link: Add support to configure NIC ring buffer sizeSusant Sahani2019-09-242-0/+101
|/
* tree-wide: various code-formatting improvementsFrantisek Sumsal2019-09-221-1/+1
| | | | Reported/found by Coccinelle
* core: add ExecXYZEx= bus hook ups to all exec command propertiesAnita Zhang2019-09-171-2/+3
| | | | | | The "Ex" variant was originally only added for ExecStartXYZ= but it makes sense to have feature parity for the rest of the exec command properties as well (e.g. ExecReload=, ExecStop=, etc).
* Merge pull request #13354 from keszybz/two-refactoring-patchesYu Watanabe2019-09-161-1/+1
|\ | | | | Two or more refactoring patches
| * basic/conf-files: make conf_files_list() take just a single directoryZbigniew Jędrzejewski-Szmek2019-09-161-1/+1
| | | | | | | | | | | | | | This function had two users (apart from tests), and both only used one argument. And it seems likely that if we need to pass more directories, either the _nulstr() or the _strv() form would be used. Let's simplify the code.
* | Merge pull request #13457 from keszybz/resolved-issueZbigniew Jędrzejewski-Szmek2019-09-031-7/+4
|\ \
| * | sd-bus: adjust indentation of commentsZbigniew Jędrzejewski-Szmek2019-08-271-3/+4
| | |
| * | shared/but-util: drop trusted annotation from ↵Zbigniew Jędrzejewski-Szmek2019-08-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bus_open_system_watch_bind_with_description() https://bugzilla.redhat.com/show_bug.cgi?id=1746057 This only affects systemd-resolved. bus_open_system_watch_bind_with_description() is also used in timesyncd, but it has no methods, only read-only properties, and in networkd, but it annotates all methods with SD_BUS_VTABLE_UNPRIVILEGED and does polkit checks.
* | | shared/unit-files: only put valid unit paths and dropin dirs in the cacheZbigniew Jędrzejewski-Szmek2019-08-301-1/+10
| | |
* | | shared/unit-files: we must not filter out names starting with a dotZbigniew Jędrzejewski-Szmek2019-08-301-1/+1
| | | | | | | | | | | | Fixes #13380.
* | | core: stop removing non-existent and duplicate lookup pathsZbigniew Jędrzejewski-Szmek2019-08-272-65/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | shared/watchdog: close watchdog device when done with itZbigniew Jędrzejewski-Szmek2019-08-201-1/+10
| | | | | | | | | | | | The file descriptor was opened with O_CLOEXEC, so in practice this doesn't change too much, but it seems cleaner to always close the old fd when changing the device path.
* | Merge pull request #13353 from keszybz/analyze-cat-config-relabel-extra.dLennart Poettering2019-08-191-9/+18
|\ \ | | | | | | systemd-analyze cat-config relabel-extra.d/
| * | analyze: make cat-config work with relabel-extra.dZbigniew Jędrzejewski-Szmek2019-08-191-9/+18
| |/
* | shared/seccomp: add sync_file_range2Zbigniew Jędrzejewski-Szmek2019-08-191-0/+1
| | | | | | | | | | Some architectures need the arguments to be reordered because of alignment issues. Otherwise, it's the same as sync_file_range.
* | Revert "shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE ↵Zbigniew Jędrzejewski-Szmek2019-08-191-1/+1
|/ | | | | | | | | | | | | | → EXTRACT_UNQUOTE" This reverts commit 8a07b4033e5d3c86931b3dd2ddbca41118c05c60. The tests are kept. test-networkd-conf is adjusted to pass. This fixes #13276. I think current rules are extremely confusing, as the case in test-networkd-conf shows. We apply some kinds of unescaping (relating to quoting), but not others (related to escaping of special characters). But fixing this is hard, because people have adjusted quoting to match our rules, and if we make the rules "better", things might break in unexpected places.
* unit-file: downgrade accidentaly high-prio debug log messageLennart Poettering2019-08-161-1/+1
|
* shared/unit-file: fix systemctl cat user@.serviceZbigniew Jędrzejewski-Szmek2019-08-141-3/+3
| | | | | | | I assumed that unit_name_to_instnace() returns NULL if there is no instance. In fact it returns "", so the check for instance was wrong. Also avoid unnecessary call to unit_name_is_valid().
* src/shared/seccomp-util.c: Add mmap definitions for s390Dan Streetman2019-08-131-2/+4
|
* shared/exit-status: fix off-by-one in commentZbigniew Jędrzejewski-Szmek2019-08-051-2/+2
|
* shared/exit-status: fix lookupZbigniew Jędrzejewski-Szmek2019-08-051-1/+1
| | | | | | | FLAGS_SET() is the wrong operator here, because we want to see if *any* bits are set. Add test. https://github.com/systemd/systemd/pull/12884#issuecomment-518238410
* unit-file: fix coverity issueLennart Poettering2019-07-311-1/+1
| | | | Fixes coverity issue 1403820
* Merge pull request #13119 from keszybz/unit-loading-2Lennart Poettering2019-07-303-1/+501
|\ | | | | Rework unit loading to take into account all aliases
| * pid1: drop unit caches only based on mtimeZbigniew Jędrzejewski-Szmek2019-07-302-1/+58
| | | | | | | | | | | | | | | | | | v2: - do not watch mtime of transient and generated dirs We'd reload the map after every transient unit we created, which we don't need to do, since we create those units ourselves and know their fragment path.
| * pid1: use a cache for all unit aliasesZbigniew Jędrzejewski-Szmek2019-07-302-0/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks how we load units from disk. Instead of chasing symlinks every time we are asked to load a unit by name, we slurp all symlinks from disk and build two hashmaps: 1. from unit name to either alias target, or fragment on disk (if an alias, we put just the target name in the hashmap, if a fragment we put an absolute path, so we can distinguish both). 2. from a unit name to all aliases Reading all this data can be pretty costly (40 ms) on my machine, so we keep it around for reuse. The advantage is that we can reliably know what all the aliases of a given unit are. This means we can reliably load dropins under all names. This fixes #11972.
| * shared/unit-file: add a function to validate unit alias symlinksZbigniew Jędrzejewski-Szmek2019-07-302-0/+75
| | | | | | | | | | | | | | | | It turns out most possible symlinks are invalid, because the type has to match, and template units can only be linked to template units. I'm not sure if the existing code made the same checks consistently. At least I don't see the same rules expressed in a single place.
| * shared/install: typoZbigniew Jędrzejewski-Szmek2019-07-291-1/+1
| |
* | Merge pull request #13219 from poettering/named-exit-codes-tweaksZbigniew Jędrzejewski-Szmek2019-07-302-6/+6
|\ \ | | | | | | quick follow-up for the symbolic exit status PR #13207
| * | exit-status: rename EXIT_STATUS_GLIBC → EXIT_STATUS_LIBCLennart Poettering2019-07-292-6/+6
| | | | | | | | | | | | | | | After all these two exit codes are defined by ISO C as part of the C library, and it's not the GNU implementation defines them.
* | | Merge pull request #13216 from poettering/busctl-format-tableLennart Poettering2019-07-292-9/+63
|\ \ \ | | | | | | | | port "busctl list" to format-table.h
| * | | format-table: add TABLE_PID cell typeLennart Poettering2019-07-291-0/+4
| | | |
| * | | format-table: automatically show empty cells in greyLennart Poettering2019-07-291-3/+16
| | | |
| * | | format-table: add table_fill_empty() to fill in empty cells until the ↵Lennart Poettering2019-07-292-0/+23
| | | | | | | | | | | | | | | | specified column is reached
| * | | format-table: if NULL is spcified as data, let's patch to an empty cellLennart Poettering2019-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This should make various calls easier that currently generate either an empty cell or a regular cell depending on whether they have data to show.
| * | | format-table: optionally show a specific string in empty cellsLennart Poettering2019-07-292-6/+16
| | | | | | | | | | | | | | | | | | | | For some cases it might make sense to show "-" instead of just spaces for empty cells.
* | | | Merge pull request #13201 from yuwata/networkctl-merge-table_add_cellLennart Poettering2019-07-292-1/+174
|\ \ \ \ | |_|/ / |/| | | networkctl cleanups and improvements
| * | | table: add missing NULL initializationYu Watanabe2019-07-291-1/+1
| | | |
| * | | table: add TABLE_UINT8 or friendsYu Watanabe2019-07-292-0/+128
| | | |
| * | | table: add TABLE_IN_ADDR and TABLE_IN6_ADDRYu Watanabe2019-07-292-0/+45
| |/ /
* | | Merge pull request #13207 from keszybz/symbolic-exit-code-namesLennart Poettering2019-07-297-287/+184
|\ \ \ | |/ / |/| | Symbolic exit code names
| * | pid1,systemctl: allow symbolic exit code namesZbigniew Jędrzejewski-Szmek2019-07-291-13/+19
| | |
| * | shared/bus-util: fix dbus serialization of ↵Zbigniew Jędrzejewski-Szmek2019-07-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | {RestartPrevent,RestartForce,Success}ExitStatus We were passing 1/4th of the size in bytes as argument. So depending on the size of the array, either we'd only transfer a subset of values, or we'd get an alignment error.
| * | bus-util: convert bus_log_{parse,create}_error into definesZbigniew Jędrzejewski-Szmek2019-07-292-10/+5
| | | | | | | | | | | | | | | | | | | | | With SYSTEMD_LOG_LOCATION=1, it is much more useful to see the location where the call to bus_log_{parse,create}_error() was made, rather then the one-line body of the helper function. Also, it's our internal code, so having a one-line non-inline function doesn't make much sense anyway.
| * | shared/exit-status: use Bitmap instead of SetsZbigniew Jędrzejewski-Szmek2019-07-294-28/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I opted to embed the Bitmap structure directly in the ExitStatusSet. This means that memory usage is a bit higher for units which don't define this setting: Service changes: /* size: 2720, cachelines: 43, members: 73 */ /* sum members: 2680, holes: 9, sum holes: 39 */ /* sum bitfield members: 7 bits, bit holes: 1, sum bit holes: 1 bits */ /* last cacheline: 32 bytes */ /* size: 2816, cachelines: 44, members: 73 */ /* sum members: 2776, holes: 9, sum holes: 39 */ /* sum bitfield members: 7 bits, bit holes: 1, sum bit holes: 1 bits */ But this way the code is simpler and we do less pointer chasing.
| * | shared/bitmap: constify various operators which don't modify bitmapZbigniew Jędrzejewski-Szmek2019-07-292-10/+9
| | |