platform/upstream/systemd.git
7 years agoassemble multidevice btrfs volumes without external tools (#6607)
g0tar [Thu, 7 Sep 2017 07:58:12 +0000 (09:58 +0200)]
assemble multidevice btrfs volumes without external tools (#6607)

assemble multidevice btrfs volumes without external tools

This self-contained approach introduce very little overhead, unless
someone has a large number of devices composing many btrfs volumes,
in which case btrfs device scan would be faster. Still, having robust
implementation is a nice to have alternative for btrfs-progs.

7 years agohwdb: Add mice (#6641)
Charles Huber [Wed, 6 Sep 2017 15:00:57 +0000 (10:00 -0500)]
hwdb: Add mice (#6641)

* Dell MS111-T
* Dell MS116t
* Microsoft Comfort Mouse 4500

7 years agonetworkd: Allow configure a specific link even if it has no carrier. (#6740)
Susant Sahani [Wed, 6 Sep 2017 14:57:04 +0000 (14:57 +0000)]
networkd: Allow configure a specific link even if it has no carrier. (#6740)

This work allows to configure a specific link even if it has no carrier.

Closes #6645.

7 years agoUpdate version including Chuwi Hi13 (#6744)
pEJipE [Wed, 6 Sep 2017 08:18:20 +0000 (10:18 +0200)]
Update version including Chuwi Hi13 (#6744)

7 years agonetworkd: send dhcp timezone option when UseTimezone is true (#6725)
juga0 [Wed, 6 Sep 2017 08:10:50 +0000 (08:10 +0000)]
networkd: send dhcp timezone option when UseTimezone is true (#6725)

7 years agotest-dns-domain: allow old and new libidn2 behaviour (#6749)
Zbigniew Jędrzejewski-Szmek [Wed, 6 Sep 2017 07:39:14 +0000 (09:39 +0200)]
test-dns-domain: allow old and new libidn2 behaviour (#6749)

The behaviour changed to allow underscores. For now, lets just
accept both return values.

Fixes #6573.

7 years agotests: check the return value of personality when errno is not set (#6752)
Evgeny Vereshchagin [Wed, 6 Sep 2017 04:08:04 +0000 (07:08 +0300)]
tests: check the return value of personality when errno is not set (#6752)

The `personality` wrapper might not set errno, so in that case the return value
should be checked instead.

For details, see
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e0043e17dfc52fe1702746543127cb4a87232bcd.

Closes #6737.

7 years agoMerge pull request #6748 from msekletar/console-container-getty-pre-after
Lennart Poettering [Tue, 5 Sep 2017 17:45:39 +0000 (19:45 +0200)]
Merge pull request #6748 from msekletar/console-container-getty-pre-after

units: order container and console getty units after getty-pre.target

7 years agoMerge pull request #6747 from keszybz/cryptsetup-netdev
Lennart Poettering [Tue, 5 Sep 2017 17:45:18 +0000 (19:45 +0200)]
Merge pull request #6747 from keszybz/cryptsetup-netdev

netdev option for crypttab

7 years agosystemctl: make sure we properly turn off color at the end of each line of "list...
Lennart Poettering [Tue, 5 Sep 2017 14:31:26 +0000 (16:31 +0200)]
systemctl: make sure we properly turn off color at the end of each line of "list-unit-files" (#6688)

Let's simplify the code a bit, and make sure we always turn off color
and underlining again on each line, if we used it.

Fixes: #6684

7 years agounits: order container and console getty units after getty-pre.target
Michal Sekletar [Tue, 5 Sep 2017 12:53:25 +0000 (14:53 +0200)]
units: order container and console getty units after getty-pre.target

7 years agonetworkd: send dhcp option NTP when UseNTP is true (#6726)
juga0 [Tue, 5 Sep 2017 10:26:32 +0000 (10:26 +0000)]
networkd: send dhcp option NTP when UseNTP is true (#6726)

7 years agoMention mount.usr* in kernel-command-line man page (#6743)
Tobias Hunger [Tue, 5 Sep 2017 10:25:56 +0000 (12:25 +0200)]
Mention mount.usr* in kernel-command-line man page (#6743)

7 years agocryptsetup-generator: use remote-cryptsetup.target when _netdev is present
Zbigniew Jędrzejewski-Szmek [Tue, 5 Sep 2017 09:30:33 +0000 (11:30 +0200)]
cryptsetup-generator: use remote-cryptsetup.target when _netdev is present

This allows such devices to depend on the network. Their startup will
be delayed similarly to network mount units.

Fixes #4642.

7 years agounits: add remote-cryptsetup.target and remote-cryptsetup-pre.target
Zbigniew Jędrzejewski-Szmek [Tue, 5 Sep 2017 08:15:13 +0000 (10:15 +0200)]
units: add remote-cryptsetup.target and remote-cryptsetup-pre.target

The pair is similar to remote-fs.target and remote-fs-pre.target. Any
cryptsetup devices which require network shall be ordered after
remote-cryptsetup-pre.target and before remote-cryptsetup.target.

7 years agoman: add an explicit description of _netdev to systemd.mount(5)
Zbigniew Jędrzejewski-Szmek [Tue, 5 Sep 2017 09:20:14 +0000 (11:20 +0200)]
man: add an explicit description of _netdev to systemd.mount(5)

It was mentioned in passing, but having it in the list of options is also
nice.

7 years agoman: order fields alphabetically in crypttab(5)
Zbigniew Jędrzejewski-Szmek [Tue, 5 Sep 2017 08:25:45 +0000 (10:25 +0200)]
man: order fields alphabetically in crypttab(5)

They already were mostly ordered alphabetically, but some disorder
snuck in.

Also, fix formatting. Some options were described using "--" prefixes, which
looks like the text was just copied from crypttab(8).

7 years agounits: order cryptsetup-pre.target before cryptsetup.target
Zbigniew Jędrzejewski-Szmek [Tue, 5 Sep 2017 07:14:51 +0000 (09:14 +0200)]
units: order cryptsetup-pre.target before cryptsetup.target

Normally this happens automatically, but if it happened that both targets were
pulled in, even though there were no cryptsetup units, they could be started
in reverse order, which would be somewhat confusing. Add an explicit ordering
to avoid this potential issue.

7 years agoAdd Razer Blade Stealth 2016 to hwdb (#6730)
Thomas Miller [Tue, 5 Sep 2017 05:18:20 +0000 (22:18 -0700)]
Add Razer Blade Stealth 2016 to hwdb (#6730)

7 years agoMerge pull request #6741 from keszybz/template-loading-fix
Lennart Poettering [Mon, 4 Sep 2017 16:57:06 +0000 (18:57 +0200)]
Merge pull request #6741 from keszybz/template-loading-fix

Fix for mask/unmask operations on templates and multiple units

7 years agoMerge pull request #5815 from benzea/master
Lennart Poettering [Mon, 4 Sep 2017 16:52:14 +0000 (18:52 +0200)]
Merge pull request #5815 from benzea/master

rfkill: Delay writes until exit (#5768)

7 years agobuild-sys: make nonnull warning non-fatal (#6742)
Zbigniew Jędrzejewski-Szmek [Mon, 4 Sep 2017 16:49:12 +0000 (19:49 +0300)]
build-sys: make nonnull warning non-fatal (#6742)

Seems to be some kind of confusion in gcc. Insteading of playing whack-a-mole and
adding work-arounds in code, let's adjust the compilation options instead.

Fixes #6119, replaces #6657.

7 years agoMerge pull request #6580 from poettering/nspawn-dm-deviceallow
Zbigniew Jędrzejewski-Szmek [Mon, 4 Sep 2017 14:12:17 +0000 (17:12 +0300)]
Merge pull request #6580 from poettering/nspawn-dm-deviceallow

add DM devices to DeviceAllow for systemd-nspawn@.service

7 years agoAdd handling for bind/unbind actions (#6720)
Lennart Poettering [Mon, 4 Sep 2017 13:59:17 +0000 (15:59 +0200)]
Add handling for bind/unbind actions (#6720)

Newer kernels will emit uevents with "bind" and "unbind" actions. These
uevents will be issued when driver is bound to or unbound from a device.
"Bind" events are helpful when device requires a firmware to operate
properly, and driver is unable to create a child device before firmware
is properly loaded.

For some reason systemd validates actions and drops the ones it does not
know, instead of passing them on through as old udev did, so we need to
explicitly teach it about them.

7 years agoMerge pull request #6721 from yuwata/mount-vfs
Lennart Poettering [Mon, 4 Sep 2017 13:37:15 +0000 (15:37 +0200)]
Merge pull request #6721 from yuwata/mount-vfs

systemd-mount: allow to specify an arbitrary string for arg_mount_what when vfs is used

7 years ago6647 - use path_startswith("/dev") in cryptsetup (#6732)
ettavolt [Mon, 4 Sep 2017 13:36:52 +0000 (16:36 +0300)]
6647 - use path_startswith("/dev") in cryptsetup (#6732)

For both key and partition paths.

7 years agoMerge pull request #6735 from yuwata/multiple-capability-lines
Lennart Poettering [Mon, 4 Sep 2017 13:36:30 +0000 (15:36 +0200)]
Merge pull request #6735 from yuwata/multiple-capability-lines

core: update man and test to support multiple CapabilityBoundingSet= lines

7 years agocore: serialize n-restarts and flush-n-restarts correctly (#6736)
Evgeny Vereshchagin [Mon, 4 Sep 2017 13:36:01 +0000 (16:36 +0300)]
core: serialize n-restarts and flush-n-restarts correctly (#6736)

This makes n-restarts and flush-n-restarts survive `systemctl daemon-[reload|rexec]`.

7 years agoshared: add statx(2) to @file-system syscall filter list (#6738)
Lennart Poettering [Mon, 4 Sep 2017 13:35:35 +0000 (15:35 +0200)]
shared: add statx(2) to @file-system syscall filter list (#6738)

7 years agotmpfiles: silently ignore any path that passes through autofs (#6506)
NeilBrown [Mon, 4 Sep 2017 13:35:07 +0000 (23:35 +1000)]
tmpfiles: silently ignore any path that passes through autofs (#6506)

If a path passes though an autofs filesystem, then accessing
the path might trigger and automount.  As systemd-tmpfiles is run before
the network is up, and as automounts are often used for networked
filesystems, this can cause a deadlock.

So chase_symlinks is enhance to accept a new flag which tells it
to check for autofs, and return -EREMOTE if autofs is found.

tmpfiles is changed to check just before acting on a path so that it
can avoid autofs even if a symlink was created earlier by tmpfiles
that would send this path through an autofs.

This fixes a deadlock that happens when /home is listed in /etc/fstab as
x-systemd.automount for an NFS directory.

7 years agoman: fix typos (#6739)
Jakub Wilk [Mon, 4 Sep 2017 13:25:59 +0000 (15:25 +0200)]
man: fix typos (#6739)

7 years agotest: update test-unit-file
Yu Watanabe [Mon, 4 Sep 2017 07:25:22 +0000 (16:25 +0900)]
test: update test-unit-file

Follow-up for c792ec2e3512a672881fc847ff432e26b641c9c9.

7 years agoman: add examples for CapabilityBoundingSet=
Yu Watanabe [Mon, 4 Sep 2017 07:20:47 +0000 (16:20 +0900)]
man: add examples for CapabilityBoundingSet=

Follow-up for c792ec2e3512a672881fc847ff432e26b641c9c9.

7 years agocore: merge the second CapabilityBoundingSet= lines by AND when it is prefixed with...
iplayinsun [Mon, 4 Sep 2017 03:12:27 +0000 (12:12 +0900)]
core: merge the second CapabilityBoundingSet= lines by AND when it is prefixed with tilde (#6724)

If a unit file contains multiple CapabilityBoundingSet= or
AmbientCapabilities= lines, e.g.,
===
CapabilityBoundingSet=CAP_A CAP_B
CapabilityBoundingSet=~CAP_B CAP_C
===
before this commit, it results all capabilities except CAP_C are set to
CapabilityBoundingSet=, as each lines are always merged by OR.
This commit makes lines prefixed with ~ are merged by AND. So, for the
above example only CAP_A is set.
This makes easier to drop capabilities with drop-in config files.

7 years agosystemd-mount: allow to specify an arbitrary string for arg_mount_what when vfs is...
Yu Watanabe [Mon, 4 Sep 2017 01:55:51 +0000 (10:55 +0900)]
systemd-mount: allow to specify an arbitrary string for arg_mount_what when vfs is used

Fixes #6591.

7 years agoNEWS: fix typo in v235 (#6731)
Jörg Thalheim [Sun, 3 Sep 2017 18:12:12 +0000 (19:12 +0100)]
NEWS: fix typo in v235 (#6731)

7 years agosystemctl: fix masking of template units
Zbigniew Jędrzejewski-Szmek [Sun, 3 Sep 2017 14:45:54 +0000 (17:45 +0300)]
systemctl: fix masking of template units

systemctl would try to load the properties of the unit, which is impossible
for template names, and the whole operation would fail. It seems that this
regression was introduced in 00c83b430020914499bebf22be6b258f518ae291.

Export the part of unit_find_paths() responsible for locating instance unit
fragments and reuse it from unit_exists() to fix the handling of template
units.

Fixes #6412.

7 years agosystemctl: check existence of all units, not just the first one
Zbigniew Jędrzejewski-Szmek [Sat, 2 Sep 2017 14:37:08 +0000 (17:37 +0300)]
systemctl: check existence of all units, not just the first one

7 years agorfkill: Delay writes until exit (#5768)
Benjamin Berg [Thu, 31 Aug 2017 15:36:37 +0000 (17:36 +0200)]
rfkill: Delay writes until exit (#5768)

On thinkpads there are two rfkill devices for bluetooth. The first is an
ACPI switch which powers down the USB dongle and the second one is the
USB dongle itself. So when userspace decides to enable rfkill on all
devices systemd would randomly save the soft block state of the USB
dongle. This later causes issue when re-enabling the devie as
systemd-rfkill would put the USB dongle into soft block state right
after the ACPI rfkill switch is unblocked by userspace.

The simple way to avoid this is to not store rfkill changes for devices
that disappear shortly after. That way only the "main" ACPI switch will
get stored and systemd-rfkill will not end up blocking the device right
after it is being added back again.

7 years agosystemd-mount: fix that wrong argument is used for arg_mount_what
Yu Watanabe [Fri, 1 Sep 2017 08:03:01 +0000 (17:03 +0900)]
systemd-mount: fix that wrong argument is used for arg_mount_what

7 years agoman: LockPersonality= takes a boolean argument (#6718)
Yu Watanabe [Fri, 1 Sep 2017 07:38:41 +0000 (16:38 +0900)]
man: LockPersonality= takes a boolean argument (#6718)

Follow-up for 78e864e5b3cc11b72ae663f49f42f158cafbfedf.

7 years agoMerge pull request #6715 from sourcejedi/kbrequest-jobmode2
Lennart Poettering [Fri, 1 Sep 2017 07:38:04 +0000 (09:38 +0200)]
Merge pull request #6715 from sourcejedi/kbrequest-jobmode2

Fix #6484 "4 or 5 out of 7 targets triggered by SIGRTMIN+X use the wrong job mode"

7 years agoterminal: unify code for resetting kbd utf8 mode a bit (#6692)
Lennart Poettering [Fri, 1 Sep 2017 00:09:32 +0000 (02:09 +0200)]
terminal: unify code for resetting kbd utf8 mode a bit (#6692)

We have the same code at two places, let's unify that at one place.

Follow-up for #6606

7 years agoexecute: minor ExecOutput handling beautification (#6711)
Lennart Poettering [Fri, 1 Sep 2017 00:04:27 +0000 (02:04 +0200)]
execute: minor ExecOutput handling beautification (#6711)

Let's clean up the checking for the various ExecOutput values a bit,
let's use IN_SET everywhere, and the same concepts for all three bools
we pass to dprintf().

7 years agosystemctl: remove compiler warning (#6717)
Alan Jenkins [Fri, 1 Sep 2017 00:02:32 +0000 (01:02 +0100)]
systemctl: remove compiler warning (#6717)

913c1916 changed _ACTION_INVALID to negative, changing the enum to a
signed type.  Take care to avoid comparing it with an unsigned type.

../src/systemctl/systemctl.c: In function ‘start_unit’:
../src/systemctl/systemctl.c:3107:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 assert(arg_action < ELEMENTSOF(action_table));

7 years agoMerge pull request #6637 from sourcejedi/systemctl_cleanup
Lennart Poettering [Thu, 31 Aug 2017 16:51:25 +0000 (18:51 +0200)]
Merge pull request #6637 from sourcejedi/systemctl_cleanup

systemctl: improve readability of start_unit()

7 years agonetworkd: Allow tunnels to be created without .network (#6701)
Susant Sahani [Thu, 31 Aug 2017 16:51:03 +0000 (16:51 +0000)]
networkd: Allow tunnels to be created without .network (#6701)

Now we don't support tunnels to be created without a .network file
that is we need a interface index.

This work allows tunnel to be created without a ifindex.

Closes #6695

7 years agoMerge pull request #6708 from poettering/job-result-fixes
Lennart Poettering [Thu, 31 Aug 2017 16:50:11 +0000 (18:50 +0200)]
Merge pull request #6708 from poettering/job-result-fixes

minor fixes, in particular to job state display in systemctl

7 years agoupdate TODO
Lennart Poettering [Thu, 31 Aug 2017 16:30:16 +0000 (18:30 +0200)]
update TODO

7 years agorfkill: Lookup device in determine_state_file
Benjamin Berg [Thu, 31 Aug 2017 15:34:08 +0000 (17:34 +0200)]
rfkill: Lookup device in determine_state_file

None of the callers actually need the device itself. So it makes sense
to do the lookup inside determine_state_file instead.

7 years agomanager: fix job mode when signalled to shutdown etc
Alan Jenkins [Mon, 31 Jul 2017 16:36:58 +0000 (17:36 +0100)]
manager: fix job mode when signalled to shutdown etc

The irreversible job mode is required to ensure that shutdown is not
interrupted by the activation of a unit with a conflict.

We already used the correct job mode for `ctrl-alt-del.target`.  But not
for `exit.target` (SIGINT of user manager).  The SIGRT shutdown signals
also needed fixing.

Also change SIGRTMIN+0 to isolate default.target, instead of starting
it.  The previous behaviour was documented.  However there was no reason
given for it, nor can we provide one.  The problem that isolate is too
aggressive anywhere outside of emergency.target (#2607) is orthogonal.
This feature is "accessible by different means and only really a safety
net"; it is confusing for it to differ from `systemctl default` without
explanation.

`AllowIsolate=yes` is retained on poweroff.target etc. for backwards
compatibility.

`sigpwr.target` is also an obvious candidate for linking to a shutdown
target.  Unforunately it is also a possible hook for implementing some
logic like system V init did, reading `/etc/powerstatus`.  If we switched
to starting `sigpwr.target` with REPLACE_IRREVERSIBLY, attempts to run
`systemctl shutdown` from it would fail, if they had not thought to set
`DefaultDependencies=no`.  We had provided no examples for `sigpwr`, and
the whole idea is cruft to keep legacy people happy.  For the moment, I
leave `sigpwr` alone, with no risk of disrupting anyone's
previously-working, half-working, or untested setup.

Fixes #6484.  See also #6471

7 years agomanager: remove fallback for user/exit.target
Alan Jenkins [Wed, 2 Aug 2017 15:19:22 +0000 (16:19 +0100)]
manager: remove fallback for user/exit.target

The comment here was misleading: the job can fail to enqueue for reasons
other than the target not existing.

The fallback caused an error to be logged, and dates back to when the
"user" directory was named "session".  units/session/exit.target was added
later the same year.

This is consistent with the documentation (man systemd), and the handling
of similar signals.  It's also consistent with `systemctl exit`, which is
what most people would expect.

7 years agoman: dbus method Manager.Exit() does not start exit.target
Alan Jenkins [Mon, 31 Jul 2017 16:50:38 +0000 (17:50 +0100)]
man: dbus method Manager.Exit() does not start exit.target

It's like Manager.PowerOff(), which does not start poweroff.target.
Instead, the dbus methods are used for `systemctl --force exit`
or `systemctl --force poweroff`.  They shut down the system without
processing individual unit's ExecStop or TimeoutStopSec.

7 years agounits: do not install rescue.target for alt-↑
Alan Jenkins [Tue, 1 Aug 2017 10:40:51 +0000 (11:40 +0100)]
units: do not install rescue.target for alt-↑

rescue.target does not work well for this.  It is not meant to be started,
only isolated.

Fixes #6493

7 years agobus-unit-util: use STR_IN_SET() where appropriate
Lennart Poettering [Thu, 31 Aug 2017 08:25:48 +0000 (10:25 +0200)]
bus-unit-util: use STR_IN_SET() where appropriate

7 years agobus-unit-util: don't request result property from non-service units
Lennart Poettering [Thu, 31 Aug 2017 08:25:23 +0000 (10:25 +0200)]
bus-unit-util: don't request result property from non-service units

7 years agotree-wide: use pid_is_valid() at more places
Lennart Poettering [Thu, 31 Aug 2017 08:25:06 +0000 (10:25 +0200)]
tree-wide: use pid_is_valid() at more places

7 years agoLoad virtio_rng early in the game (#6710)
Harald Hoyer [Thu, 31 Aug 2017 13:33:33 +0000 (15:33 +0200)]
Load virtio_rng early in the game (#6710)

If true randomness is needed before udev is triggered, which would load
virtio_rng, reading /dev/random takes forever and the boot stalls for a
long time.

7 years agosystemctl: improve readability of start_unit()
Alan Jenkins [Fri, 18 Aug 2017 12:18:09 +0000 (13:18 +0100)]
systemctl: improve readability of start_unit()

start_unit() is a little tangled.  There's an easy part we can untangle,
then readers can concentrate on the more necessary complexity.

* Derive (method, action, mode) more clearly, as disjoint cases based on
  the command.  Don't rely on action_table[_ACTION_INVALID].target being
  implicitly initialized to NULL.

  verb_to_method() is now only used on one case, but not because I strongly
  object to the implicit "StartUnit" cases.  It's more a syntax problem.
  I think the old code takes me longer to understand, because the call
  comes just above a similar-looking call to verb_to_action(), but the
  results of the two functions are used in different ways.  It also helps
  that the new code ends up having a more regular form, for the 4 different
  cases.

  These changes cost 6 extra lines.

* Add an assertion to confirm that we do not pass mode=NULL.

7 years agoMerge pull request #6704 from andir/fix_vrf_table_identifier
Lennart Poettering [Thu, 31 Aug 2017 11:46:25 +0000 (13:46 +0200)]
Merge pull request #6704 from andir/fix_vrf_table_identifier

VRF documentation, parameter renames & parsing of RT names

7 years agoMerge pull request #6709 from yuwata/imply-requires-mounts
Lennart Poettering [Thu, 31 Aug 2017 11:30:26 +0000 (13:30 +0200)]
Merge pull request #6709 from yuwata/imply-requires-mounts

core: StateDirectory= and friends imply RequiresMountsFor=

7 years agoMerge pull request #6707 from yuwata/systemctl-show-caps
Lennart Poettering [Thu, 31 Aug 2017 10:46:03 +0000 (12:46 +0200)]
Merge pull request #6707 from yuwata/systemctl-show-caps

systemctl: show capabilities in human readable format

7 years agotmpfiles: with "e" don't attempt to set permissions when file doesn't exist (#6682)
Michal Sekletar [Thu, 31 Aug 2017 10:45:25 +0000 (12:45 +0200)]
tmpfiles: with "e" don't attempt to set permissions when file doesn't exist (#6682)

tmpfiles.d option "e" when run through systemd-tmpfiles --create should
apply configured permissions (uid,gid) only to already existing
files. When file doesn't exist we bail out with error. Instead we should
silently ignore non-existing files.

$ useradd test
$ cat /etc/tmpfiles.d/foobar.conf
e /tmp/test - test test 1d
$ ls -l /tmp/test
ls: cannot access '/tmp/test': No such file or directory

Before:
$ systemd-tmpfiles --create /etc/tmpfiles.d/foobar.conf
Adjusting owner and mode for /tmp/test failed: No such file or directory
$ echo $?
1

After:
$ systemd-tmpfiles --create /etc/tmpfiles.d/foobar.conf
$ echo $?
0

7 years agosystemd-link: ethtool add support for more Wake up Lan setting (#6331)
Susant Sahani [Thu, 31 Aug 2017 10:44:43 +0000 (10:44 +0000)]
systemd-link: ethtool add support for more Wake up Lan setting (#6331)

This works supports to configure nicast, multicast, broadcast, arp and SecureOn.

7 years agoMerge pull request #6666 from sourcejedi/suspend-initiate-failure
Lennart Poettering [Thu, 31 Aug 2017 10:24:18 +0000 (12:24 +0200)]
Merge pull request #6666 from sourcejedi/suspend-initiate-failure

logind: add missing resume signal when we fail to initiate sleep (and shutdown)

7 years agonetworkd: Added deprecation warning to `VRF.TableId`
Andreas Rammhold [Thu, 31 Aug 2017 10:08:33 +0000 (12:08 +0200)]
networkd: Added deprecation warning to `VRF.TableId`

7 years agoman: fix path for storing random seed
Yu Watanabe [Thu, 31 Aug 2017 09:31:08 +0000 (18:31 +0900)]
man: fix path for storing random seed

7 years agoTODO: update
Yu Watanabe [Thu, 31 Aug 2017 09:37:22 +0000 (18:37 +0900)]
TODO: update

7 years agounit: use StateDirectory= instead of RequiresMountsFor=
Yu Watanabe [Thu, 31 Aug 2017 09:37:11 +0000 (18:37 +0900)]
unit: use StateDirectory= instead of RequiresMountsFor=

7 years agounit: drop redundant options
Yu Watanabe [Thu, 31 Aug 2017 09:29:41 +0000 (18:29 +0900)]
unit: drop redundant options

7 years agounits: introduce getty-pre.target (#6667)
Michal Sekletar [Thu, 31 Aug 2017 09:20:14 +0000 (11:20 +0200)]
units: introduce getty-pre.target (#6667)

This new target is a passive unit, hence it is supposed to be pulled in
to the transaction by the service that wants to block login on the
console (e.g. text version of initial-setup). Now both getty and
serial-getty are ordered after this target.

https://lists.freedesktop.org/archives/systemd-devel/2015-July/033754.html

7 years agocore: StateDirectory= and friends imply RequiresMountsFor=
Yu Watanabe [Thu, 31 Aug 2017 09:19:35 +0000 (18:19 +0900)]
core: StateDirectory= and friends imply RequiresMountsFor=

7 years agoMerge pull request #6431 from keszybz/hwdb-trivial-rows
Lennart Poettering [Thu, 31 Aug 2017 09:08:41 +0000 (11:08 +0200)]
Merge pull request #6431 from keszybz/hwdb-trivial-rows

hwdb: disallow acceleration matrices with trivial rows

7 years agonetworkd: dont crash when mtu changes (#6594)
Andrew Jeddeloh [Thu, 31 Aug 2017 08:58:39 +0000 (01:58 -0700)]
networkd: dont crash when mtu changes (#6594)

Prevent networkd from crashing when UseMTU is used. Many drivers will
bring the link down and then back up to configure a new MTU. Networkd
will also asynchonously send rtnl messages to configure the link and may
receive responses after the link has gone down and come back up (which
networkd will handle and set the lease and network to NULL.

This changes the behavior to instead return if this is the case instead
of crashing via assert.

7 years agosystemctl: clarify code - some actions never appear in arg_action (#6638)
Alan Jenkins [Thu, 31 Aug 2017 08:54:12 +0000 (09:54 +0100)]
systemctl: clarify code - some actions never appear in arg_action (#6638)

ACTION_EMERGENCY and ACTION_DEFAULT would be handled correctly by
start_with_fallback().  However there is no fallback available for
them, and they would never be set in `arg_action` in the first
place.  Remove the unused cases from the switch statement.

@poettering suggested this makes a good place to clarify the point,
explicitly listing all the `arg_action` values which would never be
set.

7 years agosd-bus: use -- when passing arguments to ssh (#6706)
Evgeny Vereshchagin [Thu, 31 Aug 2017 08:38:30 +0000 (11:38 +0300)]
sd-bus: use -- when passing arguments to ssh (#6706)

This prevents `systemctl` from runnning /bin/touch when the following
command is used:
```
systemctl -H '-oProxyCommand=/bin/touch i-shouldnt-be-here' show-environment
```

7 years agolog: reopen log for failed assertions (#6703)
Topi Miettinen [Thu, 31 Aug 2017 08:37:32 +0000 (08:37 +0000)]
log: reopen log for failed assertions (#6703)

Reopen log so that failed and aborting assertions can be written to log.

Closes: #6658

7 years agobus-util: remove unnecessary initializations
Yu Watanabe [Thu, 31 Aug 2017 08:02:33 +0000 (17:02 +0900)]
bus-util: remove unnecessary initializations

7 years agosystemctl: show capabilities in human readable format
Yu Watanabe [Thu, 31 Aug 2017 08:07:16 +0000 (17:07 +0900)]
systemctl: show capabilities in human readable format

Follow-up for 21771f338d268e06dc9a10b9b08b14ff8217d4be.

7 years agonetworkd: Updated documentation to refer to new `Table=` parameter
Andreas Rammhold [Wed, 30 Aug 2017 23:44:29 +0000 (01:44 +0200)]
networkd: Updated documentation to refer to new `Table=` parameter

7 years agonetworkd: Renamed `table_id` field to `table`
Andreas Rammhold [Wed, 30 Aug 2017 23:14:05 +0000 (01:14 +0200)]
networkd: Renamed `table_id` field to `table`

Other parts of the code do just use `table` as identifier for the actual
routing table id. This change should make it easier to read through the
code since the meaning or rather the name stays the same.

7 years agonetworkd: Add `VRF.Table` to support parsing of table names
Andreas Rammhold [Wed, 30 Aug 2017 23:11:16 +0000 (01:11 +0200)]
networkd: Add `VRF.Table` to support parsing of table names

Previously there was only `VRF.TableId` which only supported numeric
identifiers for routing table. With the additiona of
`config_parse_route_table` also names can be used as identifiers.

7 years agocryptsetup-generator: do not bind to the decrypted device unit (#6538)
Ivan Shapovalov [Wed, 30 Aug 2017 16:49:07 +0000 (19:49 +0300)]
cryptsetup-generator: do not bind to the decrypted device unit (#6538)

This breaks things when the decrypted device is not immediately
`SYSTEMD_READY=1` (e. g. when a multi-device btrfs system is placed on
multiple cryptsetup devices).

Fixes #6537.

7 years agoshutdown: don't remount,ro network filesystems. (#6588)
NeilBrown [Wed, 30 Aug 2017 16:48:25 +0000 (02:48 +1000)]
shutdown: don't remount,ro network filesystems. (#6588)

systemd-shutdown is run after the network is stopped,
so remounting a network filesystem read-only can hang.
A simple umount is the most useful thing that can
be done for a network filesystem once the network is down.

7 years agoman: fix note for `systemctl enable --global` (#6592)
Alan Jenkins [Wed, 30 Aug 2017 16:47:40 +0000 (17:47 +0100)]
man: fix note for `systemctl enable --global` (#6592)

The last sentence in the paragraph described the behaviour of `--global`.  But "the last case" we listed was "only this boot", which does not match...  This was the fifth case described, but there are only _four_ different option names.  Fix it.

7 years agounits: starting suspend.target should not fail when suspend is successful (#6678)
Alan Jenkins [Wed, 30 Aug 2017 16:20:23 +0000 (17:20 +0100)]
units: starting suspend.target should not fail when suspend is successful (#6678)

and the same for hibernate.target and hybrid-sleep.target.

Tested with both sucessful and unsuccessful suspends.  The result of the
start job was correct in both cases.  Closes #6419 (a regression in v233
and v234).

> suspend is unsual for a target, because it has to stop itself once it's
> started. Otherwise you couldn't start it again, so you could only suspend
> once! Currently that's implemented using BindsTo=systemd-sleep.service.
> Meaning it pulls in systemd-sleep.service to do the actual suspend, and
> then de-activates afterwards. But the behaviour of BindsTo was changed
> recently (not without some issues during development) - maybe this bug
> is caused by poettering/systemd@631b676 which I think was added in
> release v233.
>
> sleep.target (see man systemd.special) has the same need, but it
> implements it differently. It simply has StopWhenUnneeded=yes.

This commit switches suspend.target etc. to the approach used by
sleep.target.

7 years agosulogin-shell: remove ineffective job mode option from `systemctl isolate` (#6627)
Alan Jenkins [Wed, 30 Aug 2017 16:11:31 +0000 (17:11 +0100)]
sulogin-shell: remove ineffective job mode option from `systemctl isolate` (#6627)

`systemctl default` uses job mode `isolate` (see `action_table`).
The job mode option is ignored.

Note that exiting the emergency shell service by using e.g.
`systemctl isolate multi-user` or `systemctl start multi-user.target`
already kills `emergency.service`.  There's only a potential conflict
between your command and the command in systemd-sulogin-shell if you run
something like `systemctl start --no-block multi-user.target; exit`.
Which is nothing like what we told them to do :).

7 years agomeson: add . to include_directories (#6634)
Davide Cavalca [Wed, 30 Aug 2017 15:34:44 +0000 (08:34 -0700)]
meson: add . to include_directories (#6634)

7 years agoMerge pull request #6617 from sourcejedi/udev-unit-deps
Lennart Poettering [Wed, 30 Aug 2017 15:33:07 +0000 (17:33 +0200)]
Merge pull request #6617 from sourcejedi/udev-unit-deps

udev service dependency nitpicks

7 years agodevice: make sure to remove all device units sharing the same sysfs path (#6679)
Franck Bui [Wed, 30 Aug 2017 15:16:16 +0000 (17:16 +0200)]
device: make sure to remove all device units sharing the same sysfs path (#6679)

When a device is unplugged all device units sharing the same sysfs path
pointing to that device are supposed to be removed.

However it didn't work since while iterating the device unit list containing
all the relevant units, each unit was removed during each iteration of
LIST_FOREACH. However LIST_FOREACH doesn't support this use case and
LIST_FOREACH_SAFE must be use instead.

7 years agologind: VT_GETSTATE "cannot return state for more than 16 VTs" (#6625)
Alan Jenkins [Wed, 30 Aug 2017 15:06:12 +0000 (16:06 +0100)]
logind: VT_GETSTATE "cannot return state for more than 16 VTs" (#6625)

`vt_is_busy(16)` would always return FALSE.  So we could have started
autovt@16.service even when VT 16 was already being used for something.

7 years agomeson: use current_source_dir() to scope git invocations (#6635)
Davide Cavalca [Wed, 30 Aug 2017 15:04:53 +0000 (08:04 -0700)]
meson: use current_source_dir() to scope git invocations (#6635)

7 years agosd-bus: socket - only transmit auxillary FDs once (#6603)
Tom Gundersen [Wed, 30 Aug 2017 11:09:03 +0000 (13:09 +0200)]
sd-bus: socket - only transmit auxillary FDs once (#6603)

If a message is too large to fit into the output buffer, it will be
transmitted to the kernel in several chunks. However, the FDs must
only ever be transmitted once or they will bereceived by the remote
end repeatedly.

The D-Bus specification disallows several sets of FDs attached to
one message, however, the reference implementation of D-Bus will
not reject such a message, rather it will reassign the duplicate
FDs to subsequent FD-carrying messages.

This attaches the FD array only to the first byte of the message.

7 years agoREADME: note that installing valgrind-devel maybe useful to developers (#6502)
Michal Sekletar [Wed, 30 Aug 2017 11:07:43 +0000 (13:07 +0200)]
README: note that installing valgrind-devel maybe useful to developers (#6502)

Commit also mentions that when running under valgrind we actually don't
execve() systemd-shutdown. We have a comment about this in the code, but
being upfront about this change in behavior doesn't hurt.

7 years agoupdate TODO
Lennart Poettering [Wed, 30 Aug 2017 10:21:37 +0000 (12:21 +0200)]
update TODO

7 years agoMerge pull request #6659 from yuwata/econnrefused
Lennart Poettering [Wed, 30 Aug 2017 10:17:53 +0000 (12:17 +0200)]
Merge pull request #6659 from yuwata/econnrefused

networkd: do not fail manager_connect_bus() if dbus is not active yet

7 years agonetworkd: Honor configured DHCP ClientIdentifier on link_update (#6622)
Jon Ringle [Wed, 30 Aug 2017 09:38:00 +0000 (05:38 -0400)]
networkd: Honor configured DHCP ClientIdentifier on link_update (#6622)

We have an embedded board with a couple of ethernet ports. From the kernel
log, I can see that the ethernet drivers are obtaining their correct MAC
address, but for some reason, at first systemd-networkd doesn't see the
mac address for the ethernet port at the time that it looks at
dhcp_client_identifier configuration (it has 00:00:00:00:00:00 for mac).

Later on, systemd-networkd gets a link_update() call, and at this time, it
has the correct mac address for the ethernet port. However, in link_update()
the dhcp_client_identifier configuration is not being considered, and a call
to sd_dhcp_client_set_iaid_duid() is being done always

7 years agoMerge pull request #6691 from yuwata/man-journal-remote2
Lennart Poettering [Wed, 30 Aug 2017 09:31:37 +0000 (11:31 +0200)]
Merge pull request #6691 from yuwata/man-journal-remote2

journal-remote: small fixes

7 years agoupdate TODO
Lennart Poettering [Wed, 30 Aug 2017 08:50:01 +0000 (10:50 +0200)]
update TODO

7 years agoMerge pull request #6672 from yuwata/drop-priv
Lennart Poettering [Wed, 30 Aug 2017 08:45:24 +0000 (10:45 +0200)]
Merge pull request #6672 from yuwata/drop-priv

use !! prefix in networkd and timesyncd