Commit graph

30406 commits

Author SHA1 Message Date
Lennart Poettering 1c8ac41c65 update TODO 2017-10-26 18:01:28 +02:00
Lennart Poettering 9672b58398 test: add simple test for validating some of the unit specifiers we support
(Also, sort list of test unit files in meson.build alphabetically, to
make future additions more systematic)
2017-10-26 18:01:04 +02:00
Lennart Poettering 14068e17f3 core: add support for expanding state/cache/log directory root in unit files
This augments %t which already resolves to the runtime directory root, and
should be useful for units that want to pass any of these paths in
command line arguments.

Example:

ExecStart=/usr/bin/mydaemon --datadir=%S/mydaemon

Why not expose a specifier resolving directly to the configured
state/runtime/cache/log dir? Three reasons:

1. Specifiers should be independent of configuration of the unit itself,
   and StateDirectory= and friends are unit configuration.  See
   03fc9c723c and related work.

2. We permit multiple StateDirectory= values per unit, and it hence
   wouldn't be clear which one is passed.

3. We already have %t for the runtime directory root, and we should
   continue with the same scheme.
2017-10-26 17:59:09 +02:00
Razvan Cojocaru 530c1c3028 systemd-detect-virt: refine hypervisor detection (#7171)
Continue to try to get more details about the actual underlying
hypervisor with successive tests until none are available.
This fixes issue #7165.
2017-10-26 16:59:04 +02:00
Zbigniew Jędrzejewski-Szmek 8aeadf3052 Merge pull request #7184 from keszybz/resolved-loop
resolved: fix loop on packets with pseudo dns types

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1725351,
CVE-2017-15908.
2017-10-26 15:29:03 +02:00
Lennart Poettering 35682fd4a1 Merge pull request #7127 from keszybz/sundry-tweaks
Various unrelated small patches
2017-10-26 10:57:00 +02:00
Lennart Poettering af163d70ae Merge pull request #7142 from sourcejedi/systemd-shutdown
systemd-shutdown: avoid confusingly redundant messages
2017-10-26 10:56:44 +02:00
martingh 5e38eb931f Adding timer_event to wakeup as suggested by MHD_get_timeout (#7152) 2017-10-26 10:54:30 +02:00
Lars Kellogg-Stedman 5cfde7ad29 hwdb: Add ACCEL_MOUNT_MATRIX for ThinkPad Yoga 11e (#7174)
Accelerometer readings from the screen accelerometer on the Yoga 11e
need to be rotated 90 degrees around the Z axis.
2017-10-25 13:23:51 +02:00
Zbigniew Jędrzejewski-Szmek 9f939335a0 resolved: fix loop on packets with pseudo dns types
Reported by Karim Hossen & Thomas Imbert from Sogeti ESEC R&D.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1725351
2017-10-25 11:47:04 +02:00
Hans de Goede b141888b30 hwdb: Document expected MOUNT_MATRIX on devices with non upright display (#7177)
On some devices the display (LCD panel) is mounted non upright
in the device's casing, e.g. mounted upside-down or 90 degree rotated.

Document the expected ACCEL_MOUNT_MATRIX settings for such devices.
2017-10-25 09:47:27 +02:00
Lauri Tirkkonen 4f13e53428 nspawn: EROFS for chowning mount points is not fatal (#7122)
This fixes --read-only with --private-users. mkdir_userns_p may return
-EROFS if either mkdir or lchown fails; lchown failing is fine as the
mount point will just be overmounted, and if mkdir fails then the
following mount() will also fail (with ENOENT).
2017-10-24 19:40:50 +02:00
Alan Jenkins 116e6d9643 core: systemd-shutdown: avoid confusingly redundant messages
After previous output from systemd-shutdown indicated a bug, my attention
was drawn to redundant output lines.  Did they indicate an anomaly?

It turns out to be an expected, harmless result of the current code.  But
we don't have much justification to run such redundant operations.  Let's
remove the confusing redundant message.

We can stop trying to remount a directory read-only once its mount entry
has successfully been changed to "ro".  We can simply let the kernel keep
track of this for us.  I don't bother to try and avoid re-parsing the
mountinfo.  I appreciate snappy shutdowns, but this code is already
intricate and buggy enough (see issue 7131).

(Disclaimer: At least for the moment, you can't _rely_ on always seeing
suspicious output from systemd-shutdown.  By default, you can expect the
kernel to truncate the log output of systemd-shutdown.  Ick ick ick!
Because /dev/kmsg is rate-limited by default.  Normally it prints a message
"X lines supressed", but we tend to shut down before the timer expires
in this case).

Before:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel...
EXT4-fs (vda3): re-mounted. Opts: data=ordered
systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

After:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

I also tested with `systemctl reboot --force`, plus a loopback mount to
cause one of the umounts to fail initially.  In this case another 2 lines
of output are removed (out of a larger number of lines).
2017-10-24 15:54:30 +01:00
Dimitri John Ledkov e6b2d948f8 resolved: create private stub resolve file for /etc/resolv.conf integration (#7014)
This creates a second private resolve.conf file which lists the stub resolver
and the resolved acquired search domains.

This runtime file should be used as a symlink target for /etc/resolv.conf such
that non-nss based applications can resolve search domains.

Fixes: #7009
2017-10-24 15:28:41 +02:00
Lennart Poettering ceeb433c39 Merge pull request #7141 from yuwata/fix-7129
core: fix D-Bus API
2017-10-24 15:25:12 +02:00
Zbigniew Jędrzejewski-Szmek 0c2826c60c core: in --user mode, report READY=1 as soon as basic.target is reached (#7102)
When a user logs in, systemd-pam will wait for the user manager instance to
report readiness. We don't need to wait for all the jobs to finish, it
is enough if the basic startup is done and the user manager is responsive.

systemd --user will now send out a READY=1 notification when either of two
conditions becomes true:
- basic.target/start job is gone,
- the initial transaction is done.

Also fixes #2863.
2017-10-24 14:48:54 +02:00
Lennart Poettering e0237035a0 Merge pull request #7123 from keszybz/date-formatting
Fix for time stamp formatting in timedatectl
2017-10-24 12:24:09 +02:00
Yu Watanabe 3f856a2813 core: fix D-Bus API
This fixes bugs introduced by cffaed83e8.

Closes #7129.
2017-10-24 17:21:27 +09:00
myrkr 1898e5f9a3 nspawn: Fix calculation of capabilities for configuration file (#7087)
The current code shifting an integer 1 failed for capabilities like
CAP_MAC_ADMIN (numerical value 33). This caused issues when specifying
them in the nspawn configuration file. Using an uint64_t 1 instead.

The similar code for processing the --capability command line option
was already correctly working.
2017-10-24 09:56:40 +02:00
Zbigniew Jędrzejewski-Szmek fc5ffacdab man: update the description of interval limiting (#7128)
Fixes #7125.
2017-10-24 09:41:52 +02:00
Lennart Poettering b88d48c2ca Merge pull request #7148 from keszybz/dynamic-user-use-gid
Use gid for static dynamic users
2017-10-24 09:38:01 +02:00
Mantas Mikulėnas 195b943d4e NEWS: start adding 236 (#7159) 2017-10-23 22:56:01 +02:00
Lennart Poettering d3aa0a1c42 Merge pull request #6948 from pfl/radv_emit_dns
Add EmitDNS= and EmitDomains= network file configuration options
2017-10-23 18:39:07 +02:00
Zbigniew Jędrzejewski-Szmek c2983a7fdd core/dynamic-user: use gid from pwnam if a static user was found
Fixes #7133.

v2:
- update based on review
2017-10-23 16:09:20 +02:00
Peter Hutterer de13433b2f hwdb: invert the USB touchpad integration assumption (#7161)
The vast majority of touchpads are internal, so let's assume that any USB
touchpad is internal by default (exception: bluetooth) and manually mark the
ones that are external. That's a lot more future-proof than having to mark all
internal touchpads that use USB as internal - that number is only going to
increase.

Related to #7068
2017-10-23 10:20:16 +02:00
Michael Biebl 02fa054dc4 modprobe.d: fix directory of modprobe configuration file (#7149)
kmod upstream uses /lib/modprobe.d which means we need to use rootprefix
instead of prefix for installing the modprobe configuration file as
otherwise split-usr systems are broken.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879191
2017-10-21 08:32:50 +02:00
Zbigniew Jędrzejewski-Szmek 362d90b7f2 core/dynamic-user: use _cleanup_ in dynamic user locking
This makes the code a bit easier to read.
2017-10-20 13:39:07 +02:00
Patrik Flykt 6852c0f6b0 sd-radv: Allocate space also for DNSSL iov option (#7144)
The iov array needs to hold five entries in addition to the number
of prefixes.
2017-10-20 10:59:15 +02:00
Alan Jenkins 066b753dc5 core: systemd-shutdown: add missing check for umount_changed
The assumption was that nothing changes in the final attempt.  This
would be confusing if a filesystem with a process in uninterruptible
sleep suddenly became un-stuck for the final attempt, but we still give
up and don't try to e.g. unmount any parent mounts.

I don't know how possible that is.  But the code will be easier to read
without an assumption that it does not attempt to justify.
2017-10-19 15:00:57 +01:00
Zbigniew Jędrzejewski-Szmek dd202fa492 Merge pull request #7132 from splantefeve/fr-translation
Update French translation
2017-10-19 08:29:37 +02:00
Sylvain Plantefève 629be9c9d1 po: update french translation 2017-10-19 00:26:52 +02:00
Sylvain Plantefève b5ff403d14 catalog: update french translation 2017-10-19 00:26:27 +02:00
Zbigniew Jędrzejewski-Szmek 74a79c657e man: describe how machine-id should be initialized (#7051) 2017-10-19 00:47:34 +08:00
Zbigniew Jędrzejewski-Szmek 78344935fd rfkill: include the device name in error message 2017-10-18 17:39:54 +02:00
Zbigniew Jędrzejewski-Szmek 551072321e man: recommend using /var/lib/machines in systemd-nspawn(1)
Also update the instruction to latest Fedora version.
2017-10-18 17:14:05 +02:00
Zbigniew Jędrzejewski-Szmek c47f86e660 util-lib: simplify kexec_loaded() 2017-10-18 17:14:05 +02:00
Zbigniew Jędrzejewski-Szmek 545a30a9a9 logind: drop unnecessary braces 2017-10-18 17:14:05 +02:00
Zbigniew Jędrzejewski-Szmek 9476ddba60 meson: drop unneeded check for grep 2017-10-18 17:14:05 +02:00
Zbigniew Jędrzejewski-Szmek 14ce0c25c2 timedatectl: stop using xstrftime
When using strftime in arbitrary locales, we cannot really say how big the
buffer should be. Let's make the buffer "large", which will work fine pretty
much always, and just print n/a if the timestamp does not fit. strftime returns
0 if the buffer is too small and a NUL-terminated string otherwise, so we
can drop the size specifications in string formatting.

$ export LANG=fa_IR.UTF-8
$ date
چهارشنبه ۱۸ اكتبر ۱۷، ساعت ۱۰:۵۴:۲۴ (+0330)
$ timedatectl
Assertion 'xstrftime: a[] must be big enough' failed at ../src/timedate/timedatectl.c:105, function print_status_info(). Aborting.

now:

$ timedatectl
        Local time: چهارشنبه 2017-10-18 16:29:40 CEST
    Universal time: چهارشنبه 2017-10-18 14:29:40 UTC
          RTC time: چهارشنبه 2017-10-18 14:29:40
…

https://bugzilla.redhat.com/show_bug.cgi?id=1503452
2017-10-18 16:30:37 +02:00
Lennart Poettering b5487fa0b6 Merge pull request #7078 from keszybz/cryptsetup-netdev-fixes
Cryptsetup _netdev fixes
2017-10-18 21:15:29 +08:00
Zbigniew Jędrzejewski-Szmek a0e030f53b units: make remote-cryptsetup.target also after cryptsetup-pre.target
This way people can order units before cryptsetup-pre.target and
have them run before any cryptsetup-related stuff.
2017-10-18 15:14:46 +02:00
Susant Sahani 28464ae0e2 networkd: don't stop the dhcp server if it's not configured. (#7083)
we call sd_dhcp_server_stop even if it's not configured when link is
down resulting unwanted logs.
```
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: Lost carrier
Oct 10 13:41:07 nena systemd-networkd[126]: DHCP CLIENT (0x560f2dc5): STOPPED
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: DHCP lease lost
Oct 10 13:41:07 nena systemd-networkd[126]: NDISC: Stopping IPv6 Router Solicitation client
Oct 10 13:41:07 nena systemd-networkd[126]: Assertion 'server' failed at ../src/libsystemd-network/sd-dhcp-server.c:256, function sd_dhcp_server_stop(). Ignoring.
```

fixes #7047
2017-10-18 12:38:56 +02:00
Zbigniew Jędrzejewski-Szmek b996f7e41a tests: rename test-time to test-time-util
It's for testing time-util.c so rename it to make things more
obvious.
2017-10-18 11:27:23 +02:00
Susant Sahani 702c979fef networkd: Consider linkLocalAddressing state while configuring ndisc. (#7012)
If linkLocalAddressing is disabled in for the interface still then
we look for ndisc configured or not in link_check_ready.

Link local is used automatic address configuration and neighbor discovery protocol.
If link local is disabled we should not configure ndisc.

Fixes #2713, #6441, #5841.
2017-10-18 11:12:59 +02:00
Lubomir Rintel 19a44dfe45 core: fragments of masked units ought not be considered for NeedDaemonReload (#7060)
The units that are not loaded don't have dropin_paths set. This
currently results in units that have fragments to always have
NeedDaemonReload=true when masked:

  $ find {/usr/lib,/run/user/8086}/systemd/user/meh.service* |xargs ls -ld
  lrwxrwxrwx. 1 lkundrak lkundrak    9 Oct 11 11:19 /run/user/8086/systemd/user/meh.service -> /dev/null
  -rw-rw-r--. 1 root     root       49 Oct 11 10:16 /usr/lib/systemd/user/meh.service
  drwxrwxr-x. 2 root     root     4096 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d
  -rw-rw-r--. 1 root     root      666 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d/override.conf
  $ systemctl --user daemon-reload
  $ busctl --user get-property org.freedesktop.systemd1 \
        /org/freedesktop/systemd1/unit/meh_2eservice \
        org.freedesktop.systemd1.Unit NeedDaemonReload
  b true
2017-10-18 08:38:50 +02:00
Zbigniew Jędrzejewski-Szmek 895265ad7d Merge pull request #7059 from yuwata/dynamic-user-7013
dynamic-user: permit the case static uid and gid are different
2017-10-18 08:37:12 +02:00
Yu Watanabe c85f1346c0 man: add explanation about target's DefaultDependencies= (#7120)
Closes #7113.
2017-10-18 08:30:35 +02:00
Yu Watanabe 3bd493dc93 man: comment a requirement about the static user or group when DynamicUser=yes 2017-10-18 15:30:00 +09:00
John Lin 4b4a972d2e man: mention /run in systemd.generator document (#7121) 2017-10-18 08:29:19 +02:00
Susant Sahani 6acbbdd4da networkd: Don't stop networkd if CONFIG_FIB_RULES=n in kernel (#7030)
If FIB Rules are not supported by the kernel then networkd fails to
start as it retuns error=-EOPNOTSUPP.
In this case just ignore and let start networkd.

```
sendto(5, {{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}, 28, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 16) = 28
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 48
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base={{len=48, type=NLMSG_ERROR, flags=0, seq=8, pid=8856}, {error=-EOPNOTSUPP, msg={{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}}}, iov_len=7416}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=0}, MSG_TRUNC) = 48
```

```
Oct 08 10:22:24 naomi systemd[1]: Starting Network Service...
Oct 08 10:22:24 naomi systemd-networkd[983]: Could not enumerate rules: Operation not supported
Oct 08 10:22:24 naomi systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
```

Fixes #7027
2017-10-18 08:25:57 +02:00