Lennart Poettering [Tue, 20 Nov 2018 14:56:22 +0000 (15:56 +0100)]
man: minor fixes
As suggested here:
https://github.com/systemd/systemd/pull/10538#pullrequestreview-
176710207
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 12:36:45 +0000 (13:36 +0100)]
Merge pull request #10850 from poettering/log-setup
reduce some logging boilerplate
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 10:48:48 +0000 (11:48 +0100)]
veritysetup-generator: treat '-' and '_' as equivalent
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 12:00:28 +0000 (13:00 +0100)]
Merge pull request #10538 from poettering/tmpfiles-reorder
tmpfiles: remove children before their parents plus other fixlets
Lennart Poettering [Tue, 20 Nov 2018 11:44:30 +0000 (12:44 +0100)]
Merge pull request #10831 from keszybz/less-libbasic
Move various files that don't need to be in basic/ to shared/
Lennart Poettering [Tue, 20 Nov 2018 10:18:22 +0000 (11:18 +0100)]
log: introduce new helper call log_setup_service()
Let's reduce the common boilerplate and have a single setup function
used by all service code to setup logging.
Lennart Poettering [Mon, 19 Nov 2018 20:32:11 +0000 (21:32 +0100)]
generators: introduce a common implementation for the log setup boilerplate
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 09:42:19 +0000 (10:42 +0100)]
Merge pull request #10787 from yuwata/libudev-cleanups
libudev: drop unused private functions
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:29:16 +0000 (13:29 +0100)]
journal: fix sort order of header includes
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:24:34 +0000 (13:24 +0100)]
CODING_STYLE: fix rules for STRLEN and recommend strjoina more strongly
Again, this mostly matches what is happening in the codebase already.
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:14:21 +0000 (13:14 +0100)]
CODING_STYLE: clarify the rules for the src/basic & src/shared split
The rule is changed from "put in basic unless there's a reason not to" to "put
in shared unless there's a reason not to", to match the change done in previous
commit. This minimizes libbasic. See previous commit for the reasons why this
is useful.
Previously, the guideline was based on whether the files in question use
"publicly exported APIs". This distinction is not particularly relevant. Let's
consider all other programs we compile: most of them use "publicly exported
APIs", usually linking to libsystemd-shared.so for the actual code. But those
programs are not forced to be in src/basic, and the distinction whether they
happen to use 'sd-*.h' or not is of no importance. The same is true for files
in src/shared/. If we didn't have publicly exported shared objects, we'd put
everything in libsystemd-shared.so. So let's only move things out of it that we
need to. Previous guideline was not "wrong", in the sense that it created *a*
split that was functional (no code in src/shared was required in the publicly
exported shared objects), but it put more files in basic/ then necessary.
Not much changes in practice, because (as previous commit shows), moving files
between libbasic.a and libsystemd-shared.so mostly just changes compilation
order.
The list of components which cannot use libsystemd-shared.so is adjusted.
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 10:35:33 +0000 (11:35 +0100)]
meson: drop libblkid from libbasic
This doesn't seem to change anything, because libmount links to libblkid anyway.
But we don't need to include this dep directly in libbasic.
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 10:12:28 +0000 (11:12 +0100)]
Move various files that don't need to be in basic/ to shared/
This doesn't have much effect on the final build, because we link libbasic.a
into libsystemd-shared.so, so in the end, all the object built from basic/
end up in libsystemd-shared. And when the static library is linked into binaries,
any objects that are included in it but are not used are trimmed. Hence, the
size of output artifacts doesn't change:
$ du -sb /var/tmp/inst*
54181861 /var/tmp/inst1 (old)
54207441 /var/tmp/inst1s (old split-usr)
54182477 /var/tmp/inst2 (new)
54208041 /var/tmp/inst2s (new split-usr)
(The negligible change in size is because libsystemd-shared.so is bigger
by a few hundred bytes. I guess it's because symbols are named differently
or something like that.)
The effect is on the build process, in particular partial builds. This change
effectively moves the requirements on some build steps toward the leaves of the
dependency tree. Two effects:
- when building items that do not depend on libsystemd-shared, we
build less stuff for libbasic.a (which wouldn't be used anyway,
so it's a net win).
- when building items that do depend on libshared, we reduce libbasic.a as a
synchronization point, possibly allowing better parallelism.
Method:
1. copy list of .h files from src/basic/meson.build to /tmp/basic
2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less
Yu Watanabe [Mon, 29 Oct 2018 17:40:23 +0000 (02:40 +0900)]
libudev: coding style fixes
Yu Watanabe [Fri, 16 Nov 2018 02:44:17 +0000 (11:44 +0900)]
libudev-list: move libudev-list related definitions to libudev-list-internal.h
This also rename libudev-private.h to libudev-util.h, and cleanups
several unnecessary headers from udev.h and libudev-util.h
Yu Watanabe [Mon, 29 Oct 2018 15:59:06 +0000 (00:59 +0900)]
libudev: drop prototypes for nonexistent functions
Yu Watanabe [Mon, 29 Oct 2018 15:54:12 +0000 (00:54 +0900)]
libudev-monitor: drop unused private functions
Yu Watanabe [Fri, 16 Nov 2018 02:30:01 +0000 (11:30 +0900)]
libudev-device: drop unused private functions
Yu Watanabe [Fri, 16 Nov 2018 02:28:07 +0000 (11:28 +0900)]
udev: move definition of READ_END and WRITE_END from libudev-private.h to udev.h
Yu Watanabe [Tue, 20 Nov 2018 04:37:27 +0000 (13:37 +0900)]
Merge pull request #10847 from evverx/journald-stream-fuzzer
tests: add a fuzzer for journald streams
Xuanwo [Tue, 20 Nov 2018 04:17:11 +0000 (12:17 +0800)]
zsh-completion: Add support for set-property (#10322)
Yu Watanabe [Tue, 20 Nov 2018 04:13:41 +0000 (13:13 +0900)]
Merge pull request #10801 from ssc-services/zsh-completion_machinectl_clone
zsh-completion: complete available, not running machines for `clone`
Yu Watanabe [Tue, 20 Nov 2018 03:53:51 +0000 (12:53 +0900)]
Merge pull request #10835 from poettering/transient-env-fix
fix flushing out of transient env vars from PID1's Manager object
Lennart Poettering [Tue, 20 Nov 2018 03:37:01 +0000 (04:37 +0100)]
bootspec: introduce SYSTEMD_ESP_PATH for overriding where to look for the ESP (#10834)
David Leeds [Tue, 20 Nov 2018 03:35:36 +0000 (19:35 -0800)]
process-util: check for correct kill return value (#10841)
Code was not doing a wait() after kill() due to checking for a return value > 0, and was leaving zombie processes. This affected things like sd-bus unixexec connections.
Lennart Poettering [Tue, 20 Nov 2018 03:34:08 +0000 (04:34 +0100)]
tree-wide: use __ prefixed gcc attributes (#10843)
As suggest here:
https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax
"You may optionally specify attribute names with ‘__’ preceding and
following the name. This allows you to use them in header files without
being concerned about a possible macro of the same name. For example,
you may use the attribute name __noreturn__ instead of noreturn. "
Yu Watanabe [Tue, 20 Nov 2018 03:31:52 +0000 (12:31 +0900)]
Merge pull request #10845 from poettering/static-destruct
RFC: introduce automatic destructors for static variables
Lennart Poettering [Mon, 19 Nov 2018 13:48:28 +0000 (14:48 +0100)]
tests: always use the right vtable wrapper calls
Prompted by https://github.com/systemd/systemd/pull/10836#discussion_r234598868
Evgeny Vereshchagin [Tue, 20 Nov 2018 00:20:32 +0000 (01:20 +0100)]
tests: add a fuzzer for journald streams
Lennart Poettering [Mon, 19 Nov 2018 12:05:43 +0000 (13:05 +0100)]
test-execute: fix killing of unit processes
Let's use the correct wrapper for calling unit vtable functions. Let's
make sure we always use the right wrappers, and never bypass them
needlessly.
Moreover use SIGKILL rather than "9" as signal name. Let's not be
needlessly cryptic.
Follow-up for:
f7f8e8cbb953686c520969a66a9718675a972af5
Lennart Poettering [Mon, 19 Nov 2018 13:33:03 +0000 (14:33 +0100)]
doc: document the boot menu entry identifier vocabulary
The existing text already said "See below regarding a recommended
vocabulary for boot loader entry identifiers.", but the section for it
was still missing. Let's fill in the missing bits, and describe basic
suggested rules for the boot menu entry identifier vocabulary, in
particular how to identify Windows and MacOS X installations, and how to
name automatic entries vs. explicitly configured ones.
This basically follows the logic implemented in sd-boot these days.
Lennart Poettering [Mon, 19 Nov 2018 19:06:45 +0000 (20:06 +0100)]
meson: order source files alphabetically
Lennart Poettering [Mon, 19 Nov 2018 19:48:12 +0000 (20:48 +0100)]
debug-generator: port over to using static destructors
Lennart Poettering [Mon, 19 Nov 2018 19:11:35 +0000 (20:11 +0100)]
debug-generator: port over to DEFINE_MAIN_FUNCTION()
Lennart Poettering [Mon, 19 Nov 2018 19:47:46 +0000 (20:47 +0100)]
main-func: automatically call static destructors from main-func.h macros
Lennart Poettering [Mon, 19 Nov 2018 19:08:04 +0000 (20:08 +0100)]
util: add set of macros for declaring _cleanup_-style destructors for static variables
Lennart Poettering [Mon, 19 Nov 2018 19:26:37 +0000 (20:26 +0100)]
util-lib: move main() definition macros to its own header file
This way, we can extend the macro a bit with stuff pulled in from other
headers without this affecting everything which pulls in macro.h, which
is one of our most basic headers.
This is just refactoring, no change in behaviour, in prepartion for
later changes.
Lennart Poettering [Mon, 19 Nov 2018 14:28:17 +0000 (15:28 +0100)]
Merge pull request #10811 from keszybz/define-main-through-macro
Define main through macro
Lennart Poettering [Mon, 19 Nov 2018 10:39:45 +0000 (11:39 +0100)]
pam_systemd: suppress LOG_DEBUG log messages if debugging is off
In the PAM module we need to suppress LOG_DEBUG messages manually, if
debug logging is not on, as PAM won't do this for us. We did this
correctly for most log messages already, but two were missing. Let's fix
those too.
Fixes: #10822
Lennart Poettering [Mon, 19 Nov 2018 11:23:13 +0000 (12:23 +0100)]
main: when reloading PID 1 let's reset the default environment
Otherwise we keep collecting stuff from env generators, and we really
shouldn't.
This was working properly on reexec but not on reload, as for reexec we
would always start fresh, but for reload would reuse the Manager object
and hence its default environment set.
Fixes: #10671
Lennart Poettering [Mon, 19 Nov 2018 11:22:56 +0000 (12:22 +0100)]
manager: log on two OOM occasions
Lennart Poettering [Mon, 19 Nov 2018 10:28:45 +0000 (11:28 +0100)]
Merge pull request #10698 from yuwata/udevd-replace-udev-device
udevd: replace udev_device by sd_device
Lennart Poettering [Mon, 19 Nov 2018 10:07:07 +0000 (11:07 +0100)]
Merge pull request #10809 from keszybz/unit-log-result
Add helper function for logging unit results
Lennart Poettering [Mon, 19 Nov 2018 10:05:48 +0000 (11:05 +0100)]
Merge pull request #10814 from poettering/logind-suspend-fallback
if we need to hibernate/suspend-then-hibernate/hybrid-sleep due to keypress/lid switch but can't, fallback to regular suspend
Lennart Poettering [Mon, 19 Nov 2018 10:05:18 +0000 (11:05 +0100)]
Merge pull request #10825 from keszybz/advertize-followup
udev link advertizing followup
Lennart Poettering [Mon, 19 Nov 2018 09:57:48 +0000 (10:57 +0100)]
Merge pull request #10507 from cdown/cpu_acct
cgroup v2: Don't require CPU controller for CPU accounting in 4.15+
Evgeny Vereshchagin [Sat, 17 Nov 2018 19:36:31 +0000 (20:36 +0100)]
test: kill all processes launched by test-execute before exiting
As was shown in https://github.com/systemd/systemd/issues/10696#issuecomment-
439613204,
currently `meson` waits for 1080 seconds (which is three times the global timeout) for the
test to fail completely even though it takes just two minutes for it to really fail. This
happens because the test itself leaves the services it has launched behind, which, in turn, makes
meson think that the test is still in progress. KILL_ALL with SIGKILL should make the issue
go away.
Piotr Drąg [Sun, 18 Nov 2018 18:04:53 +0000 (19:04 +0100)]
catalog: update Polish translation
Xi Ruoyao [Sun, 18 Nov 2018 18:51:25 +0000 (02:51 +0800)]
test: let the shell find "touch" instead of hard-coded "/bin/touch"
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:13:32 +0000 (10:13 +0100)]
basic/missing: drop _ETHTOOL_LINK_MODE_MAX
It was only used in one place, where we don't actually need it, and
it is too easy to forget to update it when adding new items to the table.
Let's just drop it.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:12:14 +0000 (10:12 +0100)]
udev: use an "inline" array instead of allocating for advertise mode
The code is a bit shorter and we don't allocate the uint32_t[127] array.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:42:39 +0000 (10:42 +0100)]
basic/util: import memeqzero from casync
Chris Down [Thu, 25 Oct 2018 13:03:58 +0000 (14:03 +0100)]
cgroup v2: DefaultCPUAccounting=yes if CPU controller isn't required
We now don't enable the CPU controller just for CPU accounting if we are
on 4.15+ and using pure unified hierarchy, as this is provided
externally to the CPU controller. This makes CPUAccounting=yes
essentially free, so enabling it by default when it's cheap seems like a
good idea.
Chris Down [Sat, 17 Nov 2018 11:47:44 +0000 (11:47 +0000)]
cgtop: Still try to get CPU statistics if controller-free
If CPU accounting is cheap, no controller necessarily needs to be
enabled here for us to be able to read statistics.
Chris Down [Sat, 17 Nov 2018 11:19:07 +0000 (11:19 +0000)]
cgroup v2: Don't require CPU controller for CPU accounting in 4.15+
systemd only uses functions that are as of Linux 4.15+ provided
externally to the CPU controller (currently usage_usec), so if we have a
new enough kernel, we don't need to set CGROUP_MASK_CPU for
CPUAccounting=true as the CPU controller does not need to necessarily be
enabled in this case.
Part of this patch is modelled on an earlier patch by Ryutaroh Matsumoto
(see PR #9665).
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:46:30 +0000 (10:46 +0100)]
test-util: modernize
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:27:29 +0000 (10:27 +0100)]
Merge pull request #10819 from yuwata/fix-10807
ethtool: drop NetDevAdvertise
Yu Watanabe [Sat, 17 Nov 2018 14:08:22 +0000 (23:08 +0900)]
ethtool: drop NetDevAdvertise
Fixes #10807.
Yu Watanabe [Sat, 17 Nov 2018 14:42:27 +0000 (23:42 +0900)]
missing: add ETHTOOL_LINK_MODE_* and struct ethtool_link_settings
Zbigniew Jędrzejewski-Szmek [Sat, 17 Nov 2018 17:26:54 +0000 (18:26 +0100)]
Merge pull request #10817 from evverx/audit-fuzzer
Add a fuzzer for process_audit_string
Yu Watanabe [Sat, 17 Nov 2018 15:42:33 +0000 (00:42 +0900)]
test: also tests enumerating subsystems
Yu Watanabe [Thu, 8 Nov 2018 09:17:20 +0000 (18:17 +0900)]
udevd: replace udev_device in struct event by sd_device
Yu Watanabe [Fri, 9 Nov 2018 08:13:13 +0000 (17:13 +0900)]
udevd: update several log messages
Yu Watanabe [Thu, 8 Nov 2018 08:45:01 +0000 (17:45 +0900)]
udevd: decrease indentation
Yu Watanabe [Thu, 8 Nov 2018 08:43:21 +0000 (17:43 +0900)]
udevd: rename event sources in struct event
Yu Watanabe [Thu, 8 Nov 2018 08:40:15 +0000 (17:40 +0900)]
udevd: capitalize log messages in on_sigchld()
Yu Watanabe [Thu, 8 Nov 2018 06:48:38 +0000 (15:48 +0900)]
udevd: also use sd_device_monitor_start() in worker_main()
Yu Watanabe [Thu, 8 Nov 2018 06:44:25 +0000 (15:44 +0900)]
udevd: use sd_device_monitor_start() in manager_new()
Yu Watanabe [Thu, 8 Nov 2018 06:38:20 +0000 (15:38 +0900)]
udevd: replace udev_monitor by sd_device_monitor
Yu Watanabe [Tue, 6 Nov 2018 08:35:33 +0000 (17:35 +0900)]
udevd: use safe_fork() to spawn worker process
Yu Watanabe [Tue, 6 Nov 2018 08:28:12 +0000 (17:28 +0900)]
udevd: make worker_process_device() take sd_device instead of udev_device
Yu Watanabe [Tue, 6 Nov 2018 08:19:41 +0000 (17:19 +0900)]
udevd: make worker_lock_block_device() take sd_device instead of udev_device
Also adds many debug logs.
Yu Watanabe [Thu, 8 Nov 2018 06:08:06 +0000 (15:08 +0900)]
udevd: split worker_spawn() and manager_free() in small pieces
Evgeny Vereshchagin [Sat, 17 Nov 2018 12:01:09 +0000 (13:01 +0100)]
tests: introduce dummy_server_init and use it in all journald fuzzers
Evgeny Vereshchagin [Fri, 16 Nov 2018 14:49:02 +0000 (15:49 +0100)]
travis: make the ASan & UBsan job a little bit stricter
Evgeny Vereshchagin [Fri, 16 Nov 2018 22:32:31 +0000 (23:32 +0100)]
journald: check whether sscanf has changed the value corresponding to %n
It's possible for sscanf to receive strings containing all three fields
and not matching the template at the same time. When this happens the
value of k doesn't change, which basically means that process_audit_string
tries to access memory randomly. Sometimes it works and sometimes it doesn't :-)
See also https://bugzilla.redhat.com/show_bug.cgi?id=1059314.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:27:21 +0000 (15:27 +0100)]
volatile-root: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:24:07 +0000 (15:24 +0100)]
tty-ask-password-agent: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:22:24 +0000 (15:22 +0100)]
sysv-generator: configure logging before use and define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:20:28 +0000 (15:20 +0100)]
stdio-bridge: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:15:22 +0000 (15:15 +0100)]
sleep: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:13:14 +0000 (15:13 +0100)]
remount-fs: configure logging before use and define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 14:06:40 +0000 (15:06 +0100)]
random-seed: configure logging before use and define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:57:46 +0000 (14:57 +0100)]
quotacheck: configure logging before use and define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:56:59 +0000 (14:56 +0100)]
portabled: add missing STOPPING=1 notification
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:56:15 +0000 (14:56 +0100)]
portabled: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:54:20 +0000 (14:54 +0100)]
path: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:52:25 +0000 (14:52 +0100)]
makefs: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:50:29 +0000 (14:50 +0100)]
notify: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:44:14 +0000 (14:44 +0100)]
machined: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:42:39 +0000 (14:42 +0100)]
user-runtime-dir: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:41:08 +0000 (14:41 +0100)]
logind: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:37:13 +0000 (14:37 +0100)]
inhibit: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 13:34:57 +0000 (14:34 +0100)]
cat: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 11:25:43 +0000 (12:25 +0100)]
import: define mains through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 11:15:35 +0000 (12:15 +0100)]
id128: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 11:13:28 +0000 (12:13 +0100)]
hwdb: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 10:23:02 +0000 (11:23 +0100)]
hostnamectl: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 10:14:16 +0000 (11:14 +0100)]
fsck: configure logging before use and define main through macro
There's a slight change in logic: before, when rebooting the machine, we could
also request quotacheck (by touching /run/systemd/quotacheck) if the fsck
helper set FSCK_ERROR_CORRECTED. This is just a race, and doesn't matter much
in practice.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:59:29 +0000 (10:59 +0100)]
escape: use free_and_replace