Commit graph

27381 commits

Author SHA1 Message Date
afg c152a2ba54 nspawn: allow Capability=all in systemd.nspawn [EXEC] section
Just like --capability=all is allowed in the systemd-nspawn
command line.
2019-11-29 14:42:27 +01:00
Yu Watanabe 3db7d5d2bf network: fix double free() 2019-11-28 19:50:45 +01:00
Lennart Poettering 806c6a5b97 journald: don't ask for the machine ID if we don't need it 2019-11-28 15:46:01 +01:00
Lennart Poettering 3aebd9d6dd journalctl: pager_close() calls fflush(stdout) anyway as first thing 2019-11-28 15:15:24 +01:00
Lennart Poettering c31469e2ee journald: remove unused field 2019-11-28 15:14:58 +01:00
Lennart Poettering 2275b74741 journalctl: return EOPNOTSUPP if pcre is not enabled 2019-11-28 15:02:36 +01:00
Lennart Poettering 6f63c5b8b1 notify: add color to --help
We do that for most tools now, do so here now, too.
2019-11-28 11:41:24 +01:00
Lennart Poettering 37a92352d6 nspawn: highlight description string in --help text
We do so in most tools now, do so here, too.
2019-11-28 11:41:24 +01:00
Yu Watanabe d2a56598d0
Merge pull request #14166 from keszybz/transient-unit-settings
Fix docs and some transient unit property passing
2019-11-28 17:23:30 +09:00
Kevin Kuehler 6da498c28f shared/ask-password-api: modify keyctl break value
We can break if KEYCTL_READ return value is equal to our buffer size.

From keyctl(2):

On a successful return, the return value is always the total size of
the payload data.  To determine whether the buffer was of sufficient
size, check to see that the return value is less than or equal to the
value supplied in arg4.
2019-11-28 08:58:29 +01:00
Lennart Poettering a434236acc systemctl: fix indentation of cgroup tree
Follow-up for 0d588deae2.

In that commit the output got moved a 2 chars to the right, hence make
sure to also shift the cgroup tree to the right, so that it gets
properly aligned under the cgroup path again.
2019-11-27 18:34:53 +01:00
Michal Sekletár 408c81f624 cryptsetup: reduce the chance that we will be OOM killed
cryptsetup introduced optional locking scheme that should serialize
unlocking keyslots which use memory hard key derivation
function (argon2). Using the serialization should prevent OOM situation
in early boot while unlocking encrypted volumes.
2019-11-27 18:34:36 +01:00
Lennart Poettering 6cf5c3318f
Merge pull request #14164 from poettering/exec-start-transient-fix
fix ExecStart= line generation for transient units
2019-11-27 18:32:30 +01:00
Zbigniew Jędrzejewski-Szmek cddaeae6f4
Merge pull request #14145 from poettering/process-bypass
/proc bypass in various process-util.c calls
2019-11-27 14:53:39 +01:00
Zbigniew Jędrzejewski-Szmek e737017b85 pid1: make TimeoutAbortSec settable for transient units
It was documented to be, but implementation was missing.
2019-11-27 13:56:29 +01:00
Zbigniew Jędrzejewski-Szmek a61d68748a pid1: fix setting of DefaultTimeoutAbortSec
This partially reverts a07a7324ad.
We have two pieces of information: the value and a boolean.
config_parse_timeout_abort() added in the reverted commit would write
the boolean to the usec_t value, making a mess.

The code is reworked to have just one implementation and two wrappers
which pass two pointers.
2019-11-27 13:56:28 +01:00
Zbigniew Jędrzejewski-Szmek b9d9fbe411 shared/conf-parser: remove unnecessary whitespace skipping
The conf-parser machinery already removed whitespace before and after "=", no
need to repeat this step.

The test is adjusted to pass. It was testing an code path that doesn't happen
normally, no point in doing that.
2019-11-27 13:56:28 +01:00
Zbigniew Jędrzejewski-Szmek c57d2a76c5 shared/bus-unit-util: word wrap
Having all the names squished on the same line makes it hard to see
what settings are missing.
2019-11-27 13:56:28 +01:00
Lennart Poettering 540ac9338e core: prefer non-@ syntax for ExecStart=
If the zeroth and first argv[] element on the same we don't need to
generate the "@" syntax for ExecStart= and friends.
2019-11-27 12:32:14 +01:00
Lennart Poettering f14bf01312 core: write out correct field name when creating transient service units 2019-11-27 12:23:00 +01:00
Martin Wilck 030f457167 udevd: don't use monitor after manager_exit()
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.

Fix this by testing the validity of manager->monitor in on_sigchld().
2019-11-26 20:38:28 +01:00
Martin Wilck 3cabdc2345 Revert "udevd: fix crash when workers time out after exit is signal caught"
This reverts commit 5db454b8031c58a743cc4ee3d5d1dd01dcff17e8.
See https://github.com/systemd/systemd/issues/14128
2019-11-26 20:38:28 +01:00
Lennart Poettering 72fd79b3ce test-fileio: cast EOF to (char) before comparing with char explicitly
EOF is defined to -1, hence on platforms that have "char" unsigned we
can't compare it as-is, except if we accept an implicit cast. let's make
it an explicit cast, acknowledging the issue.

Fixes: #14118
2019-11-26 14:55:47 +01:00
Yu Watanabe 6eee88577d udev: tiny update for log messages 2019-11-26 10:42:54 +01:00
Yu Watanabe f5c3892266
network: also assume Table=local for ipv6 route if Type=local, broadcast, anycast or nat (#14148)
Also, if Type=multicast and scope is not set, then assume Scope=link.

Fixes #14122.
2019-11-26 12:41:54 +09:00
Yu Watanabe cfbb1c6def
Merge pull request #14134 from keszybz/variables-and-docs
Documentation and option parsing fixes
2019-11-26 12:40:30 +09:00
Anita Zhang 05d6628ad2
Merge pull request #14151 from mk-fg/fix-timer-dump-syntax-bug
core.timer: fix "systemd-analyze dump" and docs syntax inconsistencies wrt OnTimezoneChange=
2019-11-25 15:56:33 -08:00
Mike Kazantsev 0810e39628 core.timer: fix "systemd-analyze dump" and docs syntax inconsistencies wrt OnTimezoneChange= 2019-11-26 04:29:03 +05:00
Anita Zhang 9b1f0b9064
Merge pull request #14112 from keszybz/restart-no-log
core/service: downgrade "scheduling restart" message to debug
2019-11-25 12:09:00 -08:00
Lennart Poettering 5c7b99745a process-util: shortcut get_process_state() for our own process 2019-11-25 19:23:31 +01:00
Lennart Poettering cde93ba2a5 process-util: shortcut get_process_comm() for our own process
Let's bypass /proc if we can.
2019-11-25 19:23:31 +01:00
Lennart Poettering aad3a64d63 process-util: tweak get_process_cwd() when calling for own process
Let's bypass /proc if we can.
2019-11-25 15:01:53 +01:00
Zbigniew Jędrzejewski-Szmek 0b8d307587 pid1: fix the names of AllowedCPUs= and AllowedMemoryNodes=
The original PR was submitted with CPUSetCpus and CPUSetMems, which was later
changed to AllowedCPUs and AllowedMemmoryNodes everywhere (including the parser
used by systemd-run), but not in the parser for unit files.

Since we already released -rc1, let's keep support for the old names. I think
we can remove it in a release or two if anyone remembers to do that.

Fixes #14126. Follow-up for 047f5d63d7.
2019-11-25 14:02:14 +01:00
Mike Gilbert e05b7c0955 test-proc-cmdline: disable EFI-dependent tests when EFI is disabled
Fixes: https://github.com/systemd/systemd/issues/14116
2019-11-25 08:37:09 +01:00
Zbigniew Jędrzejewski-Szmek c484315b01 basic/terminal-util: add support for $NO_COLOR
See inline comments. Fixes #13752.
2019-11-24 13:59:22 +01:00
Zbigniew Jędrzejewski-Szmek 58c0663b97
Merge pull request #14099 from keszybz/machine-ref-unref-fix
Fix for the issue when machine cannot be started second time, and better nspawn logging
2019-11-22 14:33:27 +01:00
Zbigniew Jędrzejewski-Szmek 868f7d36cc core/service: downgrade "scheduling restart" message to debug
I see we log this during every boot, even though it is a routine expected event:
Nov 12 14:50:01 krowka systemd[1]: systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
(and for other services too). Let's downgrade this to debug level.

https://bugzilla.redhat.com/show_bug.cgi?id=1614871
2019-11-22 14:19:51 +01:00
Lennart Poettering f1194f5d59 varlink: fix enablement of varlink timeout event source 2019-11-22 10:54:52 +01:00
Lennart Poettering c4fe0cbc17 varlink: drop too much whitespace 2019-11-22 10:54:52 +01:00
Lennart Poettering 88a36d3690 varlink: port varlink code over to use getdtablesize() for sizing number of concurrent connections
Use the official glibc API for determining this parameter. In most other
cases in our tree it's better to go directly for RLIMIT_NOFILE since
it's semantically what we want, but for this case it appears more
appropriate to use the friendlier, shorter, explicit API.
2019-11-22 10:54:52 +01:00
Lennart Poettering a0c41de277 varlink: move connection fds > fd2
We want to use this code in NSS modules, and we never know the execution
environment we are run in there, hence let's move our fds up to ensure
we won't step into dangerous fd territory.

This is similar to how we already do it in sd-bus for client connection
fds.
2019-11-22 10:54:52 +01:00
Lennart Poettering 45a6c96598 varlink: fix support for more/continues method calls 2019-11-22 10:54:52 +01:00
Zbigniew Jędrzejewski-Szmek 698876640d machine: fold machine_stop_scope() into machine_stop()
No functional change.
2019-11-22 10:24:32 +01:00
Zbigniew Jędrzejewski-Szmek eec12b7756 machined: simplify reference handling for units
Before, we'd unref from machine_stop_unit, still keeping the unit name around,
and only forget the name later, when garbage collecting. If we didn't call
manager_stop_unit(), then we wouldn't do the unref. Let's unref at the same
point where we do garbage collection, so that it is always true that
iff we have the name generated with AddRef=1, then have a reference to the unit,
and as soon as we forget the name, we drop the reference.

This should fix the issue when repeated systemd-nspawn --register=yes fails
with "scope already exists" error.

Incidentally, this fixes an error in the code path where r was used instead of q.
2019-11-22 10:24:32 +01:00
Zbigniew Jędrzejewski-Szmek a01ecfa982 machine: simplify machine_start_scope()
It is called from only one place, and we can make things simpler by calculating the
necessary stuff directly in the function. No functional change.
2019-11-22 10:24:29 +01:00
Zbigniew Jędrzejewski-Szmek af22794712 machine: make machine_start_scope() static
Having this function which is called only from one place in a separate file
makes the code harder to follow. In preparation for subsequent changes, let's
make it static.
2019-11-22 10:23:32 +01:00
Zbigniew Jędrzejewski-Szmek f47bd09749 nspawn: log syscalls we cannot add at debug level
Without out at least a debug log line it is hard to figure out when something
goes wrong.

Reduce scope of a variable while at it.
2019-11-22 10:23:32 +01:00
Zbigniew Jędrzejewski-Szmek 8a99bd0c46 nspawn: dump capability list with --capabilities=help 2019-11-22 10:15:46 +01:00
Zbigniew Jędrzejewski-Szmek 353a6f293e
Merge pull request #14081 from poettering/xattr-list-rework
xattr-util rework and addition of flistxattr_malloc() helper plus test
2019-11-22 09:18:24 +01:00
Lennart Poettering 351de38e4b bootctl: make 'random-seed' handle inability to write system token EFI variable gracefully
Apparently some firmwares don't allow us to write this token, and refuse
it with EINVAL. We should normally consider that a fatal error, but not
really in the case of "bootctl random-seed" when called from the
systemd-boot-system-token.service since it's called as "best effort"
service after boot on various systems, and hence we shouldn't fail
loudly.

Similar, when we cannot find the ESP don't fail either, since there are
systems (arch install ISOs) that carry a boot loader capable of the
random seed logic but don't mount it after boot.

Fixes: #13603
2019-11-21 19:55:17 +01:00