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
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 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
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:58:36 +0000 (10:58 +0100)]
escape: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:53:47 +0000 (10:53 +0100)]
detect-virt: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:49:30 +0000 (10:49 +0100)]
coredump: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:44:36 +0000 (10:44 +0100)]
boot-check-no-failures: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:39:57 +0000 (10:39 +0100)]
ac-power: define main through macro
I decided to use a separate definition for this because it's too easy to return
positive from functions which don't need this distinction and only return
negative on error and success otherwise.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:28:36 +0000 (10:28 +0100)]
Introduce main definer and use it in cgtop
This actually fixes one bogus return code in error path.
Lennart Poettering [Fri, 16 Nov 2018 17:08:29 +0000 (18:08 +0100)]
conf-parse: use strjoina() where appropriate
Lennart Poettering [Fri, 16 Nov 2018 17:05:46 +0000 (18:05 +0100)]
conf-parse: drop unused prototype
Lennart Poettering [Fri, 16 Nov 2018 20:04:38 +0000 (21:04 +0100)]
macro: remove double evaluation in FLAGS_SET()
Lennart Poettering [Fri, 16 Nov 2018 21:00:35 +0000 (22:00 +0100)]
rc-local-generator: add comment explaining the background of the generator
This is not obvious, hence it deserves some form of documentation.
However, it's also ultimately an implementation detail, hence let's not
add this to the man page, but as a code comment, that is visible right
at the top of source file.
Fixes: #10675
Evgeny Vereshchagin [Fri, 16 Nov 2018 20:23:56 +0000 (21:23 +0100)]
tests: add a fuzzer for process_audit_string
asavah [Fri, 16 Nov 2018 19:02:00 +0000 (21:02 +0200)]
fix build with -Defi=false
Lennart Poettering [Fri, 16 Nov 2018 20:46:49 +0000 (21:46 +0100)]
logind: voidify more things
Lennart Poettering [Fri, 16 Nov 2018 20:44:36 +0000 (21:44 +0100)]
logind: when we need to execute a sleep operation we don't support, fall back to suspend
If suspend-then-hibernate, hybrid-sleep or plain hibernation is
supposed to be execute due to a key press/lid switch but is not
supported, automatically fall back to plain suspend (and log about it).
Fixes: #10558
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 18:46:43 +0000 (19:46 +0100)]
TODO: add entry
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 09:09:45 +0000 (10:09 +0100)]
core: introduce a helper function to wrap unit_log_{success,failure}
It's inline so that the compiler can easily optimize away the call to get
status string.
Lennart Poettering [Fri, 16 Nov 2018 16:55:08 +0000 (17:55 +0100)]
Merge pull request #10805 from poettering/migrate-boot-loader-interface
migrate boot loader interface doc from wiki into markdown (split out of #10495)
Lennart Poettering [Fri, 16 Nov 2018 16:54:43 +0000 (17:54 +0100)]
Merge pull request #10751 from yuwata/sd-event-util
Reuse sd_event_source object for timer event
Lennart Poettering [Fri, 16 Nov 2018 16:54:19 +0000 (17:54 +0100)]
Merge pull request #10770 from poettering/unit-done-log
improvements to structure log events from PID1
Lennart Poettering [Fri, 16 Nov 2018 16:53:50 +0000 (17:53 +0100)]
Merge pull request #10777 from poettering/seccomp-filter-others
list syscalls supported by the local kernel but not in any syscall groups explicitly in "systemd-analyze syscall-filter"
Lennart Poettering [Fri, 16 Nov 2018 16:53:26 +0000 (17:53 +0100)]
Merge pull request #10785 from poettering/cgroup-join-removal
remove JoinControllers= setting
Lennart Poettering [Fri, 16 Nov 2018 16:53:01 +0000 (17:53 +0100)]
Merge pull request #10802 from poettering/hide-only-on
man: let's deprecate PermissionsStartOnly=
Lennart Poettering [Fri, 16 Nov 2018 16:52:37 +0000 (17:52 +0100)]
Merge pull request #10804 from poettering/sd-boot-updates
various sd-boot/EFI fixes (split out from #10495)
Lennart Poettering [Fri, 16 Nov 2018 16:52:11 +0000 (17:52 +0100)]
Merge pull request #10806 from poettering/logind-many-fixes
various smaller fixes and improvements to logind (split out of #10495)
Lennart Poettering [Tue, 23 Oct 2018 14:29:28 +0000 (16:29 +0200)]
docs: tweak index.md generation and run it again
Lennart Poettering [Tue, 23 Oct 2018 14:28:30 +0000 (16:28 +0200)]
docs: migrate boot loader interface from fdo wiki to git
This imports
https://www.freedesktop.org/wiki/Software/systemd/BootLoaderInterface/
into our sources, and extends it substantially with various variables
now supported.
Zbigniew Jędrzejewski-Szmek [Fri, 16 Nov 2018 15:20:31 +0000 (16:20 +0100)]
docs/TRANSIENT-SETTINGS: drop PermissionsStartOnly= from
Lennart Poettering [Wed, 14 Nov 2018 18:59:27 +0000 (19:59 +0100)]
analyze: add some minimal ANSI highlighting of syscall-filter output
Lennart Poettering [Wed, 14 Nov 2018 18:53:49 +0000 (19:53 +0100)]
seccomp: add some missing syscalls to filter sets