platform/upstream/systemd.git
7 years agoOnly drop the capabilities from the bounding set if we are running as PID1 (#6204)
Lennart Poettering [Wed, 28 Jun 2017 17:29:45 +0000 (19:29 +0200)]
Only drop the capabilities from the bounding set if we are running as PID1 (#6204)

The CapabilityBoundingSet option only makes sense if we are running as
PID1.

The system.conf.d(5) manpage, already states that the CapabilityBoundingSet
option:
  Controls which capabilities to include in the capability bounding set
  for PID 1 and its children.

https://github.com/systemd/systemd/issues/6080

7 years agoudev: never ask libblkid for detecting superblocks with bad checksums (#6215)
Lennart Poettering [Wed, 28 Jun 2017 17:27:40 +0000 (19:27 +0200)]
udev: never ask libblkid for detecting superblocks with bad checksums (#6215)

Previously, we'd ask liblkid to also tell us about recognized
superblocks with bad checksums. We'd then log about them and ignore
them. This however created ambuigity problems, see #6110: the
BLKID_SUBLKS_BADCSUM is not as innocent as it appears.

This patch drops bad checksum handling and we ignore all such superblocks
entirely again, as it was the status quo ante
d47f6ca5f9b7a0b400d8bdb050151a0284fb4bdb (where this was snuck in).

Ideally, libblkid would be changed to avoid this ambiguity problems for
bad checksums, but that's not going to happen any time soon, according
to @karelzak.

Fixes: #6110

7 years agonspawn: register a scope for the unit if --register=no is specified (#6166)
Lennart Poettering [Wed, 28 Jun 2017 17:22:46 +0000 (19:22 +0200)]
nspawn: register a scope for the unit if --register=no is specified (#6166)

Previously, only when --register=yes was set (the default) the invoked
container would get its own scope, created by machined on behalf of
nspawn. With this change if --register=no is set nspawn will still get
its own scope (which is a good thing, so that --slice= and --property=
take effect), but this is not done through machined but by registering a
scope unit directly in PID 1.

Summary:

--register=yes             → allocate a new scope through machined (the default)
--register=yes --keep-unit → use the unit we are already running in an register with machined
--register=no              → allocate a new scope directly, but no machined
--register=no --keep-unit  → do not allocate nor register anything

Fixes: #5823

7 years agosd-bus: never augment creds when we are operating on remote connections (#6217)
Lennart Poettering [Wed, 28 Jun 2017 17:20:16 +0000 (19:20 +0200)]
sd-bus: never augment creds when we are operating on remote connections (#6217)

It's not always clear when something is a remote connection, hence only
flag the obvious cases as local.

Fixes: #6207

7 years agoman: update reference for binfmt documentation (#6223)
Stefan Schweter [Wed, 28 Jun 2017 17:18:37 +0000 (19:18 +0200)]
man: update reference for binfmt documentation (#6223)

7 years agoresolved: drop unnecessary comparison (#6220)
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jun 2017 16:24:37 +0000 (12:24 -0400)]
resolved: drop unnecessary comparison (#6220)

mtu is always greater than UDP_PACKET_HEADER_SIZE at this point.
Pointed out by Benjamin Robin.

7 years agoMerge pull request #6222 from keszybz/input-id-rules-installation
Michael Biebl [Wed, 28 Jun 2017 15:40:12 +0000 (17:40 +0200)]
Merge pull request #6222 from keszybz/input-id-rules-installation

build-sys: fix installation of new 60-input-id.rules

7 years agobuild-sys: fix installation of new 60-input-id.rules
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jun 2017 15:19:33 +0000 (11:19 -0400)]
build-sys: fix installation of new 60-input-id.rules

Fixup for 38887d1bd5eb037a532279b2b75d6a87ce381419.

7 years agoMerge pull request #6214 from keszybz/resolved-packet-size
Lennart Poettering [Wed, 28 Jun 2017 07:10:56 +0000 (09:10 +0200)]
Merge pull request #6214 from keszybz/resolved-packet-size

Resolved packet size

7 years agoMerge pull request #6099 from hramrach/master
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 23:07:23 +0000 (19:07 -0400)]
Merge pull request #6099 from hramrach/master

Enable mapping button events on keyboard.

7 years agoMerge pull request #6202 from poettering/condition-first-boot-doc
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 22:34:18 +0000 (18:34 -0400)]
Merge pull request #6202 from poettering/condition-first-boot-doc

some documentation updates

7 years agoMerge pull request #6210 from poettering/input-mask
Lennart Poettering [Tue, 27 Jun 2017 21:24:21 +0000 (23:24 +0200)]
Merge pull request #6210 from poettering/input-mask

logind: make use of EVIOCSMASK input ioctl to mask out events we aren…

7 years agoresolved: define various packet sizes as unsigned
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 20:59:06 +0000 (16:59 -0400)]
resolved: define various packet sizes as unsigned

This seems like the right thing to do, and apparently at least some compilers
warn about signed/unsigned comparisons with DNS_PACKET_SIZE_MAX.

7 years agoresolved: do not allocate packets with minimum size
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 18:20:00 +0000 (14:20 -0400)]
resolved: do not allocate packets with minimum size

dns_packet_new() is sometimes called with mtu == 0, and in that case we should
allocate more than the absolute minimum (which is the dns packet header size),
otherwise we have to resize immediately again after appending the first data to
the packet.

This partially reverts the previous commit.

7 years agoMerge pull request #5930 from larskarlitski/journal-skip
Lennart Poettering [Tue, 27 Jun 2017 20:10:38 +0000 (22:10 +0200)]
Merge pull request #5930 from larskarlitski/journal-skip

journal: return 0 from _skip() when skip is 0

7 years agoresolved: Recover from slow DNS responses
Kai Krakow [Sat, 13 May 2017 10:30:56 +0000 (12:30 +0200)]
resolved: Recover from slow DNS responses

When DNS is unreliable temporarily, the current implementation will
never improve resend behavior again and switch DNS servers only late
(current maximum timeout is 5 seconds).

We can improve this by biasing the resend_timeout back to the current
RTT when a successful response was received. Next time, a timeout is hit
on this server, it will switch to the next server faster.

Fixes: #5953

7 years agoman: extend Before=/After= documentation a bit
Lennart Poettering [Mon, 26 Jun 2017 17:23:54 +0000 (19:23 +0200)]
man: extend Before=/After= documentation a bit

let's clarify what the order actually means for service units.

Fixes: #6097

7 years agoman: improve documentation of ExecStartPost= a bit
Lennart Poettering [Mon, 26 Jun 2017 17:23:21 +0000 (19:23 +0200)]
man: improve documentation of ExecStartPost= a bit

Let's make clear what start-up really means in this case.

See: #6097

7 years agoman: be more precise on the ConditionFirstBoot= documentation
Lennart Poettering [Mon, 26 Jun 2017 17:11:09 +0000 (19:11 +0200)]
man: be more precise on the ConditionFirstBoot= documentation

Fixes: #5696

7 years agoMerge pull request #5976 from fbuihuu/swap-fix
Lennart Poettering [Tue, 27 Jun 2017 18:28:56 +0000 (20:28 +0200)]
Merge pull request #5976 from fbuihuu/swap-fix

Swap fix

7 years agologind: relax udev rules matching devices logind watches for
Lennart Poettering [Tue, 27 Jun 2017 14:14:30 +0000 (16:14 +0200)]
logind: relax udev rules matching devices logind watches for

Now that we have support for key/switch masking in logind, we can relax
the rules by which logind picks the devices to watch a bit, after all we
won't wake up anymore for every single event, but instead only the
events we actually care about.

This should make power/suspend keys on normal usb/atkbd keyboards just
work.

7 years agologind: filter out input devices that have none of the keys/switche we care about
Lennart Poettering [Tue, 27 Jun 2017 15:46:28 +0000 (17:46 +0200)]
logind: filter out input devices that have none of the keys/switche we care about

Let's check what keys are there, before we actually hang on to the
opened devices.

7 years agologind: make use of EVIOCSMASK input ioctl to mask out events we aren't interested in
Lennart Poettering [Mon, 26 Jun 2017 19:35:12 +0000 (21:35 +0200)]
logind: make use of EVIOCSMASK input ioctl to mask out events we aren't interested in

This way logind will get woken up only when an actual event took place,
and not for every key press on the system.

The ioctl EVIOCSMASK was added by @dvdhrm already in October 2015, for
the use in logind, among others, hence let's actually make use of it
now.

While we are at it, also fix usage of the EVIOCGSW ioctl, where we
assumed a byte array, even though a unsigned long native endian array is
returned.

7 years agoresolved: simplify alloc size calculation
Zbigniew Jędrzejewski-Szmek [Sun, 18 Jun 2017 20:07:57 +0000 (16:07 -0400)]
resolved: simplify alloc size calculation

The allocation size was calculated in a complicated way, and for values
close to the page size we would actually allocate less than requested.

Reported by Chris Coulson <chris.coulson@canonical.com>.

CVE-2017-9445

7 years agotest-resolved-packet: add a simple test for our allocation functions
Zbigniew Jędrzejewski-Szmek [Sun, 18 Jun 2017 19:53:15 +0000 (15:53 -0400)]
test-resolved-packet: add a simple test for our allocation functions

7 years agoMerge pull request #6067 from ssahani/networkctl
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 15:41:09 +0000 (11:41 -0400)]
Merge pull request #6067 from ssahani/networkctl

networkctl: display address labels

7 years agoAdd networkctl label to man and shell completion
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 14:30:41 +0000 (10:30 -0400)]
Add networkctl label to man and shell completion

7 years agonetworkctl: display address labels
Susant Sahani [Mon, 26 Jun 2017 17:58:10 +0000 (23:28 +0530)]
networkctl: display address labels

```
 ./networkctl label

    Prefix/Prefixlen                          Label
        ::/0                                  1
    fc00::/7                                  5
    fec0::/10                                11
    2002::/16                                 2
    3ffe::/16                                12
 2001:10::/28                                 7
    2001::/32                                 6
::ffff:0.0.0.0/96                                 4
        ::/96                                 3
       ::1/128                                0

```

7 years agoMerge pull request #6201 from poettering/bus-driver-creds
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 14:11:21 +0000 (10:11 -0400)]
Merge pull request #6201 from poettering/bus-driver-creds

shortcut credential querying of the "org.freedesktop.DBus" bus driver pseudo-service

7 years agohwdb: weed out key defines which do not designate events
Michal Suchanek [Thu, 15 Jun 2017 10:50:05 +0000 (12:50 +0200)]
hwdb: weed out key defines which do not designate events

The defines

KEY_MAX
KEY_CNT
KEY_MIN_INTERESTING
BTN_MISC
BTN_MOUSE
BTN_JOYSTICK
BTN_GAMEPAD
BTN_DIGI
BTN_WHEEL
BTN_TRIGGER_HAPPY

mark start/end of key blocks and do not designate events.

Exclude them from the list of recognized key events.

7 years agoinput_id: fix button detection
Michal Suchanek [Wed, 14 Jun 2017 15:15:36 +0000 (17:15 +0200)]
input_id: fix button detection

Due to remapping some devices might not have the first button.

Check whole button range.

7 years agoinput_id: fix detection of devices with mouse buttons
Michal Suchanek [Mon, 12 Jun 2017 12:09:55 +0000 (14:09 +0200)]
input_id: fix detection of devices with mouse buttons

Assign ID_INPUT_MOUSE property to devices with mouse buttons and no axis.

Libinput tries to use libwacom on devices with tablet-pad capability
which are detected by ID_INPUT_TABLET_PAD=1 property so assign pointer
class by setting ID_INPUT_MOUSE=1 to devices with mouse buttons and let
libwacom override the class for Wacom pads.

7 years agorules: move input_id rule to a separate file
Michal Suchanek [Mon, 12 Jun 2017 11:43:05 +0000 (13:43 +0200)]
rules: move input_id rule to a separate file

This places the input_id call after the evdev hwdb calls. With this the
hwdb fixups in evdev can affect the device capabilities assigned in
input_id.

Remove the ID_INPUT_KEY dependency in atkbd rule because it is now not
assigned at this point.

7 years agohwdb: fix help text in 60-keyboard.hwdb
Michal Suchanek [Wed, 7 Jun 2017 17:26:25 +0000 (19:26 +0200)]
hwdb: fix help text in 60-keyboard.hwdb

udevadm trigger /dev/input/event* does not work
use udevadm trigger --verbose --sysname-match="event*"

7 years agohwdb: support pressing buttons on a keyboard
Michal Suchanek [Wed, 7 Jun 2017 13:28:18 +0000 (15:28 +0200)]
hwdb: support pressing buttons on a keyboard

Support BTN_* codes with btn_ prefix and keys with KEY_ prefix
optionally removed.

7 years agoUse same script to build key list in Makefile and meson
Michal Suchanek [Tue, 27 Jun 2017 09:48:45 +0000 (11:48 +0200)]
Use same script to build key list in Makefile and meson

7 years agogpt-auto-generator: disable gpt auto logic for swaps if at least one is defined in...
Franck Bui [Mon, 26 Jun 2017 13:23:35 +0000 (15:23 +0200)]
gpt-auto-generator: disable gpt auto logic for swaps if at least one is defined in fstab

If a swap partition is created on a disk using GPT then the unit generated by
the gpt-generator can shadow the one generated by the fstab-generator.

This can be an issue if the fstab entry for the swap has options since they are
simply ignored if PID1 decides to use the unit created by the gpt-generator
since this unit carries no information about the swap options.

This patch simply disables the GPT auto logic for swaps if at least one entry
for swap is defined in /etc/fstab.

Fixes: #6192

7 years agofstab-util: introduce fstab_has_fstype() helper
Franck Bui [Mon, 26 Jun 2017 13:22:10 +0000 (15:22 +0200)]
fstab-util: introduce fstab_has_fstype() helper

7 years agofstab-util: don't eat up errors in fstab_is_mount_point()
Franck Bui [Tue, 27 Jun 2017 07:52:12 +0000 (09:52 +0200)]
fstab-util: don't eat up errors in fstab_is_mount_point()

That way the caller can decide what to do with failures, whether to consider
them or ignore them.

7 years agodoc: Add an example for target units (#5951)
Janne Heß [Tue, 27 Jun 2017 07:50:28 +0000 (09:50 +0200)]
doc: Add an example for target units (#5951)

This adds an example target unit to the man page of systemd targets.

Closes #67.

7 years agoMerge pull request #6200 from poettering/ioprio-transient
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 01:19:33 +0000 (21:19 -0400)]
Merge pull request #6200 from poettering/ioprio-transient

7 years agoMerge pull request #6197 from ssahani/ethtool-port
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:19:53 +0000 (20:19 -0400)]
Merge pull request #6197 from ssahani/ethtool-port

ethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8

7 years agoudev: fix some incorrect usages of CLOCK_BOOTTIME (#6198)
Lennart Poettering [Tue, 27 Jun 2017 00:17:39 +0000 (02:17 +0200)]
udev: fix some incorrect usages of CLOCK_BOOTTIME (#6198)

CLOCK_BOOTTIME should only be used if we actually want the clock to
count on while we are suspended, and it is hence not useful for normal
code execution time limits, fix that.

Moreover, a couple of uses were even more broken, as
clock_bottime_or_monotonic() was called where actually
now(clock_boottime_or_monotic()) was supposed to be called. Ouch!

Fixes: #5903

7 years agoMerge pull request #6199 from poettering/systemctl-quiet
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:16:39 +0000 (20:16 -0400)]
Merge pull request #6199 from poettering/systemctl-quiet

systemctl: be truly quiet in systemctl when -q is used

7 years agoMerge pull request #6203 from poettering/import-assert
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jun 2017 00:03:14 +0000 (20:03 -0400)]
Merge pull request #6203 from poettering/import-assert

remove misplaced importd assert

7 years agoMerge pull request #6160 from poettering/non-pollable-fdstore
Evgeny Vereshchagin [Mon, 26 Jun 2017 21:22:58 +0000 (00:22 +0300)]
Merge pull request #6160 from poettering/non-pollable-fdstore

support for non-pollable fds in the service fdstore

7 years agosystemd-mount: support device names and multiple arguments for umount (#6096)
Yu Watanabe [Mon, 26 Jun 2017 20:07:07 +0000 (05:07 +0900)]
systemd-mount: support device names and multiple arguments for umount (#6096)

This makes systemd-umount (or systemd-mount -u) supports multiple arguments
which can be path, device, or fstab style node name, like
`systemd-umount /path/to/umount /dev/sda1 UUID=xxxxxx-xxxx LABEL=xxxxx`.

C.f. https://github.com/systemd/systemd/pull/5235#issuecomment-277731314.

7 years agosmack: handling smack onlycap list (#5542)
WaLyong Cho [Mon, 26 Jun 2017 19:00:03 +0000 (04:00 +0900)]
smack: handling smack onlycap list (#5542)

To support smack onlycap, read onlycap list from /etc/smack/onlycap and write
to /sys/fs/smackfs/onlycap.

https://lwn.net/Articles/292128/
http://lkml.iu.edu/hypermail/linux/kernel/1505.2/04718.html
http://schaufler-ca.com/description_from_the_linux_source_tree

7 years agoMerge pull request #6116 from richardmaw-codethink/networkd-carrier-fixes
Lennart Poettering [Mon, 26 Jun 2017 18:55:36 +0000 (20:55 +0200)]
Merge pull request #6116 from richardmaw-codethink/networkd-carrier-fixes

Networkd fixes related to carrier status

7 years agosystemctl: quieten a few more messages if -q is specified
Lennart Poettering [Mon, 26 Jun 2017 18:42:08 +0000 (20:42 +0200)]
systemctl: quieten a few more messages if -q is specified

As suggested by @mbiebl in https://github.com/systemd/systemd/pull/6199

7 years agoimportd: log more information when renaming files
Lennart Poettering [Mon, 26 Jun 2017 18:32:40 +0000 (20:32 +0200)]
importd: log more information when renaming files

7 years agoimport: remove misplaced assert()
Lennart Poettering [Mon, 26 Jun 2017 18:25:07 +0000 (20:25 +0200)]
import: remove misplaced assert()

We shouldn't assume the final path for the settings file is already
known, it unlikely is unless we already downloaded the image once. Also
add some commenting to explain the code surrounding the assert a bit.

Fixes: #6188

7 years agosd-bus: use GetConnectionCredentials() when querying credentials, if available
Lennart Poettering [Mon, 26 Jun 2017 16:52:47 +0000 (18:52 +0200)]
sd-bus: use GetConnectionCredentials() when querying credentials, if available

Newer D-Bus versions implement the GetConnectionCredentials() driver
call to get all connection creds in one go. Make use of that to reduce
the number of bus calls we do.

When only a single credential field is queried we will still use the old
calls, which we'll also use if the new call isn't implemented.

7 years agosd-bus: when credentials of the "org.freedesktop.DBus" service are queried return...
Lennart Poettering [Mon, 26 Jun 2017 16:24:58 +0000 (18:24 +0200)]
sd-bus: when credentials of the "org.freedesktop.DBus" service are queried return the bus owner's credentials

The bus driver service is always implemented by the owner of the bus,
hence let's shortcut the credential operation and use our cached data.
This makes sure things simply work, given that dbus itself doesn't
support GetConnectionSELinuxSecurityContext() on the bus driver name
itself.

Fixes: #6120

7 years agocore: when parsing integers passed over the bus use int32_t, not int
Lennart Poettering [Mon, 26 Jun 2017 15:41:54 +0000 (17:41 +0200)]
core: when parsing integers passed over the bus use int32_t, not int

sd-bus will return "i" integers as "int32_t", not "int". Now on all
archs we care about that's the same, but we still should do this
properly.

7 years agocore: make IOSchedulingClass= and IOSchedulingPriority= settable for transient units
Lennart Poettering [Mon, 26 Jun 2017 15:40:08 +0000 (17:40 +0200)]
core: make IOSchedulingClass= and IOSchedulingPriority= settable for transient units

This patch is a bit more complex thant I hoped. In particular the single
IOScheduling= property exposed on the bus is split up into
IOSchedulingClass= and IOSchedulingPriority= (though compat is
retained). Otherwise the asymmetry between setting props and getting
them is a bit too nasty.

Fixes #5613

7 years agoethtool: warn when ethtool_set_glinksettings not supported
Susant Sahani [Mon, 26 Jun 2017 15:35:52 +0000 (21:05 +0530)]
ethtool: warn when ethtool_set_glinksettings not supported

This is useful when port is not set and should be notified to user.

7 years agosystemctl: be truly quiet in systemctl -q is-enabled
Lennart Poettering [Mon, 26 Jun 2017 14:11:20 +0000 (16:11 +0200)]
systemctl: be truly quiet in systemctl -q is-enabled

Fixes: #6196

7 years agoswap: make use of IN_SET()
Franck Bui [Wed, 17 May 2017 10:43:59 +0000 (12:43 +0200)]
swap: make use of IN_SET()

Minor cleanups, no functional changes.

7 years agoswap: make use of manager_get_unit() in swap.c
Franck Bui [Tue, 16 May 2017 19:27:44 +0000 (21:27 +0200)]
swap: make use of manager_get_unit() in swap.c

Minor cleanup, no functional changes.

7 years agocore: make NotifyAccess= and FileDescriptorStoreMax= available to transient services
Lennart Poettering [Wed, 21 Jun 2017 17:17:38 +0000 (19:17 +0200)]
core: make NotifyAccess= and FileDescriptorStoreMax= available to transient services

This is helpful for debugging/testing #5606.

7 years agocore: permit FDSTORE=1 messages with non-pollable fds
Lennart Poettering [Tue, 20 Jun 2017 21:30:30 +0000 (23:30 +0200)]
core: permit FDSTORE=1 messages with non-pollable fds

This also alters the documentation to recommend memfds rather than /run
for serializing state across reboots. That's because /run doesn't
actually have the same lifecycle as the fd store, as it is cleared out
on restarts.

Fixes: #5606

7 years agoethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8
Susant Sahani [Mon, 26 Jun 2017 13:07:38 +0000 (18:37 +0530)]
ethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8

We should use the DIV_ROUND_UP

7 years agomeson: stop setting the linker (#6182)
Zbigniew Jędrzejewski-Szmek [Mon, 26 Jun 2017 13:00:46 +0000 (09:00 -0400)]
meson: stop setting the linker (#6182)

If wanted, the linker can be set with LDFLAGS (LDFLAGS=-Wl,-fuse-ld=gold meson ...),
and setting it internally was interfering with that. It seems that both gold and
bfd work very well and quick, and the reasons we had to prefer gold are not relevant
anymore.

Fixes #6169.

7 years agohwdb: Add ID_INPUT_JOYSTICK_INTEGRATION property (#5413)
hadess [Mon, 26 Jun 2017 10:17:36 +0000 (12:17 +0200)]
hwdb: Add ID_INPUT_JOYSTICK_INTEGRATION property (#5413)

When the joystick is integrated directly into the machine, knowing
that the device is internal allows us to disable attached functionality
when the device is not used or inaccessible.

For example, this allows disabling rumble and accelerometer on
flip-console-like devices like the GPD-XD.

7 years agohwdb: Cytrix Complex 11t accelerometer support (#5807)
James Hemsing [Mon, 26 Jun 2017 09:27:45 +0000 (03:27 -0600)]
hwdb: Cytrix Complex 11t accelerometer support (#5807)

Add quirk to fix portrait orientations resulting in an upside-down
screen on the Cytrix/Mytrix/Cube Complex 11t tablet.

7 years agocore: allow specifiers to be resolved in Environment= passed over dbus (#6144)
Zbigniew Jędrzejewski-Szmek [Mon, 26 Jun 2017 09:26:59 +0000 (05:26 -0400)]
core: allow specifiers to be resolved in Environment= passed over dbus (#6144)

When specifiers are included in the Environment block in StartTransientUnit,
we resolve specifiers on the PID1 side. Nevertheless we store the unresolved
version in the transient unit file, so that it'll be resolved when loading
the unit. I think this looks nicer.

I also removed the writing of the merged Environment block to the transient
file. Afaict, this resulted in variables being written multiple times, but
this needs to be tested properly.

Fixes #5699.

7 years agoCopy defines for renameat2 from casync (#6181)
Zbigniew Jędrzejewski-Szmek [Mon, 26 Jun 2017 07:34:03 +0000 (03:34 -0400)]
Copy defines for renameat2 from casync (#6181)

7 years agocore/loopback-setup: set a timeout for the kernel reply (#6187)
Zbigniew Jędrzejewski-Szmek [Mon, 26 Jun 2017 07:33:37 +0000 (03:33 -0400)]
core/loopback-setup: set a timeout for the kernel reply (#6187)

This shouldn't happen, but just in case for any reason the kernel
doesn't answer, it's probably much better to continue.

Follow-up for fb8939274a93d713575a409e9baab55a5638863a.

7 years agosystemd-link: add support to configure the device port (#6153)
Susant Sahani [Sun, 25 Jun 2017 22:42:57 +0000 (22:42 +0000)]
systemd-link: add support to configure the device port (#6153)

This work allows to configure device port:

tp — An Ethernet interface using Twisted-Pair cable as the medium.
aui — Attachment Unit Interface (AUI). Normally used with hubs.
bnc — An Ethernet interface using BNC connectors and co-axial cable.
mii — An Ethernet interface using a Media Independent Interface (MII).
fibre — An Ethernet interface using Optical Fibre as the medium.

7 years agoAdded slovak translation (#6191)
Dušan Kazik [Sun, 25 Jun 2017 17:19:10 +0000 (19:19 +0200)]
Added slovak translation (#6191)

Create sk.po and update LINGUAS.

7 years agoMerge pull request #6189 from keszybz/parse-hwdb-timeout
Michael Biebl [Sun, 25 Jun 2017 02:01:25 +0000 (04:01 +0200)]
Merge pull request #6189 from keszybz/parse-hwdb-timeout

meson: increase timeout for parse_hwdb.py test to 90 s

7 years agomeson: increase timeout for parse_hwdb.py test to 90 s
Michael Biebl [Sat, 24 Jun 2017 23:24:20 +0000 (19:24 -0400)]
meson: increase timeout for parse_hwdb.py test to 90 s

Fixes #5846.

7 years agoMerge pull request #5600 from fbuihuu/make-logind-restartable
Zbigniew Jędrzejewski-Szmek [Sat, 24 Jun 2017 22:58:36 +0000 (18:58 -0400)]
Merge pull request #5600 from fbuihuu/make-logind-restartable

Make logind restartable.

7 years agomake nss-systemd support conditional (#6155)
Waldemar Brodkorb [Sat, 24 Jun 2017 17:30:26 +0000 (19:30 +0200)]
make nss-systemd support conditional (#6155)

This allows the nss-systemd module to be disabled on minimal installations.

7 years agoMerge pull request #6185 from keszybz/env-serialization
Evgeny Vereshchagin [Sat, 24 Jun 2017 16:37:45 +0000 (19:37 +0300)]
Merge pull request #6185 from keszybz/env-serialization

Environment serialization fixes

7 years agotests: add tests for environment serialization
Zbigniew Jędrzejewski-Szmek [Sat, 24 Jun 2017 00:43:48 +0000 (20:43 -0400)]
tests: add tests for environment serialization

7 years agobasic/env-util: when serializing, actually use escaping
Zbigniew Jędrzejewski-Szmek [Sat, 24 Jun 2017 00:27:12 +0000 (20:27 -0400)]
basic/env-util: when serializing, actually use escaping

Fixes #6152.

7 years agomanager: just warn about an invalid environment entry
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2017 23:20:54 +0000 (19:20 -0400)]
manager: just warn about an invalid environment entry

Apart from bugs (as in #6152), this can happen if we ever make
our requirements for environment entries more stringent. As with
the rest of deserialization, we should just warn and continue.

7 years agomanager: raise level of notices about failed deserialization
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2017 23:17:40 +0000 (19:17 -0400)]
manager: raise level of notices about failed deserialization

This is something that shouldn't happen. If it does, we want to
know about it.

7 years agocore: fix typo (#6183)
Torstein Husebø [Fri, 23 Jun 2017 22:53:29 +0000 (00:53 +0200)]
core: fix typo (#6183)

7 years agoMerge pull request #6179 from poettering/loopback-addr
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2017 19:49:40 +0000 (15:49 -0400)]
Merge pull request #6179 from poettering/loopback-addr

Synchronously set up IP addresses of loopback device in loopback-setup.c.

7 years agoloopback-setup: also add IP addresses to loopback devices
Lennart Poettering [Fri, 23 Jun 2017 10:07:03 +0000 (12:07 +0200)]
loopback-setup: also add IP addresses to loopback devices

This changes loopback setup to not only start the loopback device but
also add the relevant IP addresses to it. This way, we can synchronously
wait until that's complete, and properly guarantee that loopback setup
is complete at the time we start our first processes.

This is a semi-revert of f3fc48150bb443f5b4623a819ebc2b39971a4f66, but
heavily updated.

Fixes: #5641

7 years agotest: show debug log output during test-loopback
Lennart Poettering [Fri, 23 Jun 2017 10:06:58 +0000 (12:06 +0200)]
test: show debug log output during test-loopback

7 years agoMerge pull request #6151 from speakinghedge/6150-LLDP-messages-containing-padding...
Lennart Poettering [Fri, 23 Jun 2017 07:57:23 +0000 (09:57 +0200)]
Merge pull request #6151 from speakinghedge/6150-LLDP-messages-containing-padding-are-dropped

accept LLDP messages containing padding

7 years agoadd note that explains relaxed bytes-left check #6150
hecke [Fri, 23 Jun 2017 06:55:01 +0000 (08:55 +0200)]
add note that explains relaxed bytes-left check #6150

7 years agonspawn: make sure to send SIGTERM/SIGHUP to the main nspawn process if stubinit recei...
Lennart Poettering [Fri, 23 Jun 2017 02:20:09 +0000 (04:20 +0200)]
nspawn: make sure to send SIGTERM/SIGHUP to the main nspawn process if stubinit receives SIGRTMIN+3 (#6167)

This code already existed in some form, however commented. Remove the
comments, as this was most likely simply a forgotten commenting for
debugging purposes.

This also extends the logic a bit, by sending SIGHUP right after the
SIGTERM, so that shells will also terminate, when PID 1 gets a
SIGRTMIN+3.

Fixes: #5711

7 years agoMerge pull request #6176 from poettering/timer-boottime-monotonic
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2017 01:34:39 +0000 (21:34 -0400)]
Merge pull request #6176 from poettering/timer-boottime-monotonic

WakeSystem= and other timer fixes.

7 years agomeson: do not use path separator for target name (#6177)
Yu Watanabe [Fri, 23 Jun 2017 01:27:07 +0000 (10:27 +0900)]
meson: do not use path separator for target name (#6177)

Fixes #6158.

7 years agomeson: install manual and unsafe tests (#6178)
Michael Biebl [Fri, 23 Jun 2017 01:23:30 +0000 (03:23 +0200)]
meson: install manual and unsafe tests (#6178)

Always install all tests if install-tests is set to true, as they might
be useful for CI. This includes manual and unsafe tests. Install those
in subdirectories of /usr/lib/systemd/tests.

Fixes #6163.

7 years agoMerge pull request #6164 from poettering/bus-non-existant-object
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2017 00:56:59 +0000 (20:56 -0400)]
Merge pull request #6164 from poettering/bus-non-existant-object

sd-bus: don't treat requests for non-existent objects as connection errors

7 years agocore: return a friendlier error for a dbus path referring to a non-existent unit
Lennart Poettering [Wed, 21 Jun 2017 18:45:23 +0000 (20:45 +0200)]
core: return a friendlier error for a dbus path referring to a non-existent unit

See: #6059

7 years agocore: unset sysfs path after transition to dead state (#6174)
Michal Sekletar [Fri, 23 Jun 2017 00:29:15 +0000 (02:29 +0200)]
core: unset sysfs path after transition to dead state (#6174)

Device is gone and most likely it will get garbage collected. However in
cases when it doesn't get gc'ed (because it is referenced by some
other unit, e.g. mount from fstab) we need to unset sysfs. This is
because when device appears next time, possibly, with different sysfs
path we need to update the sysfs path. Current code could end up caching
stale sysfs path forever.

In reality this is not a problem for normal disks (unless you swap them
during system runtime). However this issue causes failures to mount
filesystems on LVM where sysfs path depends on activation
order (i.e. logical volumes from volume group that is activated first
get assigned lower dm-X numbers and corresponding syspaths).

Fixes #6126.

7 years agocore: dbus: Interpret released names properly (#6175)
Michal Koutný [Fri, 23 Jun 2017 00:26:04 +0000 (02:26 +0200)]
core: dbus: Interpret released names properly (#6175)

When a DBus name is released, NameOwnerChanged signal contains an empty string
as new_owner. Commit bbc2908 changed interpretation of the empty string to a
valid name, which is not consistent with values that are sent by dbus-daemon.

As a side effect, this masks symptoms of systemd-logind dbus disconnections
(#2925) by completely restarting it so it can freshly reconnect to dbus.

7 years agotests: show current monotonic/boottime/realtime clock values in test-time
Lennart Poettering [Thu, 22 Jun 2017 19:10:34 +0000 (21:10 +0200)]
tests: show current monotonic/boottime/realtime clock values in test-time

When debugging time issues its kinda handy to have an easy way to query
the three clocks, hence let's just output them at the beginning of
test-time.

7 years agotimer: make sure we use the right monotonic timestamp
Lennart Poettering [Thu, 22 Jun 2017 19:04:20 +0000 (21:04 +0200)]
timer: make sure we use the right monotonic timestamp

This reworks timer_enter_waiting() in a couple of ways in order to clean
it up a bit and fix #5629.

Most importantly, we previously we initialized ts_monotonic to either
the current time in CLOCK_MONOTONIC or in CLOCK_BOOTTIME, depending on
t->wake_system. Then given specific conditions we'd use this time as
base for our timers. And afterwards, if t->wake_system was on we'd
convetr the resulting value from CLOCK_MONOTONIC to CLOCK_BOOTTIME again
— which of course is wrong since we already were in CLOCK_BOOTTIME! This
fixes this logic, by using a triple timestamp so that we always have the
right base around, and initially only calculate in CLOCK_MONOTONIC and
only convert as last step.

Conversion between the clocks is now done with the generic
usec_shift_clock(), and additions via usec_add() making these
calculations a bit safer.

Fixes: #5629

7 years agotimer: convert property_get_next_elapse_monotonic() to use usec_shift_clock()
Lennart Poettering [Thu, 22 Jun 2017 18:59:48 +0000 (20:59 +0200)]
timer: convert property_get_next_elapse_monotonic() to use usec_shift_clock()

Let's use the generic clock shifting logic here.

7 years agotime-util: add new call usec_shift_clock() for converting times between clocks
Lennart Poettering [Thu, 22 Jun 2017 18:52:23 +0000 (20:52 +0200)]
time-util: add new call usec_shift_clock() for converting times between clocks

We use that quite often, let's implement one clean version of it.

7 years agotime-util: rename usec_sub() to usec_sub_signed() and add usec_sub_unsigned()
Lennart Poettering [Thu, 22 Jun 2017 18:49:12 +0000 (20:49 +0200)]
time-util: rename usec_sub() to usec_sub_signed() and add usec_sub_unsigned()

Quite often we just want to subtract two normal usec_t values, hence
provide an implementation for that.

7 years agomkosi: order package list alphabetically again
Lennart Poettering [Thu, 22 Jun 2017 18:48:18 +0000 (20:48 +0200)]
mkosi: order package list alphabetically again