Commit graph

26351 commits

Author SHA1 Message Date
Kyle Walker 1e706c8dff manager: Fixing a debug printf formatting mistake (#3640)
A 'llu' formatting statement was used in a debugging printf statement
instead of a 'PRIu64'. Correcting that mistake here.
2016-07-01 20:03:35 +03:00
Lennart Poettering b12cc5b0f8 Merge pull request #3634 from disneyworldguy/v2sigchld
manager: Only invoke a single sigchld per unit within a cleanup cycle
2016-06-30 15:57:39 -07:00
Lennart Poettering 2cb623954f Fix #3236 (#3633)
* networkd: condition_test() can return a negative error, handle that

If a condition check fails with an error we should not consider the check
successful. Fix that.

We should probably also improve logging in this case, but for now, let's just
unbreak this breakage.

Fixes: #3236

* condition: handle unrecognized architectures nicer

When we encounter a check for an architecture we don't know we should not
let the condition check fail with an error code, but instead simply return
false. After all the architecture might just be newer than the ones we know, in
which case it's certainly not our local one.

Fixes: #3236
2016-06-30 15:56:23 -07:00
Martin Pitt f15461b2b2 Merge pull request #3596 from poettering/machine-clean
make "machinectl clean" asynchronous, and open it up via PolicyKit
2016-06-30 21:30:35 +02:00
Lukas Lösche 17c22746b1 man: minor typo "has already has happened" (#3635) 2016-06-30 21:25:51 +02:00
Lennart Poettering 60a3b1e11a sd-event: expose the event loop iteration counter via sd_event_get_iteration() (#3631)
This extends the existing event loop iteration counter to 64bit, and exposes it
via a new function sd_event_get_iteration(). This is helpful for cases like
issue #3612. After all, since we maintain the counter anyway, we might as well
expose it.

(This also fixes an unrelated issue in the man page for sd_event_wait() where
micro and milliseconds got mixed up)
2016-06-30 21:25:07 +02:00
Kyle Walker 36f20ae3b2 manager: Only invoke a single sigchld per unit within a cleanup cycle
By default, each iteration of manager_dispatch_sigchld() results in a unit level
sigchld event being invoked. For scope units, this results in a scope_sigchld_event()
which can seemingly stall for workloads that have a large number of PIDs within the
scope. The stall exhibits itself as a SIG_0 being initiated for each u->pids entry
as a result of pid_is_unwaited().

v2:
This patch resolves this condition by only paying to cost of a sigchld in the underlying
scope unit once per sigchld iteration. A new "sigchldgen" member resides within the
Unit struct. The Manager is incremented via the sd event loop, accessed via
sd_event_get_iteration, and the Unit member is set to the same value as the manager each
time that a sigchld event is invoked. If the Manager iteration value and Unit member
match, the sigchld event is not invoked for that iteration.
2016-06-30 15:16:47 -04:00
Lennart Poettering 39231d7b62 Merge pull request #3608 from teg/sd-device-driver-id
sd-device: handle the 'drivers' pseudo-subsystem correctly
2016-06-30 09:47:52 -07:00
ottopotto 34a8f0811c journalctl: Make temporary files directory configurable (#3574)
journalctl: Use env variable TMPDIR to save temporary files
2016-06-30 07:59:06 -07:00
Lennart Poettering 7486322b99 sd-event: expose the event loop iteration counter via sd_event_get_iteration()
This extends the existing event loop iteration counter to 64bit, and exposes it
via a new function sd_event_get_iteration(). This is helpful for cases like
issue #3612. After all, since we maintain the counter anyway, we might as well
expose it.

(This also fixes an unrelated issue in the man page for sd_event_wait() where
micro and milliseconds got mixed up)
2016-06-30 07:53:08 -07:00
Martin Pitt 30b42a9a36 test: check resolved generated resolv.conf in networkd-test (#3628)
* test: check resolved generated resolv.conf in networkd-test

Directly verify the contents of /run/systemd/resolve/resolv.conf instead of
/etc/resolv.conf. The latter might be a plain file or a symlink to something
else (like Debian's resolvconf output), and in these cases we cannot make
strong assumptions about the contents.

Drop the "/etc/resolv.conf is a symlink" conditions and the "resolv.conf can
have at most three nameservers" alternatives, as we know that resolved always
adds all nameservers.

Explicitly start resolved at the start of a test to ensure that it is running.

* test: get along with existing system search domains in resolv.conf

The previous change has uncovered a bug in the tests: Existing search domains
can exist in resolv.conf which test_search_domains{,_too_long} didn't take into account.

As existing domains take some of the "max 6 domains" and "max 255 chars" limit,
don't expect that the last items from our test data actually appears in the
output, just the first few.
2016-06-30 16:44:22 +03:00
Lennart Poettering 2e0d8df13b Merge pull request #3516 from fsateler/shared-basic
build-sys: Convert libshared into a private shared library
2016-06-29 22:38:50 +02:00
Lennart Poettering f68032265d Merge pull request #3622 from keszybz/journalctl-this-boot
Make `journalctl --directory=... --boot 0` work
2016-06-29 22:25:08 +02:00
Weng Xuetian f0d5c5be59 sd-bus: Fix a read after free error in bus-match. (#3624) (#3625)
The loop on bus_match_run should break and return immediately if
bus->match_callbacks_modified is true. Otherwise the loop may access
free'd data.
2016-06-29 22:22:12 +02:00
Susant Sahani d6568222d7 systemctl mask of an non-existent unit should print a warning (#3521)
fixes https://bugzilla.redhat.com/show_bug.cgi?id=842060
2016-06-28 21:27:07 +01:00
Zbigniew Jędrzejewski-Szmek 592855c318 journalct: allow --boot=0 to DTRT with --file/--directory
--boot=0 magically meant "this boot", but when used with --file/--directory it
should simply refer to the last boot found in the specified journal. This way,
--boot and --list-boots are consistent.

Fixes #3603.
2016-06-28 16:19:59 -04:00
Zbigniew Jędrzejewski-Szmek 07ff6b0823 journalctl: use simpler variable names in get_boots()
Those are just local variables and ref_boot_offset is especially
obnoxious.
2016-06-28 16:14:04 -04:00
Zbigniew Jędrzejewski-Szmek 8453f06257 journalct: do no allow --this-boot to take arguments
Before --this-boot was deprecated in a331b5e6d4, it did not take
any arguments.
2016-06-28 16:14:04 -04:00
Zbigniew Jędrzejewski-Szmek f3bd7561c5 journalctl: allow --file/--directory with --boot or --list-boots
It works mostly fine, and can be quite useful to examine data from another
system.

OTOH, a single boot id doesn't make sense with --merge, so mixing with --merge
is still not allowed.
2016-06-28 16:14:04 -04:00
Lénaïc Huard a1abf5ea7f Remove blank line in the output of “systemctl show” (#3614)
“systemctl show” added an extra blank line after the dump of the
EnvironmentFile property of the unit.
2016-06-28 20:15:33 +02:00
Luca Bruno aa4f6cf12c man: clarify NotifyAccess overriding (#3620)
Type=notify has a magic overriding case where a NotifyAccess=none
is turned into a NotifyAccess=main for sanity purposes.
This makes docs more clear about such behavior:
2787d83c28/src/core/service.c (L650):L651
2016-06-28 20:14:08 +02:00
Martin Pitt 94363cbbf3 resolved: add test for route-only domain filtering (#3609)
With commit 6f7da49d00 route-only domains do not get put into resolv.conf's
"search" list any more. Add a comment about the tri-state, to clarify its
semantics and why we are passing a bool parameter into an int type. Also add a
test case for it.
2016-06-28 18:18:27 +02:00
Andika Triwidada a29337d186 Added Indonesian translation (#3615) 2016-06-28 10:14:27 +02:00
0xAX f9d14060ae basic/strv: introduce STRV_IGNORE macro (#3601)
to hide casting of '-1' strings and make code cleaner.
2016-06-27 23:26:07 +02:00
Evgeny Vereshchagin 2027927b10 basic: pass flags to the fnmatch (#3606)
Fixes:
```
$ systemctl list-unit-files 'hey\*'

0 unit files listed.

$ systemctl list-unit-files | grep hey
hey\x7eho.service                          static
```
2016-06-27 14:47:37 +02:00
Tom Gundersen 21d6220fe0 sd-device: new_from_subsystem_sysnam - support a real subsystem called 'drivers'
We support writing out tags and db files in case a real subsystem called
'drivers' exists, so there is no reason to refuse parsing it.
2016-06-27 09:58:59 +02:00
Tom Gundersen de7e983ea1 sd-device: device_id - set correctly for 'drivers'
The 'drivers' pseudo-subsystem needs special treatment. These pseudo-devices are
found under /sys/bus/drivers/, so needs the real subsystem encoded
in the device_id in order to be resolved.

The reader side already assumed this to be the case.
2016-06-27 09:54:20 +02:00
Tom Gundersen 3172836b2f sd-device: enumerator - do not abort enumeration if a device fails
Collect the errors and return to the caller, but continue enumerating all devices.
2016-06-26 23:03:31 +02:00
Martin Pitt bed48d6655 Merge pull request #3572 from poettering/machinectl-shell-fix
machinectl: interpret options placed between "shell" verb and machine name
2016-06-26 17:46:23 +02:00
Lennart Poettering 4b930ded83 catalog: make support URL to show in shipped catalog entries configurable (#3597)
Let's allow distros to change the support URL to expose in catalog entries by
default. It doesn't make sense to direct end-users to the upstream project for
common errors.

This adds a --with-support-url= switch to configure, which allows overriding
the default at build-time.

Fixes: #2516
2016-06-26 17:43:37 +02:00
Lennart Poettering 68ce459f2f machinectl: verify image existance on "start" and "enable" (#3579)
Let's make sure we catch early when a machine doesn't exist that is attempted
to be started or enabled as system service.
2016-06-26 17:41:33 +02:00
0xAX 03fb333458 networkd: use strv_fnmatch() (#3605) 2016-06-26 17:37:24 +02:00
Lennart Poettering cdfe156acd man: document what Authenticated: in the systemd-resolve output actually means (#3571)
My educated guess is that #3561 was filed due to confusion around the
systemd-resolve "Data Authenticated:" output.  Let's try to clean up the
confusion a bit, and document what it means in the man page.
2016-06-26 17:35:22 +02:00
Martin Pitt 71c14010df Merge pull request #3600 from poettering/fstab-generator-fixes
Fstab generator fixes
2016-06-26 12:46:17 +02:00
0xAX 8a3134b2b7 basic/strv: use SWAP_TWO() macro (#3602) 2016-06-26 12:37:00 +02:00
Lennart Poettering 0c6aeb4609 nspawn: fix uid patching logic (#3599)
An incorrectly set if/else chain caused aus to apply the access mode of a
symlink to the directory it is located in. Yuck.

Fixes: #3547
2016-06-25 07:04:43 +03:00
Felipe Sateler cc8b113e0b build-sys: Add new libsystemd-shared private library
Link as many binaries as possible with it, to save storage space.

Preserve the static libshared and libbasic for use in libraries, nss
modules and udev.

Libraries need to be static in order to avoid polluting the symbol
namespace.

Udev needs to be static so downstream can avoid strict version dependencies
with the systemd package, and this can complicate upgrade scenarios.
2016-06-24 22:36:28 -04:00
Felipe Sateler 8537a389b8 build-sys: do not recompile everything for libsystemd 2016-06-24 22:34:39 -04:00
Lennart Poettering 592288a2a7 fstab-generator: minor simplification 2016-06-24 21:22:05 +02:00
Lennart Poettering f113f8e382 fstab-generator: skip fsck for /usr on non-device file systems
We do the same already for the root device, hence follow the scheme for /usr
too.

(Also add some explanatory comments.)
2016-06-24 21:07:18 +02:00
Lennart Poettering 003cba3946 fstab-generator: don't skip /usr handling if root handling didn't work correctly
Let's follow the same logic for all mounts here: log errors, and exit the
process uncleanly ultimately, but do not skip further mounts if we encounter a
problem with an earlier one.

Fixes: #2344
2016-06-24 21:04:48 +02:00
Lennart Poettering dbf43a1b3a systemctl: fix an error condition from "-1" to something meaningful
We really shouldn't make up errors like "-1", but use proper errno definitions.
2016-06-24 21:03:47 +02:00
Lennart Poettering 47be5f0742 fstab-generator: fix checking of fstab_node_to_udev_node() result
We have to check for OOM here, let's add that. There's really no point in
checking for path_is_absolute() on the result however, as there's no particular
reason why that should be refused. Also, we don't have similar checks for the
other mount devices the generator deals with, hence don't bother with it here
either. Let's remove that check.

(And it shouldn't return made-up errors like "-1" in this case anyway.)
2016-06-24 21:01:22 +02:00
Lennart Poettering 40472036cf fstab-generator: document why we copy the root device into the usr device if unset
Let's a comment about this, to avoid questions popping up like in #2344.
2016-06-24 21:00:11 +02:00
Lennart Poettering e34e72fb18 fstab-generator: let's use path_equal() for comparing paths 2016-06-24 20:59:51 +02:00
Evgeny Vereshchagin d946fb596f Merge pull request #3587 from martinpitt/master
Fix some test issues
2016-06-24 19:44:18 +03:00
Martin Pitt 7cad32bbde test: merge check_nspawn() into run_nspawn()
This makes nspawn tests symmetric with run_qemu() which also exits with 1 if
QEMU is not available.
2016-06-24 16:23:39 +02:00
Franck Bui 6edefe0b06 pid1: restore console color support for containers (#3595)
Commit 3a18b60489 introduced a regression that
disabled the color mode for container.

This patch fixes this.
2016-06-24 16:08:43 +02:00
Martin Pitt b2ecd099dc tests: track and check for timeouts
If run_qemu() exits with non-zero, this either meant that QEMU was not
available (which should be a SKIP) or that QEMU timed out if $QEMU_TIMEOUT was
set (which then should be a FAIL).

Limit the exit code of run_qemu() to QEMU availability only, and track timeouts
separately through the new $TIMED_OUT variable, which is then checked in
check_result_qemu().

Do the same for $NSPAWN_TIMEOUT and run_nspawn() so that nspawn and QEMU work
similarly.
2016-06-24 16:07:16 +02:00
Lennart Poettering 1c6c037cec machined: make sure CleanPool() method is opened up in the dbus policy
The method is already hooked up to PolicyKit, hence let's open this up via the
bus policy language too.

Fixes: #3585
2016-06-24 16:03:49 +02:00