summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-07-29shared/exit-status: use Bitmap instead of SetsZbigniew Jędrzejewski-Szmek7-58/+38
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.
2019-07-29shared/bitmap: constify various operators which don't modify bitmapZbigniew Jędrzejewski-Szmek2-10/+9
2019-07-29shared/exit-status: add exit_status_from_string()Zbigniew Jędrzejewski-Szmek3-0/+33
2019-07-29shared/exit-status: turn status level into a bitmask, add "test"Zbigniew Jędrzejewski-Szmek7-239/+161
The "test" doesn't really test much automatically, but it is still useful to look at the mappings.
2019-07-27Merge pull request #13120 from keszybz/journal-min-useZbigniew Jędrzejewski-Szmek1-53/+55
Increase journald min_use value
2019-07-26errno-util: return const string from strerror_safe()Thomas Haller1-1/+1
C's strerror() function does not return a "const char *" pointer for the string. That has historic reasons and C99 even comments that "[t]he array pointed to shall not be modified by the program". Make the strerror_safe() wrapper correct this and be more strict in this regard.
2019-07-26Merge pull request #13194 from keszybz/chase-symlinks-testingLennart Poettering4-17/+129
Chase symlinks testing
2019-07-26journald: lower keep_free to 5% and raise min_use to 2%Zbigniew Jędrzejewski-Szmek1-49/+38
https://bugzilla.redhat.com/show_bug.cgi?id=1715699 > /dev/mapper/live-rw 6.4G 5.7G 648M 91% / > systemd-journald[905]: Fixed min_use=1.0M max_use=648.7M max_size=81.0M min_size=512.0K keep_free=973.1M n_max_files=100 When journald is started, we pick keep_free as 15% of the disk size. When the fs is almost filled, we will only keep one journal file around and rotate very often (because min_size is very small). Let's set min use to something reasonable, so that we get more useful logs that will cover at least the full boot. Some cases considered in the PR: > /dev/mapper/live-rw 6.4G 5.7G 648M 91% / keep_free→MIN(327,100)→100 MB. min_use→16MB. effective range: 16 MB – 548 MB > /dev/mapper/fedora_krowka-root 78G 69G 5.7G 93% / keep_free → MIN(4GB, 100MB)→100MB min_use→16MB effective range: 16 MB – 5.6 GB (but then there's the max_use limit, which cuts the range down) > 4TB, 4GB free keep_free → MIN(209715, 100) → 100 MB min_use→16MB effective range: 16 MB – 4.9 GB (also effectively limited by max_use) Also replace unneeded width suffixes with spaces, I think this is more readable, and drop DEFAULT_ prefixes in cases where this setting is simply a bound, and cannot be overridden by user config, hence is not a default.
2019-07-26fs-util: CHASE_NOFOLLOW is not limited to CHASE_OPENZbigniew Jędrzejewski-Szmek1-2/+3
$ build/test-chase-symlinks /etc/os-release /etc/os-release → /usr/lib/os-release $ build/test-chase-symlinks --nofollow /etc/os-release /etc/../etc/os-release /etc/../etc/./././os-release /etc/os-release → /etc/os-release /etc/../etc/os-release → /etc/os-release /etc/../etc/./././os-release → /etc/os-release
2019-07-26test-chase-symlinks: manual test to call chase_symlinks()Zbigniew Jędrzejewski-Szmek2-0/+110
v2: - print --help to stdout, use size_t
2019-07-26bootctl: log message tweaksZbigniew Jędrzejewski-Szmek1-2/+2
Follow-up for e44c3229f22459b189c1e79cb01fdb156672eb93.
2019-07-26Merge pull request #13191 from poettering/sysctl-no-failZbigniew Jędrzejewski-Szmek1-38/+83
allow sysctl assignments to fail
2019-07-26Merge pull request #13137 from poettering/efi-randomZbigniew Jędrzejewski-Szmek21-173/+1471
beef up random seed logic, add boot loader entropy privisioning, improve docs about it
2019-07-26Merge pull request #13188 from yuwata/news-igmp-versionLennart Poettering2-3/+3
network: rename `IGMPVersion=` to `MulticastIGMPVersion=`
2019-07-26sysctl: if options are prefixed with "-" ignore write errorsLennart Poettering1-34/+80
2019-07-26sysctl: reset 'r' only where neededLennart Poettering1-2/+2
2019-07-26sysctl: switch to log_syntax()Lennart Poettering1-2/+1
With @keszybz' recent work this will give us clickable links in the journalctl output.
2019-07-26network: slightly update log messageYu Watanabe1-2/+2
2019-07-26network: rename IGMPVersion= -> MulticastIGMPVersion=Yu Watanabe1-1/+1
2019-07-26sd-boot: silence one warning about pointer castZbigniew Jędrzejewski-Szmek1-1/+1
It doesn't matter either way. Fixes #13174.
2019-07-25bootctl: add is-installed verbLennart Poettering1-9/+49
Fixes: #9428
2019-07-25random-seed: rework systemd-random-seed.service substantiallyLennart Poettering1-34/+191
This makes two major changes to the way systemd-random-seed operates: 1. We now optionally credit entropy if this is configured (via an env var). Previously we never would do that, with this change we still don't by default, but it's possible to enable this if people acknowledge that they shouldn't replicate an image with a contained random seed to multiple systems. Note that in this patch crediting entropy is a boolean thing (unlike in previous attempts such as #1062), where only a relative amount of bits was credited. The simpler scheme implemented here should be OK though as the random seeds saved to disk are now written only with data from the kernel's entropy pool retrieved after the pool is fully initialized. Specifically: 2. This makes systemd-random-seed.service a synchronization point for kernel entropy pool initialization. It was already used like this, for example by systemd-cryptsetup-generator's /dev/urandom passphrase handling, with this change it explicitly operates like that (at least systems which provide getrandom(), where we can support this). This means services that rely on an initialized random pool should now place After=systemd-random-seed.service and everything should be fine. Note that with this change sysinit.target (and thus early boot) is NOT systematically delayed until the entropy pool is initialized, i.e. regular services need to add explicit ordering deps on this service if they require an initialized random pool. Fixes: #4271 Replaces: #10621 #4513
2019-07-25random-seed: drop falling back to O_WRONLY if O_RDWR on /dev/urandom doesn't ↵Lennart Poettering1-7/+2
work There's no reason why writing should work if reading and writing doesn't. Let's simplify this hence. /dev/urandom is generally an r/w device, and everything else would be a serious system misconfiguration.
2019-07-25random-seed: reduce scope of variableLennart Poettering1-2/+2
2019-07-25bootctl: show random seed stateLennart Poettering1-0/+16
2019-07-25bootctl: add new verb for initializing a random seed in the ESPLennart Poettering1-50/+253
2019-07-25random-seed: move pool size determination to random-util.[ch]Lennart Poettering3-18/+35
That way we can reuse it elsewhere.
2019-07-25core: take random seed from boot loader and credit it to kernel entropy poolLennart Poettering4-1/+121
2019-07-25sd-boot: read random seed from ESP and pass it to OSLennart Poettering4-2/+397
2019-07-25efi: steal glibc sha256 implementationLennart Poettering3-1/+306
2019-07-25bootctl: add new feature flag for indicating random seed management supportLennart Poettering2-6/+8
2019-07-25bootctl: shortcut configuration file parsingLennart Poettering1-0/+6
2019-07-25bootctl: drop const from non-pointer function argumentLennart Poettering1-1/+1
2019-07-25bootctl: use the fact that startswith() returns the suffixLennart Poettering1-3/+4
2019-07-25efivars: modernize efi_get_variable() a bitLennart Poettering1-27/+44
Primarily, make sure the return parameters are all individually optional.
2019-07-25efi: add log_oom() helperLennart Poettering2-0/+8
2019-07-25efi: modernize file_read() a bitLennart Poettering1-10/+16
2019-07-25xattr-util: document that we NUL suffixLennart Poettering1-4/+2
2019-07-25fs-util: add fsync_full() helperLennart Poettering2-0/+12
We usually combine an fsync() with fsync_directory_of_file() hence let's add a helper that does both in one.
2019-07-25network: drop redundant Link::kind checkYu Watanabe1-14/+7
All CAN devices' iftype are ARPHRD_CAN. So, checking Link::kind is redundant. Follow-up for c6ac3729c9ece63185a3c4e7bc1970b98d2feb01.
2019-07-25network: drop recently added settings from deprecated [DHCP] sectionYu Watanabe1-3/+0
2019-07-25networkd: bridge add support to set IGMP versionSusant Sahani3-0/+53
2019-07-25Add IFLA_BR_MCAST_IGMP_VERSIONShreyas Behera1-0/+1
2019-07-25Merge pull request #13166 from yuwata/network-slcan-supportYu Watanabe12-10/+32
network: slcan support
2019-07-25Merge pull request #13173 from kinvolk/iaguis/fix-norbindYu Watanabe1-2/+43
Revert "nspawn: remove unnecessary mount option parsing logic"
2019-07-24core: try to reopen /dev/kmsg again right after mounting /devLennart Poettering1-0/+5
I was debugging stuff during early boot, and was confused that I never found the logs for it in kmsg. The reason for that was that /proc is generally not mounted the first time we do log_open() and hence log_set_target(LOG_TARGET_KMSG) we do when running as PID 1 had not effect. A lot later during start-up we call log_open() again where this is fixed (after the point where we close all remaining fds still open), but in the meantime no logs every got written to kmsg. This patch fixes that.
2019-07-24Revert "nspawn: remove unnecessary mount option parsing logic"Iago López Galeiras1-2/+43
This reverts commit 72d967df3e27186dd014bed2c6e7400cc32d84c5. Revert this because it broke the `norbind` option of the bind flags because it does bind-mounts unconditionally recursive. Let's bring the old logic back. Fixes: #13170
2019-07-24network: support slcanYu Watanabe1-7/+20
The device driver does not have IFLA_INFO_KIND attribute. So, we need to check iftype. Closes #13150.
2019-07-24network: fix DHCP route rumber parsing.Susant Sahani1-1/+2
2019-07-24Merge pull request #13145 from poettering/nss-gateway-fixZbigniew Jędrzejewski-Szmek6-8/+14
filter _gateway NSS resolving to only use main routing table