1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00
Commit Graph

35984 Commits

Author SHA1 Message Date
Lennart Poettering
f06ba264bc man: document the new combined --vacuum*= and --rotate invocation 2018-10-25 21:44:48 +02:00
Lennart Poettering
e5b2d45c1d journalctl: fix error number in error message 2018-10-25 21:44:48 +02:00
Lennart Poettering
8df64fd01d journalctl: add ability to vacuum and rotate in one step
journalctl --vacuum-*= only vacuums archived files. To archive all
active files the rotate operation is used. Let's add a new switch that
combines both, so that the user a single command to first move all
running journal files into archival and then vacuum them.

See: #1017
2018-10-25 21:44:48 +02:00
Lennart Poettering
d03077759e journald: log about an OOM condition 2018-10-25 21:44:48 +02:00
Lennart Poettering
e859154447 journald: debug log when we cannot read the machine ID 2018-10-25 21:44:48 +02:00
Lennart Poettering
6812765891 journal-file: refactor journal_file_open_reliably()
Let's split out the part that actually renames the file in case we can't
open it into a new function journal_file_dispose().

This way we can reuse the function in other cases where we want to open
a file but can't.
2018-10-25 21:43:09 +02:00
Lennart Poettering
7a4d21ad20 journal-file: refactor journal_file_rotate()
Let's split the function in three: the part where we archive the old
file into journal_file_archive(), and the part where we initiate the
deferred closing into journal_file_initiate_close().
journal_file_rotate() then simply becomes a wrapper around these two
calls, and the opening of the new journal file.

This useful so that we can archive journal files without having to open
new ones, i.e. to do only the archival part of the rotation, without the
rotation part.
2018-10-25 21:43:09 +02:00
Lennart Poettering
f760d8a858 journal: refactor out loop that processes deferred closes into its own function 2018-10-25 21:43:09 +02:00
Lennart Poettering
180e7f4e62 journal: fix some type confusion in journal_directory_vacuum()
Let's store array sizes and indexes in size_t. And let's count numbers
of files in uint64_t (simply because that is the type of the input
parameter for this of the function)
2018-10-25 21:43:09 +02:00
Lennart Poettering
ab41da087d journald: use structured initialization 2018-10-25 21:42:05 +02:00
Lennart Poettering
6761e0a2fd journald: use usec_sub_unsigned() where we can 2018-10-25 21:42:05 +02:00
Zbigniew Jędrzejewski-Szmek
05f339267e
Merge pull request #10378 from poettering/json-fuzz-fix
json: a comprehensive fix for oss-fuzz#10908
2018-10-25 16:25:39 +02:00
Lennart Poettering
5ec1fca41e
Merge pull request #10518 from poettering/dhcp6-size-fixes
dhcp6 packet size calculation fixes
2018-10-25 13:29:42 +02:00
Zbigniew Jędrzejewski-Szmek
5b8b8056eb
Merge pull request #10504 from poettering/hibernate-fallback
s2h: when hibernate fails after coming back from suspend, go back to suspend
2018-10-25 12:54:47 +02:00
Martin Wilck
e1e74614aa core: don't create Requires for workdir if "missing ok"
Don't add an implicit RequiresMountsFor depenency for the
WorkingDirectory of a unit if the "-" character was used to
indicate that "a missing working directory is not considered fatal"
(see systemd.exec(5)). Otherwise systemd might fail the unit
because of missing dependencies.
2018-10-25 11:35:59 +02:00
Lennart Poettering
20b55f8538 dhcp6: prefer offsetof() over sizeof() for structs with undefined sizes
This doesn't change anything in the generated source, but I think makes
semantically more sense, as these structures have undefined size, and we
only want to know the size up to the data field in these cases.
2018-10-25 11:23:19 +02:00
Lennart Poettering
4dac5eaba4 dhcp6: make sure we have enough space for the DHCP6 option header
Fixes a vulnerability originally discovered by Felix Wilhelm from
Google.

CVE-2018-15688
LP: #1795921
https://bugzilla.redhat.com/show_bug.cgi?id=1639067
2018-10-25 11:23:19 +02:00
Lennart Poettering
990668aa4c dhcp6: reduce whitespace a bit 2018-10-25 11:23:19 +02:00
Lennart Poettering
3c290c0316 dhcp6: split assert_return() to be more debuggable when hit 2018-10-25 11:23:19 +02:00
Lennart Poettering
e0a18b74a3 dhcp6: constify things where we can 2018-10-25 11:23:19 +02:00
Yu Watanabe
4e412d2684
string-util: fix prototype of explicit_bzero_safe() (#10513)
Follow-up for 87f5446311.
2018-10-25 11:41:55 +09:00
Lennart Poettering
def34f63fe time-util: change parse_sec_fix_0() to accept "0s" for infinity too (#10501)
This function is about compatibility, nothing else, hence we should make
it properly compatible.

Fixes: #9556
2018-10-25 05:21:28 +09:00
Lennart Poettering
d776fd08a3
Merge pull request #10510 from poettering/uacess-brackets
coverity fixes
2018-10-24 22:18:33 +02:00
Lennart Poettering
5ee91c0dbc man: fix wording a bit on the cgroup accountings options (#10509)
The &MEMORY_ACCOUNTING_DEFAULT; resolves to "yes" or "no" while the rest
of the paragraph talked about "on" and "off". Let's adjust this and
stick to "yes" and "no"...

Quite frankly I think it's not a particularly good idea to change the
docs based configuration changes... THis can only be incomplete, and the
wording is still very awkward since we repeat the same sentence twice.
2018-10-25 05:08:07 +09:00
Lennart Poettering
c069e28961
Merge pull request #10505 from poettering/have-namespace
skip various test-execute tests when we have no namespacing
2018-10-24 22:00:42 +02:00
Lennart Poettering
73f19ce1ae units: drop systemd-user-sessions.service ordering dep on systemd-journal-flush.service (#10502)
THis dep existed since the unit was introduced, but I cannot see what
good it would do. Hence in the interest of simplifying things, let's
drop it. If breakages appear later we can certainly revert this again.

Fixes: #10469
2018-10-25 04:41:02 +09:00
Lennart Poettering
87f5446311 string-util: introduce explicit_zero_safe()
The only real difference is that this wrapper can deal with NULL
pointer arguments, but only if the length is also zero.

CID 1396277
2018-10-24 21:00:15 +02:00
Lennart Poettering
7388cea30d udev: use right error variable to make level decision 2018-10-24 20:47:52 +02:00
Lennart Poettering
dc4fedd8cb udev: fix bad if {}
CID 1396318
CID 1396319
2018-10-24 20:46:41 +02:00
Lennart Poettering
5f00dc4df6 test: skip various tests if namespacing is not available
Apparently on Debian LXC/AppArmor doesn't allow namespacing to container
payloads. Deal with it.

Fixes: #9700
2018-10-24 19:40:24 +02:00
Lennart Poettering
a4bc3c1d25 tests: add helper call have_namespaces() to test whether Linux namespaces are available
A slighly sloppy test call for conditionalizing several tests.
2018-10-24 19:40:24 +02:00
Lennart Poettering
795919efdf tests: as per CODING_STYLE undefine basename() right after including libgen.h 2018-10-24 17:08:12 +02:00
Lennart Poettering
eca27ebbc8 tests: alloc-util.h and fs-util.h are our own headers
Hence include them with "" rather than <>. Also including them twices is
a pretty bad idea too.
2018-10-24 17:08:12 +02:00
Lennart Poettering
2194547e3b execute: if we fail to do namespacing, explain why we refuse to continue in a debug message 2018-10-24 17:08:12 +02:00
Lennart Poettering
f05e1ae666 sleep: when we can't hibernate on suspend-then-hibernate, fall back to suspend again
Let's make this a bit safer, and try hard to return to sleep, if we can
at all.

Fixes: #10212
2018-10-24 14:44:14 +02:00
Lennart Poettering
14250f0942 sleep: rework what we do if a suspend fails.
First of all, let's fix logging: let's simply log the same message as we
do on success, so that there's always the same pair of these messages
around, regardless if the suspend was successful or not. To distuingish
a successful suspend from a failed one, check the ERRNO= field of the
structured message.

In most ways a failed suspend cycle is not distuingishable from a
successful one that took no time, hence let's treat it this way, and
always pair the success message with a failure message.

This also changes a more important concept: the post-suspend callouts
are now called also called on failure, following the same logic: let's
always run them in pairs: for every pre callout a post callout has to
follow.
2018-10-24 13:07:53 +02:00
Lennart Poettering
c695101f47 sleep: no need to check for resume_offset twice
The W_OK check already checks for existance hence let's remove the F_OK
check.
2018-10-24 12:57:37 +02:00
Lennart Poettering
eabcf200f7 sleep: let's turn off the RTC alarm time ASAP
Let's be a tiny bit more careful here.

Also, let's rearrange things to simplify them a bit, and to not use "r"
outside of its immediate scope of validity.
2018-10-24 12:52:11 +02:00
Lennart Poettering
d029a3a8ca sleep: round up when calculating RTC sleep time
Paranoia: this way we know that when we wake up all timers are
definitely equal or ahead of what we expect them to be.
2018-10-24 12:48:56 +02:00
Lennart Poettering
033cea5c9d sleep: move log message generation for rtc_read_time() into the function itself
The log messages were petty borked anyway, and generated at two separate
locations. Let's fix that.
2018-10-24 12:47:46 +02:00
Lennart Poettering
f780e438fa sleep: rework write_wakealarm() to take a numeric parameter
Also, let's rename it to rtc_write_wake_alarm(). Both changes together
make sure rtc_write_wake_alarm() and rtc_read_time() are more alike in
their naming and semantics.
2018-10-24 12:46:12 +02:00
Lennart Poettering
c16669a309 sleep: rename read_wakealarm() → rtc_read_time()
It doesn't read wakealarm, but the current time of the RTC. Hence, let's
rename this to make it less misleading.
2018-10-24 12:44:20 +02:00
Lennart Poettering
6ce63245f6 sleep: log about the correct errors 2018-10-24 12:38:13 +02:00
Lennart Poettering
58220e6b91 sleep: don't make up errors, propagate the right ones 2018-10-24 12:38:04 +02:00
Lennart Poettering
f00aff0a02 sleep: let's use write_string_file() instead of write_string_stream() if we can
Let's shorten things.
2018-10-24 12:35:49 +02:00
Lennart Poettering
d1db1c438f
Merge pull request #10484 from yuwata/udev-spawn-simplify
udev-event: cleanups about udev_event_spawn()
2018-10-24 10:57:45 +02:00
Lennart Poettering
e7b48c45ae
Merge pull request #10498 from yuwata/udev-builtin-log
udev-builtin: use log_device_*() macros
2018-10-24 10:53:35 +02:00
Lennart Poettering
77d28bd10f
Merge pull request #10483 from yuwata/udev-cleanup-10
tree-wide: use log_device_*()
2018-10-24 10:51:53 +02:00
Lennart Poettering
086712f99f
Merge pull request #10461 from yuwata/small-cleanups
Fixes recent defects reported by coverity
2018-10-24 10:36:20 +02:00
Jiuyang liu
a2f577fca0 add ephemeral to nspawn-settings. 2018-10-24 10:22:20 +02:00