platform/upstream/systemd.git
7 years agoMerge pull request #5354 from msekletar/issue-518
Lennart Poettering [Mon, 24 Apr 2017 17:51:34 +0000 (19:51 +0200)]
Merge pull request #5354 from msekletar/issue-518

service: serialize information about currently executing command

7 years agoupdate TODO
Lennart Poettering [Mon, 24 Apr 2017 16:48:10 +0000 (18:48 +0200)]
update TODO

7 years agofstab-generator: do not skip Before= ordering for noauto mountpoints (#5547)
Ivan Shapovalov [Mon, 24 Apr 2017 16:38:53 +0000 (20:38 +0400)]
fstab-generator: do not skip Before= ordering for noauto mountpoints (#5547)

7 years agosd-journal: return SD_JOURNAL_INVALIDATE only if journal files were actually deleted...
Michal Sekletar [Mon, 24 Apr 2017 16:33:12 +0000 (18:33 +0200)]
sd-journal: return SD_JOURNAL_INVALIDATE only if journal files were actually deleted/moved (#5580)

When caller invokes sd_journal_open() we usually open at least one
directory with journal files. add_root_directory() function increments
current_invalidate_counter. After sd_journal_open() returns
current_invalidate_counter != last_invalidate_counter.

After caller waits for journal events (e.g. waits for new messages in
journal) then it usually calls sd_journal_process(). However, on first
call to sd_journal_process(), function determine_change() returns
SD_JOURNAL_INVALIDATE even though no journal files were
deleted/moved. This is because current_invalidate_counter !=
last_invalidate_counter.

After the fix we make sure counters has the same value before we begin
processing inotify events.

7 years agoredirect stdout/stderr back when closing the pager (#5661)
Matija Skala [Mon, 24 Apr 2017 16:30:50 +0000 (18:30 +0200)]
redirect stdout/stderr back when closing the pager (#5661)

7 years agoload-fragment: resolve specifiers in BindPaths/BindReadOnlyPaths (#5687)
Danielle Church [Mon, 24 Apr 2017 16:23:35 +0000 (12:23 -0400)]
load-fragment: resolve specifiers in BindPaths/BindReadOnlyPaths (#5687)

7 years agoman: clarify udevadm monitor --tag-match/--filter-match (#5726)
Julian Mehne [Mon, 24 Apr 2017 14:56:40 +0000 (16:56 +0200)]
man: clarify udevadm monitor --tag-match/--filter-match (#5726)

--tag-match only filters tags, not properties
--tag-match only has an effect on udev events
--subsystem-match filters both event types

7 years agoman: systemd.journal-fields: Note about originator PID (#5724)
Michal Koutný [Mon, 24 Apr 2017 14:19:53 +0000 (16:19 +0200)]
man: systemd.journal-fields: Note about originator PID (#5724)

7 years agoman: fix journalctl --new-id128 option name (#5786)
Lucas Werkmeister [Sun, 23 Apr 2017 23:10:25 +0000 (01:10 +0200)]
man: fix journalctl --new-id128 option name (#5786)

--new-id works because it’s an unambiguous prefix, but the full option
name is --new-id128.

(#5381 did the same in one other manpage, but I didn’t check for other
manpages using the abbreviated version back then.)

7 years agodoc: fix incorrect reference (#5784)
Marcin Bachry [Sun, 23 Apr 2017 13:10:39 +0000 (15:10 +0200)]
doc: fix incorrect reference (#5784)

7 years agoMerge pull request #5774 from keszybz/printf-annotations
Djalal Harouni [Sat, 22 Apr 2017 23:03:42 +0000 (01:03 +0200)]
Merge pull request #5774 from keszybz/printf-annotations

Printf annotation improvements

7 years agoMerge pull request #5756 from keszybz/make-cleanups
Martin Pitt [Fri, 21 Apr 2017 19:36:56 +0000 (21:36 +0200)]
Merge pull request #5756 from keszybz/make-cleanups

Various meson-independent cleanups from the meson patchset

7 years agokernel-install: remove unneeded modules.* files created by depmod (#5766)
Yu Watanabe [Fri, 21 Apr 2017 18:03:17 +0000 (03:03 +0900)]
kernel-install: remove unneeded modules.* files created by depmod (#5766)

Fixes #5765.

7 years agocoredump: fix non-literal string used in printf
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:28:19 +0000 (14:28 -0400)]
coredump: fix non-literal string used in printf

This was exposed by the previous commit. This could be potentially
unpleasant, but we are saved by the fact that this code path was only
taken for journald crashes, where we control COMM and know that it doesn't
contain any special characters. Use log_dispatch which does not do any
format processing to push the message out.

7 years agobasic/log: expose log_dispatch
Zbigniew Jędrzejewski-Szmek [Fri, 21 Apr 2017 16:52:54 +0000 (12:52 -0400)]
basic/log: expose log_dispatch

This is useful when we want to avoid printf formatting on the message.
It's nicer than using log_struct with "%s" as the format, because printf
is slow and with a large message (like from a backtrace) this would require
extra unnecessary memory.

I'm not exposing all the fields in the wrapper: only level and errno.
Those are the most likely to be useful.

7 years agotree-wide: mark log_struct with _printf_ and fix fallout
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:15:28 +0000 (14:15 -0400)]
tree-wide: mark log_struct with _printf_ and fix fallout

log_struct takes multiple format strings, each one followed by arguments.
The _printf_ annotation is not sufficiently flexible to express this,
but we can still annotate the first format string, though not its
arguments (because their number is unknown).

With the annotation, the places which specified the message id or similar
as the first pattern cause a warning from -Wformat-nonliteral. This can
be trivially fixed by putting the MESSAGE= first.

This change will help find issues where a non-literal is erroneously used
as the pattern.

7 years agoµhttpd-util: use #pragma to silence warning about nonliteral pattern
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:45:30 +0000 (14:45 -0400)]
µhttpd-util: use #pragma to silence warning about nonliteral pattern

This is safe, because we're taking a pattern which was already marked with
_printf_ and appending a literal string.

7 years agobus: include sd-{bus,messages}.h the same as other systemd headers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 22:50:13 +0000 (18:50 -0400)]
bus: include sd-{bus,messages}.h the same as other systemd headers

This is our own header, we should include use the local-include syntax
("" not <>), to make it clear we are including the one from the build tree.
All other includes of files from src/systemd/ use this scheme.

7 years agomicrohttpd-util: silence warnings about deprecated options
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:37:24 +0000 (16:37 -0400)]
microhttpd-util: silence warnings about deprecated options

C.f. 21b6ff368438bd3e809c2fabe73038eb305df296.

7 years agotest-exec-util: drop duplicate const
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:32:52 +0000 (16:32 -0400)]
test-exec-util: drop duplicate const

gcc-7 warns about this with -Wduplicate-decl-specifier.

7 years agobasic/random-util: add new header for getrandom()
Zbigniew Jędrzejewski-Szmek [Wed, 19 Apr 2017 20:13:27 +0000 (16:13 -0400)]
basic/random-util: add new header for getrandom()

There's some confusion: older man pages specify that linux/random.h
contains getrandom, but newer glibc has it in sys/random.h. Detect if
the newer header is available and include it. We still need the older
header for the flags.

7 years agolibshared: fix compilation without libblkid
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:05:05 +0000 (19:05 -0400)]
libshared: fix compilation without libblkid

This reverts a75e27eba75e27eb fixed the case of libcryptsetup=no, libblkid=yes,
but broke the case of libcryptsetup=no, libblkid=yes. Instead of trying to define
the function only when used, which would result in too much ifdeffery, just silence
the warning.

7 years agobasic/missing.h: drop inclusion of macro.h
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2017 23:04:15 +0000 (19:04 -0400)]
basic/missing.h: drop inclusion of macro.h

It's not necessary for anything.

7 years agoMakefile.am: remove duplicated rules for efi
Zbigniew Jędrzejewski-Szmek [Tue, 11 Apr 2017 03:27:55 +0000 (23:27 -0400)]
Makefile.am: remove duplicated rules for efi

Specifying the same rule with a slightly different dep list was not useful,
since make cannot distinguish rules with the same input / output. (It possibly
could have two rules with different dependency list, but here all dependencies
that are different between the two rules are always present, so the two rules
are effectively the same.)

7 years agoman: fix small typo (#5778)
AsciiWolf [Fri, 21 Apr 2017 13:01:09 +0000 (15:01 +0200)]
man: fix small typo (#5778)

7 years agonetworkd: route - support 'onlink' routes (#5734)
Susant Sahani [Fri, 21 Apr 2017 09:22:30 +0000 (14:52 +0530)]
networkd: route - support 'onlink' routes (#5734)

This work based on Tom's original patch
teg@1312172

By setting GatewayOnlink=yes, the kernel will assume that the gateway is onlink
even if there is no route to it.

Resolves issue #1283.

7 years agounits: systemd-resolved should start before network-online.target and nss-lookup...
Yu Watanabe [Fri, 21 Apr 2017 09:21:17 +0000 (18:21 +0900)]
units: systemd-resolved should start before network-online.target and nss-lookup.target (#5691)

systemd-resolved provides
1. local API via NSS and D-Bus
2. kind of a local "DNS proxy" through its stub listener
The 1st item should be started before nss-lookup.target.
The 2nd item should be started before network-online.target,
because if the networking works in general, then DNS (and DNS proxy) should too.

Fixes #5650

7 years agonetworkd: vlan add GVRP support (#5761)
Susant Sahani [Fri, 21 Apr 2017 09:01:59 +0000 (14:31 +0530)]
networkd: vlan add GVRP support (#5761)

Add support to configure GVRP.

Closes #5760

7 years agocore: move checking default_dependencies into target_add_default_dependencies. (...
iplayinsun [Fri, 21 Apr 2017 09:00:47 +0000 (18:00 +0900)]
core: move checking default_dependencies into target_add_default_dependencies. (#5762)

Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.

7 years agoima: Ensure policy exists before asking the kernel to load it (#5777)
Benjamin Gilbert [Fri, 21 Apr 2017 08:53:40 +0000 (01:53 -0700)]
ima: Ensure policy exists before asking the kernel to load it (#5777)

e8e42b31c5a950a7b43d64f4a531ec59750e823e added support for having the
kernel load the IMA policy directly, but didn't check that the policy
file exists.  If not, this produced a kernel message:

    IMA: policy update failed

7 years agol10n: update Czech Translation (#5776)
AsciiWolf [Fri, 21 Apr 2017 06:38:37 +0000 (08:38 +0200)]
l10n: update Czech Translation (#5776)

7 years agohwdb: fix warning "atkbd serio0: Unknown key pressed" (#5772)
Franck Bui [Thu, 20 Apr 2017 19:09:13 +0000 (21:09 +0200)]
hwdb: fix warning "atkbd serio0: Unknown key pressed" (#5772)

At each time pressing the WiFi Fn key on Dell Latitude E7270 laptop, the system
reports the following error/warning messages:

  atkbd serio0: Unknown key pressed (translated set 2, code 0x88 on isa0060/serio0).
  atkbd serio0: Use 'setkeycodes e008 ' to make it known.

This is due to commit 0e33634 which was added to fix
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/1441849.

However on Dell Latitude E7* models, we need to restore the old generic
behavior which consists in ignoring the key event since it's already done by
the HW.

Indeed the hardware has a specific driver (dell_wmi) to handle rfkill in the
hardware level. So, as long as the hardware handles, the best is to leave as
is.

This patch was originally written by Takashi Iwai.

Fixes #5047

7 years agobasic/log: fix _printf_ annotation on log_object_internalv
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2017 18:09:47 +0000 (14:09 -0400)]
basic/log: fix _printf_ annotation on log_object_internalv

Fixup for 4b58153dd22172d817055d2a09a0cdf3f4bd9db3.

I saw this because of a clang warning. With gcc the -Wformat-nonliteral warning
doesn't seem to work as expected.

In two places, a string constructed with strjoina is used as the pattern. This
is safe, because we're taking a pattern which was already marked with _printf_
and prepending a known value to it.  Those places are marked with #pragma to
silence the warning.

7 years agoman: Fix reference to timer-sync.target instead of time-sync.target (#5764)
Philip Withnall [Thu, 20 Apr 2017 10:34:26 +0000 (11:34 +0100)]
man: Fix reference to timer-sync.target instead of time-sync.target (#5764)

Also fix an erroneous reference to it in the NEWS file, for posterity.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
7 years agoMakefile.am: link dbus-org.freedesktop.network1 alias in /etc
Zbigniew Jędrzejewski-Szmek [Mon, 10 Apr 2017 15:59:58 +0000 (11:59 -0400)]
Makefile.am: link dbus-org.freedesktop.network1 alias in /etc

This makes dbus-org.freedesktop.network1.service like dbus-org.freedesktop.resolve1.service.
When systemd-networkd.service is disabled, the alias is also removed.

7 years agotest-compress*: silence warning about unused definitions when w/o both xz and lz4
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2017 13:28:50 +0000 (09:28 -0400)]
test-compress*: silence warning about unused definitions when w/o both xz and lz4

I think it's nice to mark the test as skipped instead of omitting
it entirely, hence #ifdefs in the code instead of excluding the test
in Makefile.am/meson.build.

7 years agoconfigure: restore check for glib libraries
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 15:03:00 +0000 (11:03 -0400)]
configure: restore check for glib libraries

This is a partial revert of 2375607039517c88df. We still have code
guarded by HAVE_GLIB in tests.

v2:
- do not define the automake conditional, it wasn't used anywhere
- rename --disable-gudev to --disable-glib

v3:
- do not cause an error if the libs are not found, this is supposed
  to be an "auto" dep by default.

7 years agorc-local-generator: drop duplicate definitions for rc.local
Zbigniew Jędrzejewski-Szmek [Wed, 12 Apr 2017 23:30:58 +0000 (19:30 -0400)]
rc-local-generator: drop duplicate definitions for rc.local

We always define those paths in the configure scripts.

7 years agobasic/def.h: drop TTY_GID definition
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2017 04:12:40 +0000 (00:12 -0400)]
basic/def.h: drop TTY_GID definition

We already provide a definition through the configuration system, this
one is duplicate.

7 years agounits: drop explicit NotifyAccess setting from journald's unit file (#5749)
Michal Sekletar [Wed, 19 Apr 2017 06:52:40 +0000 (08:52 +0200)]
units: drop explicit NotifyAccess setting from journald's unit file (#5749)

systemd-journald service consists of only single process and that is the
MainPID. Make unit file shorter and drop NotifyAccess=all since it is
not useful in such case.

https://lists.freedesktop.org/archives/systemd-devel/2017-April/038667.html

7 years agohwdb: MS Surface Pro Type Cover touchpad integration (#5751)
Sarang S. Dalal [Wed, 19 Apr 2017 06:52:08 +0000 (08:52 +0200)]
hwdb: MS Surface Pro Type Cover touchpad integration (#5751)

Sets ID_INPUT_TOUCHPAD_INTEGRATION=internal for Microsoft Surface Pro Type Covers (IDs should cover at least the type covers for the Surface Pro 3 and 4). This is needed so that libinput can disable the touchpad while typing.

7 years agotree-wide: fix wrong indent (#5757)
Yu Watanabe [Wed, 19 Apr 2017 06:48:29 +0000 (15:48 +0900)]
tree-wide: fix wrong indent (#5757)

Fixes wrong indent introduced by the commit 43688c49d1fdb585196d94e2e30bb29755fa591b.

7 years agoMerge pull request #5708 from vcatechnology/arm-cross-compile
Lennart Poettering [Mon, 17 Apr 2017 13:49:06 +0000 (15:49 +0200)]
Merge pull request #5708 from vcatechnology/arm-cross-compile

ARM32 cross-compile fixes

7 years agoMerge pull request #5731 from jprvita/hwdb-acer
Martin Pitt [Thu, 13 Apr 2017 10:48:39 +0000 (12:48 +0200)]
Merge pull request #5731 from jprvita/hwdb-acer

Acer hwdb keymap updates

7 years agologinctl: fix typo causing ignoring multiple session IDs (#5732)
slodki [Thu, 13 Apr 2017 10:34:59 +0000 (12:34 +0200)]
loginctl: fix typo causing ignoring multiple session IDs (#5732)

Fixes #5733

7 years agoMerge pull request #5690 from yuwata/fix-5621
Djalal Harouni [Wed, 12 Apr 2017 18:22:03 +0000 (20:22 +0200)]
Merge pull request #5690 from yuwata/fix-5621

core: downgrade error message if command is prefixed with `-` and the…

7 years agohwdb: Add power button mapping for Acer models
Chris Chiu [Wed, 12 Apr 2017 13:03:47 +0000 (09:03 -0400)]
hwdb: Add power button mapping for Acer models

The power key keycode e076 is emitted on several different Acer laptop
models, and it is expected that it will also be used on upcoming models.
Verified on the following models:

Aspire ES1-421
Aspire ES1-432
Aspire A515-51
Aspire A515-51G
Aspire A517-51
Aspire A517-51G
Nitro AN515-31

7 years agohwdb: Fix airplane mode key for all Acer series
Chris Chiu [Wed, 12 Apr 2017 13:03:35 +0000 (09:03 -0400)]
hwdb: Fix airplane mode key for all Acer series

According to the key code v2.02 from Acer, scancode E0 86 will be
generated for airplane mode hotkey. Verified on Aspire, TravelMate,
Easynote and Predator.

7 years agohwdb: Map 0x8a to F20 on the Acer Travelmate P648-G2-MG
João Paulo Rechi Vita [Tue, 4 Apr 2017 14:48:06 +0000 (10:48 -0400)]
hwdb: Map 0x8a to F20 on the Acer Travelmate P648-G2-MG

This model emits 0x9a for the microphone mute button above the keyboard,
so let's map it to correct keycode.

7 years agoman: document how to include an equals sign in a value provided to Environment= ...
Mark Stosberg [Tue, 11 Apr 2017 21:19:06 +0000 (17:19 -0400)]
man: document how to include an equals sign in a value provided to Environment= (#5710)

It wasn't clear before how an equals sign in an "Environment=" value might be
handled. Ref:
http://stackoverflow.com/questions/43278883/how-to-write-systemd-environment-variables-value-which-contains/43280157

7 years agonetworkd: Add bridge port priority setting (#5545)
Dimitri John Ledkov [Tue, 11 Apr 2017 21:17:31 +0000 (22:17 +0100)]
networkd: Add bridge port priority setting (#5545)

Allow setting bridge port priority in the Bridge section of the network file,
similar to e.g. port path cost setting.

Set the default to an invalid value of 128, and only set the port priority when
it's not 128. Unlike e.g. path cost, zero is a valid priority value.

Add a networkd-test.py to check that bridge port priority is correctly set.

Incidently, fix bridge port cost type and document valid ranges.

7 years agotest/TEST-12-ISSUE-3171: specify -w1 option to netcat due to default change. (#5722)
Dimitri John Ledkov [Tue, 11 Apr 2017 19:34:29 +0000 (20:34 +0100)]
test/TEST-12-ISSUE-3171: specify -w1 option to netcat due to default change. (#5722)

On Ubuntu 17.04 (zesty zapus) netcat-openbsd was upgraded from 1.105-7ubuntu1
to 1.130-3, at the same time the defaults got changed from -q0 to -q-1
(infinity) the net result is that `echo A | nc -U' call now hangs, preventing
the testcase to complete. One could use the old default of -q0, but that option
is not available in some netcat implementations. Thus settle to specify -w1
instead to mitigate the testcase hang.

7 years agotests: add new test for issue #518
Michal Sekletar [Wed, 15 Feb 2017 11:40:52 +0000 (12:40 +0100)]
tests: add new test for issue #518

7 years agoservice: serialize information about currently executing command
Michal Sekletar [Mon, 23 Jan 2017 16:12:35 +0000 (17:12 +0100)]
service: serialize information about currently executing command

Stored information will help us to resume execution after the
daemon-reload.

This commit implements following scheme,

* On serialization:
  - we count rank of the currently executing command
  - we store command type, its rank and command line arguments

* On deserialization:
  - configuration is parsed and loaded
  - we deserialize stored data, command type, rank and arguments
  - we look at the given rank in the list and if command there has same
    arguments then we restore execution at that point
  - otherwise we search respective command list and we look for command
    that has the same arguments
  - if both methods fail we do not do not resume execution at all

To better illustrate how does above scheme works, please consider
following cases (<<< denotes position where we resume execution after reload)

; Original unit file
[Service]
ExecStart=/bin/true <<<
ExecStart=/bin/false

; Swapped commands
; Second command is not going to be executed
[Service]
ExecStart=/bin/false
ExecStart=/bin/true <<<

; Commands added before
; Same commands are problematic and execution could be restarted at wrong place
[Service]
ExecStart=/bin/foo
ExecStart=/bin/bar
ExecStart=/bin/true <<<
ExecStart=/bin/false

; Commands added after
; Same commands are not an issue in this case
[Service]
ExecStart=/bin/true <<<
ExecStart=/bin/false
ExecStart=/bin/foo
ExecStart=/bin/bar

; New commands interleaved with old commands
; Some new commands will be executed while others won't
ExecStart=/bin/foo
ExecStart=/bin/true <<<
ExecStart=/bin/bar
ExecStart=/bin/false

As you can see, above scheme has some drawbacks. However, in most
cases (we assume that in most common case unit file command list is not
changed while some other command is running for the same unit) it
should cause that systemd does the right thing, which is restoring
execution exactly at the point we were before daemon-reload.

Fixes #518

7 years agotmpfiles: downgrade error message when operation is not supported (#5692)
Yu Watanabe [Mon, 10 Apr 2017 11:22:18 +0000 (20:22 +0900)]
tmpfiles: downgrade error message when operation is not supported (#5692)

Fixes #5607

7 years agocore: fix values of BindPaths and BindReadOnlyPaths properties on 32-bit platforms...
Evgeny Vereshchagin [Mon, 10 Apr 2017 11:20:17 +0000 (14:20 +0300)]
core: fix values of BindPaths and BindReadOnlyPaths properties on 32-bit platforms (#5713)

$ busctl get-property \
    org.freedesktop.systemd1 \
    /org/freedesktop/systemd1/unit/run_2dr471de87550554a6dbb165501c33c5dab_2eservice \
    org.freedesktop.systemd1.Service BindReadOnlyPaths

a(ssbt) 1 "/etc" "/etc" false 9228635523571007488

The correct values are 0 and 16384

7 years agocore: downgrade legit error logs (#5705)
umuttl [Mon, 10 Apr 2017 11:12:25 +0000 (13:12 +0200)]
core: downgrade legit error logs (#5705)

manager_sync_bus_names() function retrieves the dbus names
and compares it with unit bus names. It could be right
after the list is retrieved, the dbus peer is disconnected.
In this case it is really not an ERROR print if
sd_bus_get_name_creds() or sd_bus_creds_get_unique_name()
fail.

7 years agoRemove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)
Nathaniel R. Lewis [Thu, 6 Apr 2017 19:13:14 +0000 (12:13 -0700)]
Remove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)

At present, devices implementing the BTN_DPAD_UP/DOWN/LEFT/RIGHT
codes will be incorrectly classified as key devices.  This causes
devices respecting the Linux gamepad spec (such as the DS3 as of
kernel 4.12) to be classified as keyboards by X11.

This is caused by the test_key function checking all codes on
[KEY_OK, BTN_TRIGGER_HAPPY).  Unfortunately the BTN_DPAD_* codes
are placed between KEY_LIGHTS_TOGGLE and KEY_ALS_TOGGLE.  This
patch splits the upper key block check into the block before and
after the BTN_DPAD_* codes.  An array is used to avoid dedicated,
per block loops in the event that more event codes are added in
the future.

7 years agobuild-sys: correct blkid.h includes
Matt Clarkson [Thu, 6 Apr 2017 13:12:17 +0000 (14:12 +0100)]
build-sys: correct blkid.h includes

When using pkg-config to determine the include flags for blkid the
flags are returned as:

    $ pkg-config blkid --cflags
    -I/usr/include/blkid -I/usr/include/uuid

We use the <blkid/blkid.h> include which would be correct when using
the default compiler /usr/include header search path. However, when
cross-compiling the blkid.h will not be installed at /usr/include and
highly likely in a temporary system root. It is futher compounded if
the cross-compile packages are split up and the blkid package is not
available in the same sysroot as the compiler.

Regardless of the compilation setup, the correct include path should be
<blkid.h> if using the pkg-config returned CFLAGS.

7 years agobuild-sys: correct ARM32 GNU EFI boot binary build
Matt Clarkson [Thu, 6 Apr 2017 13:12:15 +0000 (14:12 +0100)]
build-sys: correct ARM32 GNU EFI boot binary build

Due to ARM not having an EFI capable objcopy we need to use the binary
output argument. This is correctly set up for AArch64 but is missed
when building for ARM32. This patch adds the ARCH_ARM automake define
which can then be used in the makefile to determine if to use the
correct linker flags.

The addition of the ARM32 flags is a copy and paste from the AArch64 to
create a logical OR for the ARCH_AARCH64 and ARCH_ARM variables. I
couldn't figure out a better way to create the conditional with basic
Make language constructs.

7 years agobuild-sys: correctly search for gnu-efi header
Matt Clarkson [Thu, 6 Apr 2017 13:12:11 +0000 (14:12 +0100)]
build-sys: correctly search for gnu-efi header

When the user provides the --with-efi-includedir we incorrectly search
for the header at /usr/include not the provided location. This patch
changes the check to use the provided value so that non-standard header
locations are supported.

This situation occurs commonly when cross-compiling systemd because the
GNU EFI headers and library will not be installed into the root
locations but highly likely a temporary system root.

7 years agoMerge pull request #5706 from keszybz/make-cleanups
Lennart Poettering [Wed, 5 Apr 2017 10:10:11 +0000 (12:10 +0200)]
Merge pull request #5706 from keszybz/make-cleanups

Move busctl to its own dir and other cleanups

7 years agologind: Stopped inhibitions should be considered inactive (#5698)
afrantzis [Wed, 5 Apr 2017 08:32:55 +0000 (11:32 +0300)]
logind: Stopped inhibitions should be considered inactive (#5698)

7 years agobuild-sys: drop obsolete hook from Makefile.am
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2017 02:39:30 +0000 (22:39 -0400)]
build-sys: drop obsolete hook from Makefile.am

7 years agoudev: rename gperf struct name to match other headers
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2017 00:02:58 +0000 (20:02 -0400)]
udev: rename gperf struct name to match other headers

This makes it easier to use the same generator script as for other
gperf scripts. With automake each gperf file had it's own rule, but
with meson I'm trying to use one script, and this inconsistency made
that harder.

7 years agotree-wide: standardize on $(PACKAGE_VERSION) for the version string
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 16:15:33 +0000 (12:15 -0400)]
tree-wide: standardize on $(PACKAGE_VERSION) for the version string

We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents.
$(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and
drop the other define.

7 years agobuild-sys: drop undefined target ref from Makefile.am
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:52:47 +0000 (20:52 -0400)]
build-sys: drop undefined target ref from Makefile.am

7 years agobuild-sys: drop undefined var ref from Makefile.am
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:52:03 +0000 (20:52 -0400)]
build-sys: drop undefined var ref from Makefile.am

7 years agobuild-sys: use a single ENABLE_LOGIND conditional
Zbigniew Jędrzejewski-Szmek [Mon, 3 Apr 2017 00:12:36 +0000 (20:12 -0400)]
build-sys: use a single ENABLE_LOGIND conditional

We used ENABLE_LOGIND for the automake conditional, and HAVE_LOGIND
for the ifdef. That wasn't wrong, but it certainly was confusing.

Also, move the ifdeffery to avoid warning about unused static function
logind_set_wall_message() when logind is disabled.

7 years agoshared/dissect-image: fix warning about unused function when !HAVE_BLKID
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2017 03:21:20 +0000 (23:21 -0400)]
shared/dissect-image: fix warning about unused function when !HAVE_BLKID

7 years agoMove busctl sources to src/busctl
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2017 02:49:02 +0000 (22:49 -0400)]
Move busctl sources to src/busctl

busctl is not part of libsystemd, and should not be stored under libsystemd.
In particular this is confusing because busctl is linked with libshared, but
stuff in libsystemd is not supposed to depend on libshared.

7 years agopo: fix typo in pt_BR
Martin Pitt [Tue, 4 Apr 2017 10:08:46 +0000 (12:08 +0200)]
po: fix typo in pt_BR

See https://github.com/systemd/systemd/pull/5694#issuecomment-291446842

7 years agoman: fix <function> tag (#5686)
Lucas Werkmeister [Tue, 4 Apr 2017 06:47:30 +0000 (08:47 +0200)]
man: fix <function> tag (#5686)

7 years agoUpdate Brazilian Portuguese translation (#5694)
Rafael Fontenelle [Mon, 3 Apr 2017 21:29:09 +0000 (18:29 -0300)]
Update Brazilian Portuguese translation (#5694)

7 years agohwdb: Asus TP300LJ accelerometer quirks (#5681)
wiertel [Mon, 3 Apr 2017 07:53:10 +0000 (09:53 +0200)]
hwdb: Asus TP300LJ accelerometer quirks (#5681)

iio-sensor-proxy expects the accelerometer oriented as follows:
positive x - to the right, positive y - up (opposite to gravity).
The hardware in the Asus TP300LJ-DW049H is however oriented
differently:
positive x - down, positive y - to the left
This commit adds a ACCEL_MOUNT_MATRIX quirk for this
particular laptop model.

7 years agocore: downgrade error message if command is prefixed with `-` and the command is...
Yu Watanabe [Mon, 3 Apr 2017 06:38:33 +0000 (15:38 +0900)]
core: downgrade error message if command is prefixed with `-` and the command is not found

Fixes #5621

7 years agoMerge pull request #5589 from jasonreeder/claimed_address_fix
Lennart Poettering [Sat, 1 Apr 2017 09:41:58 +0000 (11:41 +0200)]
Merge pull request #5589 from jasonreeder/claimed_address_fix

libsystemd-network: sd-ipv4ll: acquire new address after claimed addr…

7 years agoMerge pull request #5558 from dm0-/nspawn-resolved
Lennart Poettering [Sat, 1 Apr 2017 09:39:08 +0000 (11:39 +0200)]
Merge pull request #5558 from dm0-/nspawn-resolved

nspawn: fix DNS when the stub listener is disabled

7 years agolibsystemd-network: sd-ipv4ll: acquire new address after claimed address conflict
Jason Reeder [Fri, 31 Mar 2017 20:40:18 +0000 (15:40 -0500)]
libsystemd-network: sd-ipv4ll: acquire new address after claimed address conflict

If a conflict occurs on a claimed ipv4ll address, the device releases
the address and then does not attempt to acquire a new ipv4ll
address. According to RFC3927, releasing the address in this
situation is correct. However, this should be followed by an attempt
to configure a new ipv4ll address.

This commit restarts the ipv4ll address acquisition state machine
after releasing the conflicting address.

From RFC3927 Section 2.5 conflict defense method (b):
...
However, if this is not the first conflicting ARP packet the host has
seen, and the time recorded for the previous conflicting ARP packet is
recent, within DEFEND_INTERVAL seconds, then the host MUST immediately
cease using this address and configure a new IPv4 Link-Local address
as described above.
...

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
7 years agolibsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after conflict
Jason Reeder [Fri, 31 Mar 2017 19:23:10 +0000 (14:23 -0500)]
libsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after conflict

After an ipv4ll claimed address conflict occurs a new address needs
to be chosen and then the acquisition state machine needs to be
restarted.

This commit adds a function (sd_ipv4ll_restart) that clears the
previously acquired address (ll->address) and then calls the existing
sd_ipv4ll_start function to choose the new address and start the
acquisition.

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
7 years agonspawn: check if the DNS stub is listening for requests
David Michael [Wed, 8 Mar 2017 20:45:03 +0000 (12:45 -0800)]
nspawn: check if the DNS stub is listening for requests

7 years agoresolved: add a DNSStubListener property to Manager
David Michael [Wed, 8 Mar 2017 20:43:17 +0000 (12:43 -0800)]
resolved: add a DNSStubListener property to Manager

7 years agoudev: net_id - support predictable ifnames on vio buses (#5675)
Franck Bui [Fri, 31 Mar 2017 14:32:09 +0000 (16:32 +0200)]
udev: net_id - support predictable ifnames on vio buses (#5675)

For IBM PowerVM Virtual I/O network devices, we can build predictable names
based on the slot number passed as part of the OF "reg" property.  Valid slot
numbers range between 2-32767, so we only need the bottom half of the unit
address passed.

For example:

  /proc/device-tree/vdevice/l-lan@30000002
  /proc/device-tree/vdevice/vnic@30000005

would initially map to something like:

  /sys/devices/vio/30000002/net/eth0
  /sys/devices/vio/30000005/net/eth1

and would then translate to env2 and env5

This patch ignores the bus number, as there should only ever be one bus, and
then remove leading zeros.

7 years agonetworkd: RFC compliant autonomous prefix handling (#5636)
hendrikw01 [Fri, 31 Mar 2017 13:10:59 +0000 (15:10 +0200)]
networkd: RFC compliant autonomous prefix handling (#5636)

Previously, `lifetime_valid` of a Router Advertisement was not handled
the way RFC4862 has specified.

In particular: Sections 5.5.3.d and  5.5.3.e

7 years agoMerge pull request #5534 from ssahani/vxlan-label
Lennart Poettering [Fri, 31 Mar 2017 09:30:33 +0000 (11:30 +0200)]
Merge pull request #5534 from ssahani/vxlan-label

networkd: vxlan support setting IPv6 flow label

7 years agonetworkd: fix route_new_static assert when IPv4LLRoute=true (#5676)
Susant Sahani [Fri, 31 Mar 2017 06:29:20 +0000 (11:59 +0530)]
networkd: fix route_new_static assert when IPv4LLRoute=true (#5676)

fixes: #5664

7 years agodoc: spell out handle-* options, use <literal> syntax (#5673)
Michael Biebl [Fri, 31 Mar 2017 06:01:41 +0000 (08:01 +0200)]
doc: spell out handle-* options, use <literal> syntax (#5673)

7 years agojournal-upload: add state file directory to ReadWritePaths (#5578)
Yu Watanabe [Thu, 30 Mar 2017 16:01:03 +0000 (01:01 +0900)]
journal-upload: add state file directory to ReadWritePaths (#5578)

The commit c7fb922d6250543ba5462fa7a6ff03cc8f628e94 prohibits
journal-upload to save its state in /var/lib/systemd/journal-upload/state,
thus the daemon fails and outputs the following error message even if
the directory is not read-only file system
```Cannot save state to /var/lib/systemd/journal-upload/state: Read-only file system```
This commit adds the permission the daemon to write the state file.

7 years agoMerge pull request #5670 from poettering/trivialities
Martin Pitt [Thu, 30 Mar 2017 13:09:28 +0000 (15:09 +0200)]
Merge pull request #5670 from poettering/trivialities

trivial doc fixes

7 years agojournal: fix up syslog facility when forwarding native messages (#5667)
Michael Biebl [Thu, 30 Mar 2017 09:56:25 +0000 (11:56 +0200)]
journal: fix up syslog facility when forwarding native messages (#5667)

Native journal messages (_TRANSPORT=journal) typically don't have a
syslog facility attached to it. As a result when forwarding the messages
to syslog they ended up with facility 0 (LOG_KERN).
Apply syslog_fixup_facility() so we use LOG_USER instead.

Fixes: #5640

7 years agoman: use <varlistentry> for all unit entries
Lennart Poettering [Thu, 30 Mar 2017 09:54:45 +0000 (11:54 +0200)]
man: use <varlistentry> for all unit entries

So far, all sections of the systemd.special(7) man page used
<varlistentry> for listing the targets, with one exception: the
"Special Passive User Units" one. Let's clean this up and use the same
formatting everywhere.

7 years agoREADME: document that gperf 3.1 is required for building now
Lennart Poettering [Thu, 30 Mar 2017 09:54:23 +0000 (11:54 +0200)]
README: document that gperf 3.1 is required for building now

7 years agounits: move Before deps for quota services to remote-fs.target (#5627)
tblume [Thu, 30 Mar 2017 09:21:18 +0000 (11:21 +0200)]
units: move Before deps for quota services to remote-fs.target (#5627)

Creating quota on an iscsi device is causing dependency loops at next reboot.
Reason is that systemd-quotacheck and quotaon.service are ordered before
local-fs.target and quota enabled mounts have a before dependency to them.
This cannot work for _netdev mounts, because network activation is ordered
after local-fs.target.
Moving the Before dependency for systemd-quotacheck and quotaon.service
to remote-fs.target fixes this.

7 years agosysv-generator: Provides: $network should also pull network.target to transaction...
Lukáš Nykrýn [Thu, 30 Mar 2017 09:12:50 +0000 (11:12 +0200)]
sysv-generator: Provides: $network should also pull network.target to transaction (#5652)

network.target should be pulled in to the transaction
by the unit that provides network services, but currently
for initscripts it only pulls in network-online.target.

7 years agoserial-getty@.service.m4: add Conflicts=/Before= against rescue.service (#5632)
Franck Bui [Thu, 30 Mar 2017 08:39:16 +0000 (10:39 +0200)]
serial-getty@.service.m4: add Conflicts=/Before= against rescue.service (#5632)

Commit 5ed020d8d10fc100c68edddb519f085b7397a45c already fixed this issue for
getty@.service but forgot serial console.

Note that this is not needed for emergency target as the sysinit target
conflicts against this target already.

7 years agoman: clarify that handle-lid-switch is a low level inhibitor lock (#5662)
Michael Biebl [Thu, 30 Mar 2017 08:12:54 +0000 (10:12 +0200)]
man: clarify that handle-lid-switch is a low level inhibitor lock (#5662)

… like the other handle-*-key inhibitor locks.

Follow-up for 05b2a8fd7a0533758d2f532df798cabc3c442683

Fixes: #5647

7 years agoMerge pull request #5663 from keszybz/test-sizeof-more
Lennart Poettering [Thu, 30 Mar 2017 07:58:05 +0000 (09:58 +0200)]
Merge pull request #5663 from keszybz/test-sizeof-more

Add a few `struct timespec`-related types to `test-sizeof`

7 years agotest-sizeof: add some struct-timespec related fields
Zbigniew Jędrzejewski-Szmek [Thu, 30 Mar 2017 01:31:58 +0000 (21:31 -0400)]
test-sizeof: add some struct-timespec related fields

Might help with #5264.

7 years agotest-sizeof: do not link with libsystemd-shared
Zbigniew Jędrzejewski-Szmek [Thu, 30 Mar 2017 01:31:21 +0000 (21:31 -0400)]
test-sizeof: do not link with libsystemd-shared

This makes it much quicker to compile.

7 years agobasic: forbid rm_rf() to remove paths ending with ".." (#5653)
Jan Synacek [Wed, 29 Mar 2017 06:25:52 +0000 (08:25 +0200)]
basic: forbid rm_rf() to remove paths ending with ".." (#5653)

Fixes: #5644