Commit graph

33553 commits

Author SHA1 Message Date
Susant Sahani cea79e6643 networkd: Support the ability to set MTU in [Route] sections
Add support to set the route MTU.

Closes #9047
2018-05-24 16:42:40 +02:00
Zbigniew Jędrzejewski-Szmek 45748f098e
Merge pull request #9020 from poettering/physical-memory-cgroupsv2
make sure physical_memory() groks cgroupsv2
2018-05-24 16:30:46 +02:00
Zbigniew Jędrzejewski-Szmek 17c1b9a93f
Merge pull request #9024 from poettering/nspawn-attrs-more
make even more nspawn concepts configurable
2018-05-24 16:27:27 +02:00
Zbigniew Jędrzejewski-Szmek 7cd92e2e9d
Merge pull request #9068 from poettering/nspawn-pty-deadlock
nspawn logging deadlock fix
2018-05-24 16:25:22 +02:00
Lennart Poettering a7b46b7d72 logind: let's change the type of the runtime directory size to uint64_t
Externally it's an uint64_t anyway, and internally we most just
initialize it to physical_memory() which returns uint64_t, hence there's
exactly zero value in using it as size_t internally. Hence, let's fix
that, and use uint64_t everywhere.
2018-05-24 12:14:48 +02:00
Lennart Poettering 0f578ea2ea util: add debug logging to system_tasks_max()
We should always do debug logging when we eat up error conditions. Let's
do so here too.
2018-05-24 12:14:48 +02:00
Lennart Poettering bd969ee6ef util: fix physical_memory() to work correctly on cgroupsv2
Let's look into the right cgroupsv2 attribute.

Also, while we are at it, add debug logging for all error conditions we
eat up silently otherwise.
2018-05-24 12:14:48 +02:00
Yu Watanabe 6e2d744b2f doc: mention in NEWS that AF_INET{,6} are dropped from logind
Closes #9072.
2018-05-24 12:05:54 +02:00
Lennart Poettering 2ad98f977f
Merge pull request #9040 from yuwata/resolved-networkd-use-dynamic-user
Set DynamicUser= to resolved and networkd
2018-05-23 21:10:39 +02:00
Franck Bui 264afce098 install: "user" and "global" scopes are equivalent for user presets
Otherwise querying the preset status of a unit to the user instance gives
incorrect results since in this case the scope used by the manager is
UNIT_FILE_USER.
2018-05-23 21:08:27 +02:00
Lennart Poettering 97745ac601
Merge pull request #9039 from yuwata/fix-device-allow
core: support unit specifiers in IODeviceWeight= and friends
2018-05-23 21:07:22 +02:00
Zbigniew Jędrzejewski-Szmek 0341192035
Merge pull request #9067 from thedrow/patch-1
Enable ccache and mount it into the build/test container
2018-05-23 14:35:39 +02:00
Will Thompson da6c7806fd tmpfiles: fix documented constant for exit code 73
sysexits.h has:

    #define EX_CANTCREAT	73	/* can't create (user) output file */

EX_DATAERR is a copy-paste error from the previous sentence, which is
correct.
2018-05-22 18:35:34 +02:00
Zbigniew Jędrzejewski-Szmek 14d0afb94d
Merge pull request #9065 from poettering/fixup-tab-double-newline
tree-wide: fix some TABs and double newlines
2018-05-22 17:14:48 +02:00
Lennart Poettering 17cac366ae nspawn: make sure our container PID 1 keeps logging to the original stderr as long as possible
If we log to the pty that is configured as stdin/stdout/stderr of the
container too early we risk filling it up in full before we start
processing the pty from the parent process, resulting in deadlocks.
Let's hence keep a copy of the original tty we were started on before
setting up stdin/stdout/stderr, so that we can log to it, and keep using
it as long as we can.

Since the kernel's pty internal buffer is pretty small this actually
triggered deadlocks when we debug logged at lot from nspawn's child
processes, see: https://github.com/systemd/systemd/pull/9024#issuecomment-390403674

With this change we won't use the pty at all, only the actual payload we
start will, and hence we won't deadlock on it, ever.
2018-05-22 16:52:50 +02:00
Lennart Poettering 8ca082b49a nspawn: make use of log_set_open_when_needed() in nspawn too
Let's make use of log_set_open_when_needed() in nspawn too, i.e. at the
point where we close logging because we are about to rearrange fds,
let's automatically reopen the logging fds when we need them, the same
way as we do that in the service manager. This makes things simpler and
more robust.
2018-05-22 16:51:28 +02:00
Omer Katz 94153a7fd9
Install ccache in container. 2018-05-22 17:48:14 +03:00
Omer Katz 93727cf7b0
Enable ccache and mount it into the build/test container. 2018-05-22 17:45:19 +03:00
Lennart Poettering 72d711efa3 update TODO 2018-05-22 16:21:26 +02:00
Lennart Poettering f728ab1724 nspawn: let's rename _FORCE_ENUM_WIDTH → _SETTING_FORCE_ENUM_WIDTH
Just some preparation in case we need a similar hack in another enum one
day.
2018-05-22 16:21:26 +02:00
Lennart Poettering 1688841f46 nspawn: similar to the previous patches, also make /etc/localtime handling more configurable
Fixes: #9009
2018-05-22 16:21:26 +02:00
Lennart Poettering 63d1c29ffa nspawn: complain if people still use --share-system 2018-05-22 16:20:08 +02:00
Lennart Poettering 4e1d6aa983 nspawn: make --link-journal= configurable through .nspawn files, too 2018-05-22 16:20:08 +02:00
Lennart Poettering b8ea7a6e12 nspawn: add a bit of debug logging to resolved_listening() 2018-05-22 16:19:26 +02:00
Lennart Poettering 09d423e921 nspawn: add greater control over how /etc/resolv.conf is handled
Fixes: #8014 #1781
2018-05-22 16:19:26 +02:00
Lennart Poettering 8904ab86b0
Merge pull request #9062 from poettering/parse-conf-macro
add new CONFIG_PARSER_PROTOTYPE() macro
2018-05-22 16:14:49 +02:00
Zbigniew Jędrzejewski-Szmek 52d2566ac7 pid1: fix ShowStatus property
It is not const, because a) systemd can bump it on its own if
errors occur, and b) the user can change it using signals.
Also it's not boolean.

$ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ShowStatus
b true
$ sudo kill -SIGRTMIN+21 1
$ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ShowStatus
b false

Fixes #4503.
2018-05-22 16:14:20 +02:00
Lennart Poettering 56b00d0028 tree-wide: remove some double newlines in headers, too 2018-05-22 16:13:45 +02:00
Lennart Poettering 3dfd31c8d2 find-double-newline: look in headers too 2018-05-22 16:13:45 +02:00
Lennart Poettering a5201ed6ce tree-wide: fix a couple of TABs 2018-05-22 16:13:45 +02:00
Lennart Poettering 8244a87768 tools: add a script for fixing up TABs
This is similar to "find-double-newline.sh" but looks for TABs that
should not be there.
2018-05-22 16:13:45 +02:00
Yu Watanabe d4e9e574ea network: set DynamicUser= to systemd-networkd.service 2018-05-22 22:37:34 +09:00
Yu Watanabe 0187368cad resolve: enable DynamicUser= for systemd-resolved.service 2018-05-22 22:32:25 +09:00
Yu Watanabe fdff1da299 core: chown RuntimeDirectory= if DynamicUser= is set
When DynamicUser= is set, then RuntimeDirectory= should be always
chowned, as the service unit may enable RuntimeDirectoryPreserve=,
and the uid or gid may changed from the last run.
This also makes easier to migrate the service to use DynamicUser=.
2018-05-22 22:26:22 +09:00
Yu Watanabe 906cb2eb74 timesync,shared: move logic requesting bus name to shared
Preparation for setting DynamicUser= to other services which
request bus names.
2018-05-22 22:20:17 +09:00
Yu Watanabe be80154827 unit: drop After=systemd-sysusers.service from timesyncd
After=systemd-sysusers.service is not necessary, as timesyncd
already enables DynamicUser=.
2018-05-22 22:20:17 +09:00
Arnaud Rebillout c9fe05e07d nspawn: support pivot-root option during directory validation
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2018-05-22 14:42:10 +02:00
Lennart Poettering 2fcbdd2d3f
Merge pull request #9059 from keszybz/rm-rf-generators
Allow removing generators dirs on real fs
2018-05-22 14:30:03 +02:00
Lennart Poettering c0d7a4f0cd
Merge pull request #9061 from poettering/dump-string-table
add new DUMP_STRING_TABLE() macro and make use of it everywhere
2018-05-22 14:28:38 +02:00
Lennart Poettering c1104417b7
Merge pull request #9058 from keszybz/fun-with-uint64_c
Fun with UINT64_C
2018-05-22 13:23:56 +02:00
Lennart Poettering 5f92e51763 conf-parser: make use of free_and_replace() at one more place 2018-05-22 13:18:44 +02:00
Lennart Poettering a210692525 tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macro
This makes most header files easier to look at. Also Emacs gets really
slow when browsing through large sections of overly long prototypes,
which is much improved by this macro.

We should probably not do something similar with too many other cases,
as macros like this might help readability for some, but make it worse
for others. But I think given the complexity of this specific prototype
and how often we use it, it's worth doing.
2018-05-22 13:18:44 +02:00
Lennart Poettering 1f12b48a73 config-parser: introduce new CONFIG_PARSER_PROTOTYPE() macro
This builds on the previous GENERIC_PARSER_ARGS macro work. I think in
general it is a better idea to declare macros that generate full C
statements instead of just parts of them, hence, let's introduce
CONFIG_PARSER_PROTOTYPE() which defines a full C function prototype,
instead of the pre-existing way of defining the C function prototype
manually, but then using GENERIC_PARSER_ARGS to define its arguments.

This doesn't drop GENERIC_PARSER_ARGS though, but renames it to
CONFIG_PARSER_ARGUMENTS, and changes the ConfigParserCallback function
type to use it. The new name follows more closely how the other symbols
in the header are named.
2018-05-22 13:18:44 +02:00
Lennart Poettering 398246292e detect-virt: add new --list command for showing all currently known VM/container envs 2018-05-22 13:14:18 +02:00
Lennart Poettering 5c828e66b5 tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro 2018-05-22 13:14:18 +02:00
Lennart Poettering 081a0c7256 volatile-mode: use the usual string table macros for implementing volatile_mode_from_string()
Let's shorten our code a bit, and also add the matching _to_string()
call.
2018-05-22 13:14:18 +02:00
Lennart Poettering abdf29f50d coredumpctl: always output proper english sentence
Let's uppercase the first character, and finish them in a full stop.
2018-05-22 13:14:18 +02:00
Lennart Poettering d34f3bc4e5 string-table: add new DUMP_STRING_TABLE() macro
The macro is inspired by the other string table macros, and takes the
same arguments in the same order and dumps a string table to stdout.
Since it's typesafe it's nice to implement this as macro rather than
regular function.

This new macro is useful for implementing commands such as "systemctl -t
help" and similar, i.e. wherever we want to dump all values of an enum
to stdout.
2018-05-22 13:14:18 +02:00
Zbigniew Jędrzejewski-Szmek 114110cdf1 Generator dirs might be on a real filesystem
Most of the time, tmpfs is used for /tmp, but this is not required.
Applied to both pid1 and systemd-analyze verify.

Fixes #8592.
2018-05-22 12:04:39 +02:00
Zbigniew Jędrzejewski-Szmek 265e9be772 basic/rm-rf: include the path in error messages
Attempted to remove disk file system under "/tmp/systemd-temporary-aWPkbQ", and we can't allow that.
2018-05-22 12:04:39 +02:00