summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am28
-rw-r--r--NEWS3
-rw-r--r--README2
-rw-r--r--configure.ac19
-rw-r--r--hwdb/60-evdev.hwdb9
-rw-r--r--man/logind.conf.xml9
-rw-r--r--man/pam_systemd.xml5
-rw-r--r--man/resolved.conf.xml15
-rw-r--r--man/systemctl.xml2
-rw-r--r--man/systemd-delta.xml2
-rw-r--r--man/systemd.network.xml2
-rw-r--r--man/systemd.service.xml2
-rw-r--r--man/systemd.special.xml88
-rw-r--r--po/sv.po113
-rw-r--r--rules/.gitignore1
-rw-r--r--rules/50-udev-default.rules.in (renamed from rules/50-udev-default.rules)2
-rw-r--r--rules/60-cdrom_id.rules2
-rw-r--r--src/basic/journal-importer.c3
-rw-r--r--src/basic/parse-util.c1
-rw-r--r--src/basic/rm-rf.c7
-rw-r--r--src/core/busname.c4
-rw-r--r--src/journal/journald-native.c2
-rw-r--r--src/libsystemd-network/sd-lldp.c1
-rw-r--r--src/machine/machinectl.c1
-rw-r--r--src/network/networkd-network.c2
-rw-r--r--src/resolve/resolved-gperf.gperf1
-rw-r--r--src/resolve/resolved-link.c17
-rw-r--r--src/resolve/resolved-llmnr.c194
-rw-r--r--src/resolve/resolved-manager.c8
-rw-r--r--src/resolve/resolved-mdns.c102
-rw-r--r--src/resolve/resolved.conf.in1
-rw-r--r--src/shared/base-filesystem.c2
-rw-r--r--src/shared/pager.c4
-rw-r--r--src/sulogin-shell/.gitignore1
-rwxr-xr-xsrc/sulogin-shell/systemd-sulogin-shell.in14
-rw-r--r--src/systemctl/systemctl.c1
-rw-r--r--src/systemd/sd-event.h2
-rw-r--r--src/sysv-generator/sysv-generator.c3
-rw-r--r--src/test/test-sizeof.c14
-rw-r--r--system-preset/90-systemd.preset1
-rw-r--r--sysusers.d/basic.conf.in1
-rw-r--r--units/emergency.service.in4
-rw-r--r--units/quotaon.service.in2
-rw-r--r--units/rescue.service.in4
-rw-r--r--units/serial-getty@.service.m46
-rw-r--r--units/systemd-journal-upload.service.in1
-rw-r--r--units/systemd-networkd.service.m4.in6
-rw-r--r--units/systemd-quotacheck.service.in2
48 files changed, 477 insertions, 239 deletions
diff --git a/Makefile.am b/Makefile.am
index bd313a5d15..1cc657acca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,7 @@ polkitrulesdir=$(datadir)/polkit-1/rules.d
polkitpkladir=$(localstatedir)/lib/polkit-1/localauthority/10-vendor.d
bashcompletiondir=@bashcompletiondir@
zshcompletiondir=@zshcompletiondir@
-rpmmacrosdir=$(prefix)/lib/rpm/macros.d
+rpmmacrosdir=@rpmmacrosdir@
sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
varlogdir=$(localstatedir)/log
@@ -178,6 +178,7 @@ CLEANFILES = $(BUILT_SOURCES) \
$(pkgconfiglib_DATA) \
$(nodist_bashcompletion_data) \
$(nodist_zshcompletion_data) \
+ $(nodist_rpmmacros_DATA) \
$(in_files:.in=) $(in_in_files:.in.in=) \
$(m4_files:.m4=)
@@ -442,6 +443,12 @@ userenvgenerator_PROGRAMS = \
30-systemd-environment-d-generator
endif
+rootlibexec_SCRIPTS = \
+ src/sulogin-shell/systemd-sulogin-shell
+
+EXTRA_DIST += \
+ src/sulogin-shell/systemd-sulogin-shell.in
+
dist_bashcompletion_data = \
shell-completion/bash/busctl \
shell-completion/bash/journalctl \
@@ -650,7 +657,7 @@ EXTRA_DIST += \
units/initrd-switch-root.service.in \
units/systemd-nspawn@.service.in \
units/systemd-update-done.service.in \
- units/tmp.mount.m4
+ units/tmp.mount.m4
if HAVE_SYSV_COMPAT
nodist_systemunit_DATA += \
@@ -1003,8 +1010,7 @@ libbasic_la_CFLAGS = \
libbasic_la_LIBADD = \
$(SELINUX_LIBS) \
$(CAP_LIBS) \
- -lrt \
- -lm
+ -lrt
# -----------------------------------------------------------------------------
noinst_LTLIBRARIES += \
@@ -1497,8 +1503,10 @@ polkitpolicy_in_in_files += \
pkgconfigdata_DATA += \
src/core/systemd.pc
+if ENABLE_RPM_MACROS
nodist_rpmmacros_DATA = \
src/core/macros.systemd
+endif
BUILT_SOURCES += \
src/core/triggers.systemd
@@ -2174,9 +2182,6 @@ test_selinux_LDADD = \
test_sizeof_SOURCES = \
src/test/test-sizeof.c
-test_sizeof_LDADD = \
- libsystemd-shared.la
-
BUILT_SOURCES += \
src/test/test-hashmap-ordered.c
@@ -3817,7 +3822,6 @@ dist_network_DATA = \
network/80-container-vz.network
dist_udevrules_DATA += \
- rules/50-udev-default.rules \
rules/60-block.rules \
rules/60-drm.rules \
rules/60-evdev.rules \
@@ -3835,6 +3839,7 @@ dist_udevrules_DATA += \
rules/80-net-setup-link.rules
nodist_udevrules_DATA += \
+ rules/50-udev-default.rules \
rules/99-systemd.rules
udevconfdir = $(sysconfdir)/udev
@@ -3845,6 +3850,7 @@ pkgconfigdata_DATA += \
src/udev/udev.pc
EXTRA_DIST += \
+ rules/50-udev-default.rules.in \
rules/99-systemd.rules.in \
src/udev/udev.pc.in
@@ -6293,6 +6299,7 @@ substitutions = \
'|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
'|systemuidmax=$(SYSTEM_UID_MAX)|' \
'|systemgidmax=$(SYSTEM_GID_MAX)|' \
+ '|DEV_KVM_MODE=$(DEV_KVM_MODE)|' \
'|TTY_GID=$(TTY_GID)|' \
'|systemsleepdir=$(systemsleepdir)|' \
'|systemshutdowndir=$(systemshutdowndir)|' \
@@ -6326,6 +6333,10 @@ src/core/%.systemd: src/core/%.systemd.in
src/%.policy.in: src/%.policy.in.in
$(SED_PROCESS)
+src/sulogin-shell/%: src/sulogin-shell/%.in
+ $(SED_PROCESS)
+ $(AM_V_GEN)chmod +x $@
+
shell-completion/%: shell-completion/%.in
$(SED_PROCESS)
@@ -6567,6 +6578,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
--with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
--with-pamlibdir=$$dc_install_base/$(pamlibdir) \
--with-pamconfdir=$$dc_install_base/$(pamconfdir) \
+ --with-rpmmacrosdir=$$dc_install_base/$(rpmmacrosdir) \
--with-rootprefix=$$dc_install_base \
--enable-compat-libs
diff --git a/NEWS b/NEWS
index 9687bb81a9..f177ca31e6 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ systemd System and Service Manager
CHANGES WITH 233:
+ * This version requires at least gperf 3.1 for building, 3.0 is not
+ sufficient.
+
* The "hybrid" control group mode has been modified to improve
compatibility with "legacy" cgroups-v1 setups. Specifically, the
"hybrid" setup of /sys/fs/cgroup is now pretty much identical to
diff --git a/README b/README
index 30b5f71876..260668c8db 100644
--- a/README
+++ b/README
@@ -165,7 +165,7 @@ REQUIREMENTS:
autoconf
libtool
intltool
- gperf
+ gperf >= 3.1
python (optional)
python-lxml (optional, but required to build the indices)
diff --git a/configure.ac b/configure.ac
index 91a2155871..cf37ca6493 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1206,6 +1206,16 @@ AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
AC_SUBST(SYSTEM_GID_MAX)
# ------------------------------------------------------------------------------
+
+AC_ARG_WITH(dev-kvm-mode,
+ AS_HELP_STRING([--with-dev-kvm-mode=MODE],
+ [/dev/kvm access mode, defaults to "0660"]),
+ [DEV_KVM_MODE="$withval"],
+ [DEV_KVM_MODE="0660"])
+
+AC_SUBST(DEV_KVM_MODE, [$DEV_KVM_MODE], [/dev/kvm access mode])
+
+# ------------------------------------------------------------------------------
have_localed=no
AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
if test "x$enable_localed" != "xno"; then
@@ -1577,6 +1587,12 @@ AC_ARG_WITH([pamconfdir],
AM_CONDITIONAL(ENABLE_PAM_CONFIG, [test "$with_pamconfdir" != "no"])
AX_NORMALIZE_PATH([with_pamconfdir])
+AC_ARG_WITH([rpmmacrosdir],
+ AS_HELP_STRING([--with-rpmmacrosdir=DIR], [directory to store macros for RPM]),
+ [], [with_rpmmacrosdir=\${prefix}/lib/rpm/macros.d])
+AM_CONDITIONAL(ENABLE_RPM_MACROS, [test "$with_rpmmacrosdir" != "no"])
+AX_NORMALIZE_PATH([with_rpmmacrosdir])
+
AC_ARG_ENABLE([split-usr],
AS_HELP_STRING([--enable-split-usr], [assume that /bin, /sbin aren't symlinks into /usr]),
[],
@@ -1647,6 +1663,7 @@ AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
AC_SUBST([pamlibdir], [$with_pamlibdir])
AC_SUBST([pamconfdir], [$with_pamconfdir])
+AC_SUBST([rpmmacrosdir], [$with_rpmmacrosdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
@@ -1746,6 +1763,7 @@ AC_MSG_RESULT([
build Python: ${PYTHON}
PAM modules dir: ${with_pamlibdir}
PAM configuration dir: ${with_pamconfdir}
+ RPM macros dir: ${with_rpmmacrosdir}
D-Bus policy dir: ${with_dbuspolicydir}
D-Bus session dir: ${with_dbussessionservicedir}
D-Bus system dir: ${with_dbussystemservicedir}
@@ -1759,6 +1777,7 @@ AC_MSG_RESULT([
TTY GID: ${TTY_GID}
maximum system UID: ${SYSTEM_UID_MAX}
maximum system GID: ${SYSTEM_GID_MAX}
+ /dev/kvm access mode: ${DEV_KVM_MODE}
certificate root: ${CERTIFICATEROOT}
support URL: ${SUPPORT_URL}
nobody user name: ${NOBODY_USER_NAME}
diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb
index fd9078393b..5b7d31ace1 100644
--- a/hwdb/60-evdev.hwdb
+++ b/hwdb/60-evdev.hwdb
@@ -346,3 +346,12 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn305V4A/
evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:*svnTOSHIBA:pnTECRAM11*
EVDEV_ABS_00=90:962:11
EVDEV_ABS_01=51:681:14
+
+#########################################
+# Waltop
+#########################################
+
+# WALTOP International Corp. Slim Tablet
+evdev:input:b0003v172Fp0031*
+ EVDEV_ABS_00=0:10000:400
+ EVDEV_ABS_01=0:6250:400
diff --git a/man/logind.conf.xml b/man/logind.conf.xml
index 994e0e1140..16f51af72c 100644
--- a/man/logind.conf.xml
+++ b/man/logind.conf.xml
@@ -244,8 +244,9 @@
<para>A different application may disable logind's handling of system power and
sleep keys and the lid switch by taking a low-level inhibitor lock
- ("handle-power-key", "handle-suspend-key", "handle-hibernate-key",
- "handle-lid-switch"). This is most commonly used by graphical desktop environments
+ (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
+ <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>).
+ This is most commonly used by graphical desktop environments
to take over suspend and hibernation handling, and to use their own configuration
mechanisms. If a low-level inhibitor lock is taken, logind will not take any
action when that key or switch is triggered and the <varname>Handle*=</varname>
@@ -261,7 +262,9 @@
<listitem><para>Controls whether actions that <command>systemd-logind</command>
takes when the power and sleep keys and the lid switch are triggered are subject
to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor
- locks ("handle-*-key"), are always honored, irrespective of this setting.</para>
+ locks (<literal>handle-power-key</literal>, <literal>handle-suspend-key</literal>,
+ <literal>handle-hibernate-key</literal>, <literal>handle-lid-switch</literal>),
+ are always honored, irrespective of this setting.</para>
<para>These settings take boolean arguments. If <literal>no</literal>, the
inhibitor locks taken by applications are respected. If <literal>yes</literal>,
diff --git a/man/pam_systemd.xml b/man/pam_systemd.xml
index 6e1aa0dd9a..cef5445c1c 100644
--- a/man/pam_systemd.xml
+++ b/man/pam_systemd.xml
@@ -88,7 +88,7 @@
and so will the user's slice unit.</para></listitem>
<listitem><para>If the last concurrent session of a user ends,
- the <varname>$XDG_RUNTIME_DIR</varname> directory and all its
+ the user runtime directory <filename>/run/user/$UID</filename> and all its
contents are removed, too.</para></listitem>
</orderedlist>
@@ -192,7 +192,8 @@
offers the greatest possible file system feature set the
operating system provides. For further details, see the <ulink
url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
- Base Directory Specification</ulink>.</para></listitem>
+ Base Directory Specification</ulink>. <varname>$XDG_RUNTIME_DIR</varname>
+ is not set if the current user is not the original user of the session.</para></listitem>
</varlistentry>
</variablelist>
diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
index 4fc1ef1b33..7babc5c5c4 100644
--- a/man/resolved.conf.xml
+++ b/man/resolved.conf.xml
@@ -127,6 +127,21 @@
</varlistentry>
<varlistentry>
+ <term><varname>MulticastDNS=</varname></term>
+ <listitem><para>Takes a boolean argument or
+ <literal>resolve</literal>. Controls Multicast DNS support (<ulink
+ url="https://tools.ietf.org/html/rfc6762">RFC 6762</ulink>) on
+ the local host. If true, enables full Multicast DNS responder and
+ resolver support. If false, disables both. If set to
+ <literal>resolve</literal>, only resolution support is enabled,
+ but responding is disabled. Note that
+ <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ also maintains per-link Multicast DNS settings. Multicast DNS will be
+ enabled on a link only if the per-link and the
+ global setting is on.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>DNSSEC=</varname></term>
<listitem><para>Takes a boolean argument or
<literal>allow-downgrade</literal>. If true all DNS lookups are
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 7e1864c4f1..d4afb36f85 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -907,7 +907,7 @@ Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago
<programlisting>$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
- Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
+ Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
Docs: man:bluetoothd(8)
Main PID: 930 (bluetoothd)
diff --git a/man/systemd-delta.xml b/man/systemd-delta.xml
index 6628213209..be241f6950 100644
--- a/man/systemd-delta.xml
+++ b/man/systemd-delta.xml
@@ -63,7 +63,7 @@
compare configuration files that override other configuration
files. Files in <filename>/etc</filename> have highest priority,
files in <filename>/run</filename> have the second highest
- priority, …, files in <filename>/lib</filename> have lowest
+ priority, …, files in <filename>/usr/lib</filename> have lowest
priority. Files in a directory with higher priority override files
with the same name in directories of lower priority. In addition,
certain configuration files can have <literal>.d</literal>
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index b807ebf29b..61bed263e5 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -1513,7 +1513,7 @@ VRF=vrf1
<title>MacVTap</title>
<para>This brings up a network interface <literal>macvtap-test</literal>
and attaches it to <literal>enp0s25</literal>.</para>
- <programlisting># /lib/systemd/network/25-macvtap.network
+ <programlisting># /usr/lib/systemd/network/25-macvtap.network
[Match]
Name=enp0s25
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 52eb2bb424..a452e3a672 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -184,7 +184,7 @@
process has to exit before systemd starts follow-up units.
<varname>RemainAfterExit=</varname> is particularly useful for
this type of service. This is the implied default if neither
- <varname>Type=</varname> or <varname>ExecStart=</varname> are
+ <varname>Type=</varname> nor <varname>ExecStart=</varname> are
specified.</para>
<para>Behavior of <option>dbus</option> is similar to
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
index fa3dc1c5d4..66c45e39a3 100644
--- a/man/systemd.special.xml
+++ b/man/systemd.special.xml
@@ -901,64 +901,58 @@
<refsect1>
<title>Special Passive User Units</title>
- <refsect2>
- <title>graphical-session.target</title>
-
- <para>This target is active whenever any graphical session is running. It
- is used to stop user services which only apply to a graphical (X,
- Wayland, etc.) session when the session is terminated. Such services
- should have <literal>PartOf=graphical-session.target</literal> in their
- <literal>[Unit]</literal> section. A target for a particular session
- (e. g. <filename>gnome-session.target</filename>) starts and stops
- <literal>graphical-session.target</literal> with
- <literal>BindsTo=graphical-session.target</literal>.</para>
-
- <para>Which services are started by a session target is determined by the
- <literal>Wants=</literal> and <literal>Requires=</literal> dependencies.
- For services that can be enabled independently, symlinks in
- <literal>.wants/</literal> and <literal>.requires/</literal> should be
- used, see
- <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
- Those symlinks should either be shipped in packages, or should be added
- dynamically after installation, for example using <literal>systemctl add-wants</literal>, see
- <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
- </para>
+ <variablelist>
+ <varlistentry>
+ <term><filename>graphical-session.target</filename></term>
+ <listitem>
+ <para>This target is active whenever any graphical session is running. It is used to stop user services which
+ only apply to a graphical (X, Wayland, etc.) session when the session is terminated. Such services should
+ have <literal>PartOf=graphical-session.target</literal> in their <literal>[Unit]</literal> section. A target
+ for a particular session (e. g. <filename>gnome-session.target</filename>) starts and stops
+ <literal>graphical-session.target</literal> with <literal>BindsTo=graphical-session.target</literal>.</para>
+
+ <para>Which services are started by a session target is determined by the <literal>Wants=</literal> and
+ <literal>Requires=</literal> dependencies. For services that can be enabled independently, symlinks in
+ <literal>.wants/</literal> and <literal>.requires/</literal> should be used, see
+ <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Those
+ symlinks should either be shipped in packages, or should be added dynamically after installation, for example
+ using <literal>systemctl add-wants</literal>, see
+ <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+ </para>
- <example>
- <title>Nautilus as part of a GNOME session</title>
+ <example>
+ <title>Nautilus as part of a GNOME session</title>
- <para><literal>gnome-session.target</literal> pulls in Nautilus as
- top-level service:</para>
+ <para><literal>gnome-session.target</literal> pulls in Nautilus as top-level service:</para>
- <programlisting>[Unit]
+ <programlisting>[Unit]
Description=User systemd services for GNOME graphical session
Wants=nautilus.service
-BindsTo=graphical-session.target
- </programlisting>
+BindsTo=graphical-session.target</programlisting>
- <para><literal>nautilus.service</literal> gets stopped when the session stops:</para>
+ <para><literal>nautilus.service</literal> gets stopped when the session stops:</para>
- <programlisting>[Unit]
+ <programlisting>[Unit]
Description=Render the desktop icons with Nautilus
PartOf=graphical-session.target
[Service]
-…
- </programlisting>
- </example>
- </refsect2>
-
- <refsect2>
- <title>graphical-session-pre.target</title>
-
- <para>This target contains services which set up the environment or
- global configuration of a graphical session, such as SSH/GPG agents
- (which need to export an environment variable into all desktop processes)
- or migration of obsolete d-conf keys after an OS upgrade (which needs to
- happen before starting any process that might use them). This target must
- be started before starting a graphical session
- like <filename>gnome-session.target</filename>.</para>
- </refsect2>
+…</programlisting>
+ </example>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>graphical-session-pre.target</filename></term>
+ <listitem>
+ <para>This target contains services which set up the environment or global configuration of a graphical
+ session, such as SSH/GPG agents (which need to export an environment variable into all desktop processes) or
+ migration of obsolete d-conf keys after an OS upgrade (which needs to happen before starting any process that
+ might use them). This target must be started before starting a graphical session like
+ <filename>gnome-session.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</refsect1>
diff --git a/po/sv.po b/po/sv.po
index 6ecf5479a4..1de9b4650d 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,24 +1,23 @@
# Swedish translation for systemd.
# Copyright © 2015 systemd's COPYRIGHT HOLDER
# This file is distributed under the same license as the systemd package.
-# Josef Andersson <josef.andersson@fripost.org>, 2015.
# Sebastian Rasmussen <sebras@gmail.com>, 2015.
# Andreas Henriksson <andreas@fatal.se>, 2016.
-#
+# Josef Andersson <l10nl18nsweja@gmail.com>, 2015, 2017.
msgid ""
msgstr ""
"Project-Id-Version: systemd master\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-22 16:37+0100\n"
-"PO-Revision-Date: 2016-09-29 11:58+0200\n"
-"Last-Translator: Andreas Henriksson <andreas@fatal.se>\n"
+"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
+"POT-Creation-Date: 2017-03-01 15:50+0000\n"
+"PO-Revision-Date: 2017-03-19 21:18+0100\n"
+"Last-Translator: Josef Andersson <l10nl18nsweja@gmail.com>\n"
"Language-Team: Swedish\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 2.91.7\n"
+"X-Generator: Poedit 1.8.9\n"
#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:1
msgid "Send passphrase back to system"
@@ -134,7 +133,8 @@ msgstr "Ange systeminställningar för tangentbord"
#: ../src/locale/org.freedesktop.locale1.policy.in.h:4
msgid "Authentication is required to set the system keyboard settings."
-msgstr "Autentisering krävs för att ställa in systeminställningar för tangentbord."
+msgstr ""
+"Autentisering krävs för att ställa in systeminställningar för tangentbord."
#: ../src/login/org.freedesktop.login1.policy.in.h:1
msgid "Allow applications to inhibit system shutdown"
@@ -237,45 +237,54 @@ msgstr ""
"av brytaren för datorhöljet."
#: ../src/login/org.freedesktop.login1.policy.in.h:19
+msgid "Allow non-logged-in user to run programs"
+msgstr "Tillåt ej inloggad användare att köra program"
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:20
+msgid "Explicit request is required to run programs as a non-logged-in user."
+msgstr ""
+"Uttrycklig begäran krävs för att köra program som en icke inloggad användare."
+
+#: ../src/login/org.freedesktop.login1.policy.in.h:21
msgid "Allow non-logged-in users to run programs"
msgstr "Tillåt ej inloggade användare att köra program"
-#: ../src/login/org.freedesktop.login1.policy.in.h:20
+#: ../src/login/org.freedesktop.login1.policy.in.h:22
msgid "Authentication is required to run programs as a non-logged-in user."
msgstr ""
"Autentisering krävs för att köra program som en icke inloggad användare."
-#: ../src/login/org.freedesktop.login1.policy.in.h:21
+#: ../src/login/org.freedesktop.login1.policy.in.h:23
msgid "Allow attaching devices to seats"
msgstr "Tillåt att binda enheter till platser"
-#: ../src/login/org.freedesktop.login1.policy.in.h:22
+#: ../src/login/org.freedesktop.login1.policy.in.h:24
msgid "Authentication is required for attaching a device to a seat."
msgstr "Autentisering krävs för att binda en enhet till en plats."
-#: ../src/login/org.freedesktop.login1.policy.in.h:23
+#: ../src/login/org.freedesktop.login1.policy.in.h:25
msgid "Flush device to seat attachments"
msgstr "Töm bindningar för enhet-till-plats"
-#: ../src/login/org.freedesktop.login1.policy.in.h:24
+#: ../src/login/org.freedesktop.login1.policy.in.h:26
msgid ""
"Authentication is required for resetting how devices are attached to seats."
msgstr ""
"Autentisering krävs för att återställa hur enheter är bundna till platser."
-#: ../src/login/org.freedesktop.login1.policy.in.h:25
+#: ../src/login/org.freedesktop.login1.policy.in.h:27
msgid "Power off the system"
msgstr "Stäng av systemet"
-#: ../src/login/org.freedesktop.login1.policy.in.h:26
+#: ../src/login/org.freedesktop.login1.policy.in.h:28
msgid "Authentication is required for powering off the system."
msgstr "Autentisering krävs för att stänga av systemet."
-#: ../src/login/org.freedesktop.login1.policy.in.h:27
+#: ../src/login/org.freedesktop.login1.policy.in.h:29
msgid "Power off the system while other users are logged in"
msgstr "Stäng av systemet medan andra användare är inloggade"
-#: ../src/login/org.freedesktop.login1.policy.in.h:28
+#: ../src/login/org.freedesktop.login1.policy.in.h:30
msgid ""
"Authentication is required for powering off the system while other users are "
"logged in."
@@ -283,11 +292,11 @@ msgstr ""
"Autentisering krävs för att stänga av systemet medan andra användare är "
"inloggade."
-#: ../src/login/org.freedesktop.login1.policy.in.h:29
+#: ../src/login/org.freedesktop.login1.policy.in.h:31
msgid "Power off the system while an application asked to inhibit it"
msgstr "Stäng av systemet även då ett program hindrar det"
-#: ../src/login/org.freedesktop.login1.policy.in.h:30
+#: ../src/login/org.freedesktop.login1.policy.in.h:32
msgid ""
"Authentication is required for powering off the system while an application "
"asked to inhibit it."
@@ -295,19 +304,19 @@ msgstr ""
"Autentisering krävs för att stänga av systemet även då ett program hindrar "
"det."
-#: ../src/login/org.freedesktop.login1.policy.in.h:31
+#: ../src/login/org.freedesktop.login1.policy.in.h:33
msgid "Reboot the system"
msgstr "Starta om systemet"
-#: ../src/login/org.freedesktop.login1.policy.in.h:32
+#: ../src/login/org.freedesktop.login1.policy.in.h:34
msgid "Authentication is required for rebooting the system."
msgstr "Autentisering krävs för att starta om systemet."
-#: ../src/login/org.freedesktop.login1.policy.in.h:33
+#: ../src/login/org.freedesktop.login1.policy.in.h:35
msgid "Reboot the system while other users are logged in"
msgstr "Starta om systemet medan andra användare är inloggade"
-#: ../src/login/org.freedesktop.login1.policy.in.h:34
+#: ../src/login/org.freedesktop.login1.policy.in.h:36
msgid ""
"Authentication is required for rebooting the system while other users are "
"logged in."
@@ -315,11 +324,11 @@ msgstr ""
"Autentisering krävs för att starta om systemet medan andra användare är "
"inloggade."
-#: ../src/login/org.freedesktop.login1.policy.in.h:35
+#: ../src/login/org.freedesktop.login1.policy.in.h:37
msgid "Reboot the system while an application asked to inhibit it"
msgstr "Starta om systemet även då ett program hindrar det"
-#: ../src/login/org.freedesktop.login1.policy.in.h:36
+#: ../src/login/org.freedesktop.login1.policy.in.h:38
msgid ""
"Authentication is required for rebooting the system while an application "
"asked to inhibit it."
@@ -327,19 +336,19 @@ msgstr ""
"Autentisering krävs för att starta om systemet även då ett program hindrar "
"det."
-#: ../src/login/org.freedesktop.login1.policy.in.h:37
+#: ../src/login/org.freedesktop.login1.policy.in.h:39
msgid "Suspend the system"
msgstr "Försätt system i vänteläge"
-#: ../src/login/org.freedesktop.login1.policy.in.h:38
+#: ../src/login/org.freedesktop.login1.policy.in.h:40
msgid "Authentication is required for suspending the system."
msgstr "Autentisering krävs för att försätta system i vänteläge."
-#: ../src/login/org.freedesktop.login1.policy.in.h:39
+#: ../src/login/org.freedesktop.login1.policy.in.h:41
msgid "Suspend the system while other users are logged in"
msgstr "Försätt systemet i vänteläge medan andra användare är inloggade"
-#: ../src/login/org.freedesktop.login1.policy.in.h:40
+#: ../src/login/org.freedesktop.login1.policy.in.h:42
msgid ""
"Authentication is required for suspending the system while other users are "
"logged in."
@@ -347,11 +356,11 @@ msgstr ""
"Autentisering krävs för att försätta systemet i vänteläge medan andra "
"användare är inloggade."
-#: ../src/login/org.freedesktop.login1.policy.in.h:41
+#: ../src/login/org.freedesktop.login1.policy.in.h:43
msgid "Suspend the system while an application asked to inhibit it"
msgstr "Försätt systemet i vänteläge även då ett program hindrar det"
-#: ../src/login/org.freedesktop.login1.policy.in.h:42
+#: ../src/login/org.freedesktop.login1.policy.in.h:44
msgid ""
"Authentication is required for suspending the system while an application "
"asked to inhibit it."
@@ -359,19 +368,19 @@ msgstr ""
"Autentisering krävs för att försätta ett program i vänteläge även då ett "
"program hindrar det."
-#: ../src/login/org.freedesktop.login1.policy.in.h:43
+#: ../src/login/org.freedesktop.login1.policy.in.h:45
msgid "Hibernate the system"
msgstr "Försätt systemet i viloläge"
-#: ../src/login/org.freedesktop.login1.policy.in.h:44
+#: ../src/login/org.freedesktop.login1.policy.in.h:46
msgid "Authentication is required for hibernating the system."
msgstr "Autentisering krävs för att försätta systemet i viloläge."
-#: ../src/login/org.freedesktop.login1.policy.in.h:45
+#: ../src/login/org.freedesktop.login1.policy.in.h:47
msgid "Hibernate the system while other users are logged in"
msgstr "Försätt systemet i viloläge medan andra användare är inloggade"
-#: ../src/login/org.freedesktop.login1.policy.in.h:46
+#: ../src/login/org.freedesktop.login1.policy.in.h:48
msgid ""
"Authentication is required for hibernating the system while other users are "
"logged in."
@@ -379,11 +388,11 @@ msgstr ""
"Autentisering krävs för att försätta systemet i viloläge medan andra "
"användare är inloggade."
-#: ../src/login/org.freedesktop.login1.policy.in.h:47
+#: ../src/login/org.freedesktop.login1.policy.in.h:49
msgid "Hibernate the system while an application asked to inhibit it"
msgstr "Försätt systemet i viloläge även då ett program hindrar det"
-#: ../src/login/org.freedesktop.login1.policy.in.h:48
+#: ../src/login/org.freedesktop.login1.policy.in.h:50
msgid ""
"Authentication is required for hibernating the system while an application "
"asked to inhibit it."
@@ -391,30 +400,30 @@ msgstr ""
"Autentisering krävs för att försätta ett program i viloläge även då ett "
"program hindrar det."
-#: ../src/login/org.freedesktop.login1.policy.in.h:49
+#: ../src/login/org.freedesktop.login1.policy.in.h:51
msgid "Manage active sessions, users and seats"
msgstr "Hantera aktiva sessioner, användare och platser"
-#: ../src/login/org.freedesktop.login1.policy.in.h:50
+#: ../src/login/org.freedesktop.login1.policy.in.h:52
msgid ""
"Authentication is required for managing active sessions, users and seats."
msgstr ""
"Autentisering krävs för att hantera aktiva sessioner, användare och platser."
-#: ../src/login/org.freedesktop.login1.policy.in.h:51
+#: ../src/login/org.freedesktop.login1.policy.in.h:53
msgid "Lock or unlock active sessions"
msgstr "Lås eller lås upp aktiva sessioner"
-#: ../src/login/org.freedesktop.login1.policy.in.h:52
+#: ../src/login/org.freedesktop.login1.policy.in.h:54
msgid "Authentication is required to lock or unlock active sessions."
msgstr "Autentisering krävs för att låsa eller låsa upp aktiva sessioner."
-#: ../src/login/org.freedesktop.login1.policy.in.h:53
+#: ../src/login/org.freedesktop.login1.policy.in.h:55
msgid "Allow indication to the firmware to boot to setup interface"
msgstr ""
"Tillåt indikering till firmware att starta upp i inställningsgränssnitt"
-#: ../src/login/org.freedesktop.login1.policy.in.h:54
+#: ../src/login/org.freedesktop.login1.policy.in.h:56
msgid ""
"Authentication is required to indicate to the firmware to boot to setup "
"interface."
@@ -422,11 +431,11 @@ msgstr ""
"Autentisering krävs för att indikera till firmware att starta upp till "
"inställningsgränssnitt."
-#: ../src/login/org.freedesktop.login1.policy.in.h:55
+#: ../src/login/org.freedesktop.login1.policy.in.h:57
msgid "Set a wall message"
msgstr "Ange ett väggmeddelande"
-#: ../src/login/org.freedesktop.login1.policy.in.h:56
+#: ../src/login/org.freedesktop.login1.policy.in.h:58
msgid "Authentication is required to set a wall message"
msgstr "Autentisering krävs för att ställa in ett väggmeddelande"
@@ -547,33 +556,33 @@ msgstr ""
"Autentisering krävs för att kontrollera huruvida synkronisering av "
"nätverkstid ska vara aktiverat."
-#: ../src/core/dbus-unit.c:428
+#: ../src/core/dbus-unit.c:457
msgid "Authentication is required to start '$(unit)'."
msgstr "Autentisering krävs för att starta \"$(unit)\"."
-#: ../src/core/dbus-unit.c:429
+#: ../src/core/dbus-unit.c:458
msgid "Authentication is required to stop '$(unit)'."
msgstr "Autentisering krävs för att stoppa \"$(unit)\"."
-#: ../src/core/dbus-unit.c:430
+#: ../src/core/dbus-unit.c:459
msgid "Authentication is required to reload '$(unit)'."
msgstr "Autentisering krävs för att läsa om tillståndet för \"$(unit)\"."
-#: ../src/core/dbus-unit.c:431 ../src/core/dbus-unit.c:432
+#: ../src/core/dbus-unit.c:460 ../src/core/dbus-unit.c:461
msgid "Authentication is required to restart '$(unit)'."
msgstr "Autentisering krävs för att starta om \"$(unit)\"."
-#: ../src/core/dbus-unit.c:535
+#: ../src/core/dbus-unit.c:568
msgid "Authentication is required to kill '$(unit)'."
msgstr "Autentisering krävs för att döda \"$(unit)\"."
-#: ../src/core/dbus-unit.c:565
+#: ../src/core/dbus-unit.c:599
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
msgstr ""
"Autentisering krävs för att återställa det \"fallerade\" tillståndet för "
"\"$(unit)\"."
-#: ../src/core/dbus-unit.c:597
+#: ../src/core/dbus-unit.c:632
msgid "Authentication is required to set properties on '$(unit)'."
msgstr "Autentisering krävs för att ställa in egenskaper på \"$(unit)\"."
diff --git a/rules/.gitignore b/rules/.gitignore
index 93a50ddd80..ea6e216bad 100644
--- a/rules/.gitignore
+++ b/rules/.gitignore
@@ -1 +1,2 @@
+/50-udev-default.rules
/99-systemd.rules
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules.in
index 3347c8cd89..064f66a976 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules.in
@@ -74,6 +74,8 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
+KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@"
+
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"
LABEL="default_end"
diff --git a/rules/60-cdrom_id.rules b/rules/60-cdrom_id.rules
index f91d8cb456..288f8ce2f9 100644
--- a/rules/60-cdrom_id.rules
+++ b/rules/60-cdrom_id.rules
@@ -2,7 +2,7 @@
ACTION=="remove", GOTO="cdrom_end"
SUBSYSTEM!="block", GOTO="cdrom_end"
-KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
+KERNEL!="sr[0-9]*|vdisk*|xvd*", GOTO="cdrom_end"
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
# unconditionally tag device as CDROM
diff --git a/src/basic/journal-importer.c b/src/basic/journal-importer.c
index d25fd358e8..66119d2de1 100644
--- a/src/basic/journal-importer.c
+++ b/src/basic/journal-importer.c
@@ -24,6 +24,7 @@
#include "fd-util.h"
#include "parse-util.h"
#include "string-util.h"
+#include "unaligned.h"
enum {
IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */
@@ -203,7 +204,7 @@ static int get_data_size(JournalImporter *imp) {
if (r <= 0)
return r;
- imp->data_size = le64toh( *(uint64_t *) data );
+ imp->data_size = unaligned_read_le64(data);
if (imp->data_size > DATA_SIZE_MAX) {
log_error("Stream declares field with size %zu > DATA_SIZE_MAX = %u",
imp->data_size, DATA_SIZE_MAX);
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index 6e58ced6f5..d86700736d 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <xlocale.h>
#include "alloc-util.h"
#include "extract-word.h"
diff --git a/src/basic/rm-rf.c b/src/basic/rm-rf.c
index 08497af729..bdaca264ff 100644
--- a/src/basic/rm-rf.c
+++ b/src/basic/rm-rf.c
@@ -187,6 +187,13 @@ int rm_rf(const char *path, RemoveFlags flags) {
return -EPERM;
}
+ /* Another safe-check. Removing "/path/.." could easily remove entire root as well.
+ * It's especially easy to do using globs in tmpfiles, like "/path/.*", which the glob()
+ * function expands to both "/path/." and "/path/..".
+ * Return -EINVAL to be consistent with rmdir("/path/."). */
+ if (endswith(path, "/..") || endswith(path, "/../"))
+ return -EINVAL;
+
if ((flags & (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) == (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) {
/* Try to remove as subvolume first */
r = btrfs_subvol_remove(path, BTRFS_REMOVE_RECURSIVE|BTRFS_REMOVE_QUOTA);
diff --git a/src/core/busname.c b/src/core/busname.c
index 88b758eecb..955f6f88d8 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -764,7 +764,7 @@ static int busname_peek_message(BusName *n) {
struct kdbus_item *d;
struct kdbus_msg *k;
size_t start, ps, sz, delta;
- void *p = NULL;
+ void *p = MAP_FAILED;
pid_t pid = 0;
int r;
@@ -825,7 +825,7 @@ static int busname_peek_message(BusName *n) {
r = 0;
finish:
- if (p)
+ if (p != MAP_FAILED)
(void) munmap(p, sz);
cmd_free.offset = cmd_recv.msg.offset;
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 3c03b83754..c9bf3832c7 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -279,7 +279,7 @@ void server_process_native_message(
if (message) {
if (s->forward_to_syslog)
- server_forward_syslog(s, priority, identifier, message, ucred, tv);
+ server_forward_syslog(s, syslog_fixup_facility(priority), identifier, message, ucred, tv);
if (s->forward_to_kmsg)
server_forward_kmsg(s, priority, identifier, message, ucred);
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 0702241506..39ddb2461a 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -19,6 +19,7 @@
***/
#include <arpa/inet.h>
+#include <linux/sockios.h>
#include "sd-lldp.h"
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 28384286fb..3031ed5def 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -340,6 +340,7 @@ static int list_machines(int argc, char *argv[], void *userdata) {
printf("No machines.\n");
}
+ r = 0;
out:
clean_machine_info(machines, n_machines);
return r;
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index ab372568de..fac42d8478 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -428,7 +428,7 @@ int network_apply(Network *network, Link *link) {
if (network->ipv4ll_route) {
Route *route;
- r = route_new_static(network, "Network", 0, &route);
+ r = route_new_static(network, NULL, 0, &route);
if (r < 0)
return r;
diff --git a/src/resolve/resolved-gperf.gperf b/src/resolve/resolved-gperf.gperf
index 446f85cdf4..5153563b99 100644
--- a/src/resolve/resolved-gperf.gperf
+++ b/src/resolve/resolved-gperf.gperf
@@ -18,6 +18,7 @@ Resolve.DNS, config_parse_dns_servers, DNS_SERVER_SYSTEM,
Resolve.FallbackDNS, config_parse_dns_servers, DNS_SERVER_FALLBACK, 0
Resolve.Domains, config_parse_search_domains, 0, 0
Resolve.LLMNR, config_parse_resolve_support, 0, offsetof(Manager, llmnr_support)
+Resolve.MulticastDNS, config_parse_resolve_support, 0, offsetof(Manager, mdns_support)
Resolve.DNSSEC, config_parse_dnssec_mode, 0, offsetof(Manager, dnssec_mode)
Resolve.Cache, config_parse_bool, 0, offsetof(Manager, enable_cache)
Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0, offsetof(Manager, dns_stub_listener_mode)
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 3f7f9035cf..d06096f3f2 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -28,6 +28,8 @@
#include "mkdir.h"
#include "parse-util.h"
#include "resolved-link.h"
+#include "resolved-llmnr.h"
+#include "resolved-mdns.h"
#include "string-util.h"
#include "strv.h"
@@ -523,10 +525,25 @@ static void link_read_settings(Link *l) {
}
int link_update(Link *l) {
+ int r;
+
assert(l);
link_read_settings(l);
link_load_user(l);
+
+ if (l->llmnr_support != RESOLVE_SUPPORT_NO) {
+ r = manager_llmnr_start(l->manager);
+ if (r < 0)
+ return r;
+ }
+
+ if (l->mdns_support != RESOLVE_SUPPORT_NO) {
+ r = manager_mdns_start(l->manager);
+ if (r < 0)
+ return r;
+ }
+
link_allocate_scopes(l);
link_add_rrs(l, false);
diff --git a/src/resolve/resolved-llmnr.c b/src/resolve/resolved-llmnr.c
index 3516af58ee..29396e9973 100644
--- a/src/resolve/resolved-llmnr.c
+++ b/src/resolve/resolved-llmnr.c
@@ -77,7 +77,7 @@ int manager_llmnr_start(Manager *m) {
return 0;
eaddrinuse:
- log_warning("There appears to be another LLMNR responder running. Turning off LLMNR support.");
+ log_warning("Another LLMNR responder prohibits binding the socket to the same port. Turning off LLMNR support.");
m->llmnr_support = RESOLVE_SUPPORT_NO;
manager_llmnr_stop(m);
@@ -136,56 +136,75 @@ int manager_llmnr_ipv4_udp_fd(Manager *m) {
m->llmnr_ipv4_udp_fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->llmnr_ipv4_udp_fd < 0)
- return -errno;
+ return log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to create socket: %m");
/* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_TTL: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MULTICAST_TTL: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MULTICAST_LOOP: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_PKTINFO: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_RECVTTL: %m");
goto fail;
}
/* Disable Don't-Fragment bit in the IP header */
r = setsockopt(m->llmnr_ipv4_udp_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set IP_MTU_DISCOVER: %m");
goto fail;
}
+ /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
r = bind(m->llmnr_ipv4_udp_fd, &sa.sa, sizeof(sa.in));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("LLMNR-IPv4(UDP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->llmnr_ipv4_udp_fd, &sa.sa, sizeof(sa.in));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+ r = setsockopt(m->llmnr_ipv4_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(UDP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = sd_event_add_io(m->event, &m->llmnr_ipv4_udp_event_source, m->llmnr_ipv4_udp_fd, EPOLLIN, on_llmnr_packet, m);
@@ -216,55 +235,74 @@ int manager_llmnr_ipv6_udp_fd(Manager *m) {
m->llmnr_ipv6_udp_fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->llmnr_ipv6_udp_fd < 0)
- return -errno;
+ return log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to create socket: %m");
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_UNICAST_HOPS: %m");
goto fail;
}
/* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_MULTICAST_HOPS: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_MULTICAST_LOOP: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_V6ONLY: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_RECVPKTINFO: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_udp_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set IPV6_RECVHOPLIMIT: %m");
goto fail;
}
+ /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
r = bind(m->llmnr_ipv6_udp_fd, &sa.sa, sizeof(sa.in6));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("LLMNR-IPv6(UDP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->llmnr_ipv6_udp_fd, &sa.sa, sizeof(sa.in6));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+ r = setsockopt(m->llmnr_ipv6_udp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(UDP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = sd_event_add_io(m->event, &m->llmnr_ipv6_udp_event_source, m->llmnr_ipv6_udp_fd, EPOLLIN, on_llmnr_packet, m);
@@ -338,49 +376,68 @@ int manager_llmnr_ipv4_tcp_fd(Manager *m) {
m->llmnr_ipv4_tcp_fd = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->llmnr_ipv4_tcp_fd < 0)
- return -errno;
+ return log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to create socket: %m");
/* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_TTL, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_TTL: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_PKTINFO: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_RECVTTL: %m");
goto fail;
}
/* Disable Don't-Fragment bit in the IP header */
r = setsockopt(m->llmnr_ipv4_tcp_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set IP_MTU_DISCOVER: %m");
goto fail;
}
+ /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
r = bind(m->llmnr_ipv4_tcp_fd, &sa.sa, sizeof(sa.in));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("LLMNR-IPv4(TCP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->llmnr_ipv4_tcp_fd, &sa.sa, sizeof(sa.in));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+ r = setsockopt(m->llmnr_ipv4_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = listen(m->llmnr_ipv4_tcp_fd, SOMAXCONN);
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to listen the stream: %m");
goto fail;
}
@@ -412,48 +469,67 @@ int manager_llmnr_ipv6_tcp_fd(Manager *m) {
m->llmnr_ipv6_tcp_fd = socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->llmnr_ipv6_tcp_fd < 0)
- return -errno;
+ return log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to create socket: %m");
/* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_UNICAST_HOPS: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_V6ONLY: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_RECVPKTINFO: %m");
goto fail;
}
r = setsockopt(m->llmnr_ipv6_tcp_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set IPV6_RECVHOPLIMIT: %m");
goto fail;
}
+ /* first try to bind without SO_REUSEADDR to detect another LLMNR responder */
r = bind(m->llmnr_ipv6_tcp_fd, &sa.sa, sizeof(sa.in6));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("LLMNR-IPv6(TCP): There appears to be another LLMNR responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->llmnr_ipv6_tcp_fd, &sa.sa, sizeof(sa.in6));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple LLMNR responders */
+ r = setsockopt(m->llmnr_ipv6_tcp_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = listen(m->llmnr_ipv6_tcp_fd, SOMAXCONN);
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to listen the stream: %m");
goto fail;
}
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index c4e4409fe3..9db8b8f616 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -612,14 +612,6 @@ int manager_start(Manager *m) {
if (r < 0)
return r;
- r = manager_llmnr_start(m);
- if (r < 0)
- return r;
-
- r = manager_mdns_start(m);
- if (r < 0)
- return r;
-
return 0;
}
diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c
index c40e8f75f0..415dc1a532 100644
--- a/src/resolve/resolved-mdns.c
+++ b/src/resolve/resolved-mdns.c
@@ -60,7 +60,7 @@ int manager_mdns_start(Manager *m) {
return 0;
eaddrinuse:
- log_warning("There appears to be another mDNS responder running. Turning off mDNS support.");
+ log_warning("Another mDNS responder prohibits binding the socket to the same port. Turning off mDNS support.");
m->mdns_support = RESOLVE_SUPPORT_NO;
manager_mdns_stop(m);
@@ -217,55 +217,75 @@ int manager_mdns_ipv4_fd(Manager *m) {
m->mdns_ipv4_fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->mdns_ipv4_fd < 0)
- return -errno;
+ return log_error_errno(errno, "mDNS-IPv4: Failed to create socket: %m");
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_TTL: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MULTICAST_TTL: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MULTICAST_LOOP: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_PKTINFO: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_RECVTTL, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_RECVTTL: %m");
goto fail;
}
/* Disable Don't-Fragment bit in the IP header */
r = setsockopt(m->mdns_ipv4_fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set IP_MTU_DISCOVER: %m");
goto fail;
}
+ /* See the section 15.1 of RFC6762 */
+ /* first try to bind without SO_REUSEADDR to detect another mDNS responder */
r = bind(m->mdns_ipv4_fd, &sa.sa, sizeof(sa.in));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("mDNS-IPv4: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->mdns_ipv4_fd, &sa.sa, sizeof(sa.in));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple mDNS responders */
+ r = setsockopt(m->mdns_ipv4_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv4: Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = sd_event_add_io(m->event, &m->mdns_ipv4_event_source, m->mdns_ipv4_fd, EPOLLIN, on_mdns_packet, m);
@@ -294,55 +314,75 @@ int manager_mdns_ipv6_fd(Manager *m) {
m->mdns_ipv6_fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (m->mdns_ipv6_fd < 0)
- return -errno;
+ return log_error_errno(errno, "mDNS-IPv6: Failed to create socket: %m");
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_UNICAST_HOPS: %m");
goto fail;
}
/* RFC 4795, section 2.5 recommends setting the TTL of UDP packets to 255. */
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof(ttl));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_MULTICAST_HOPS: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_MULTICAST_LOOP: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one));
if (r < 0) {
- r = -errno;
- goto fail;
- }
-
- r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_V6ONLY: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_RECVPKTINFO: %m");
goto fail;
}
r = setsockopt(m->mdns_ipv6_fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one));
if (r < 0) {
- r = -errno;
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set IPV6_RECVHOPLIMIT: %m");
goto fail;
}
+ /* See the section 15.1 of RFC6762 */
+ /* first try to bind without SO_REUSEADDR to detect another mDNS responder */
r = bind(m->mdns_ipv6_fd, &sa.sa, sizeof(sa.in6));
if (r < 0) {
- r = -errno;
- goto fail;
+ if (errno != EADDRINUSE) {
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to bind socket: %m");
+ goto fail;
+ }
+
+ log_warning("mDNS-IPv6: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.");
+
+ /* try again with SO_REUSEADDR */
+ r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
+
+ r = bind(m->mdns_ipv6_fd, &sa.sa, sizeof(sa.in6));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to bind socket: %m");
+ goto fail;
+ }
+ } else {
+ /* enable SO_REUSEADDR for the case that the user really wants multiple mDNS responders */
+ r = setsockopt(m->mdns_ipv6_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+ if (r < 0) {
+ r = log_error_errno(errno, "mDNS-IPv6: Failed to set SO_REUSEADDR: %m");
+ goto fail;
+ }
}
r = sd_event_add_io(m->event, &m->mdns_ipv6_event_source, m->mdns_ipv6_fd, EPOLLIN, on_mdns_packet, m);
diff --git a/src/resolve/resolved.conf.in b/src/resolve/resolved.conf.in
index 60afa151e3..e6b20620e2 100644
--- a/src/resolve/resolved.conf.in
+++ b/src/resolve/resolved.conf.in
@@ -16,6 +16,7 @@
#FallbackDNS=@DNS_SERVERS@
#Domains=
#LLMNR=yes
+#MulticastDNS=yes
#DNSSEC=@DEFAULT_DNSSEC_MODE@
#Cache=yes
#DNSStubListener=udp
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 127cbe44e3..f2d8bcf6e3 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -117,6 +117,8 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
if (!table[i].ignore_failure)
return -errno;
+
+ continue;
}
if (uid != UID_INVALID || gid != UID_INVALID) {
diff --git a/src/shared/pager.c b/src/shared/pager.c
index f00ba9e1e7..c1480a718b 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -161,8 +161,8 @@ void pager_close(void) {
return;
/* Inform pager that we are done */
- stdout = safe_fclose(stdout);
- stderr = safe_fclose(stderr);
+ safe_fclose(stdout);
+ safe_fclose(stderr);
(void) kill(pager_pid, SIGCONT);
(void) wait_for_terminate(pager_pid, NULL);
diff --git a/src/sulogin-shell/.gitignore b/src/sulogin-shell/.gitignore
new file mode 100644
index 0000000000..01a315524b
--- /dev/null
+++ b/src/sulogin-shell/.gitignore
@@ -0,0 +1 @@
+systemd-sulogin-shell
diff --git a/src/sulogin-shell/systemd-sulogin-shell.in b/src/sulogin-shell/systemd-sulogin-shell.in
new file mode 100755
index 0000000000..d4f32af5f9
--- /dev/null
+++ b/src/sulogin-shell/systemd-sulogin-shell.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ -x /bin/plymouth ]; then
+ /bin/plymouth --wait quit
+fi
+
+cat <<EOF
+You are in $1 mode. After logging in, type "journalctl -xb" to view
+system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to
+boot into default mode.
+EOF
+
+@SULOGIN@
+@SYSTEMCTL@ --job-mode=fail --no-block default
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d78e56d777..cb9ca9ae1e 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1780,6 +1780,7 @@ static int list_dependencies_one(
STRV_FOREACH(c, deps) {
if (strv_contains(*units, *c)) {
if (!arg_plain) {
+ printf(" ");
r = list_dependencies_print("...", level + 1, (branches << 1) | (c[1] == NULL ? 0 : 1), 1);
if (r < 0)
return r;
diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h
index cc26b7df55..f8cb895660 100644
--- a/src/systemd/sd-event.h
+++ b/src/systemd/sd-event.h
@@ -69,7 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
+#if defined _GNU_SOURCE || _POSIX_C_SOURCE >= 199309L
typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
#else
typedef void* sd_event_child_handler_t;
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 9fde9b1884..9828078443 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -389,6 +389,9 @@ static int handle_provides(SysvStub *s, unsigned line, const char *full_text, co
r = strv_extend(&s->before, SPECIAL_NETWORK_TARGET);
if (r < 0)
return log_oom();
+ r = strv_extend(&s->wants, SPECIAL_NETWORK_TARGET);
+ if (r < 0)
+ return log_oom();
}
break;
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index 8f99a13772..36389b7710 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -17,7 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "log.h"
+#include <stdio.h>
+
#include "time-util.h"
/* Print information about various types. Useful when diagnosing
@@ -26,10 +27,10 @@
#pragma GCC diagnostic ignored "-Wtype-limits"
#define info(t) \
- log_info("%s → %zu bits%s", STRINGIFY(t), \
- sizeof(t)*CHAR_BIT, \
- strstr(STRINGIFY(t), "signed") ? "" : \
- ((t)-1 < (t)0 ? ", signed" : ", unsigned"));
+ printf("%s → %zu bits%s\n", STRINGIFY(t), \
+ sizeof(t)*CHAR_BIT, \
+ strstr(STRINGIFY(t), "signed") ? "" : \
+ ((t)-1 < (t)0 ? ", signed" : ", unsigned"));
int main(void) {
info(char);
@@ -39,6 +40,8 @@ int main(void) {
info(unsigned);
info(long unsigned);
info(long long unsigned);
+ info(__syscall_ulong_t);
+ info(__syscall_slong_t);
info(float);
info(double);
@@ -48,6 +51,7 @@ int main(void) {
info(ssize_t);
info(time_t);
info(usec_t);
+ info(__time_t);
return 0;
}
diff --git a/system-preset/90-systemd.preset b/system-preset/90-systemd.preset
index 6b5349dc8d..3ba4bb760d 100644
--- a/system-preset/90-systemd.preset
+++ b/system-preset/90-systemd.preset
@@ -15,7 +15,6 @@ enable getty@.service
enable systemd-timesyncd.service
enable systemd-networkd.service
enable systemd-resolved.service
-enable systemd-networkd-wait-online.service
disable console-getty.service
disable debug-shell.service
diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
index b2dc5ebd4f..7d6021e855 100644
--- a/sysusers.d/basic.conf.in
+++ b/sysusers.d/basic.conf.in
@@ -29,6 +29,7 @@ g dialout - - -
g disk - - -
g input - - -
g lp - - -
+g kvm - - -
g tape - - -
g video - - -
diff --git a/units/emergency.service.in b/units/emergency.service.in
index da68eb8faa..e9eb238b98 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -17,9 +17,7 @@ Before=shutdown.target
[Service]
Environment=HOME=/root
WorkingDirectory=-/root
-ExecStartPre=-/bin/plymouth --wait quit
-ExecStartPre=-/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+ExecStart=-@rootlibexecdir@/systemd-sulogin-shell emergency
Type=idle
StandardInput=tty-force
StandardOutput=inherit
diff --git a/units/quotaon.service.in b/units/quotaon.service.in
index 7d59a40195..f3e1e270c9 100644
--- a/units/quotaon.service.in
+++ b/units/quotaon.service.in
@@ -10,7 +10,7 @@ Description=Enable File System Quotas
Documentation=man:quotaon(8)
DefaultDependencies=no
After=systemd-quotacheck.service
-Before=local-fs.target shutdown.target
+Before=remote-fs.target shutdown.target
ConditionPathExists=@QUOTAON@
[Service]
diff --git a/units/rescue.service.in b/units/rescue.service.in
index 5feff69c89..4ab66f4856 100644
--- a/units/rescue.service.in
+++ b/units/rescue.service.in
@@ -16,9 +16,7 @@ Before=shutdown.target
[Service]
Environment=HOME=/root
WorkingDirectory=-/root
-ExecStartPre=-/bin/plymouth --wait quit
-ExecStartPre=-/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+ExecStart=-@rootlibexecdir@/systemd-sulogin-shell rescue
Type=idle
StandardInput=tty-force
StandardOutput=inherit
diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
index 4522d0d2be..609c5b62ee 100644
--- a/units/serial-getty@.service.m4
+++ b/units/serial-getty@.service.m4
@@ -21,6 +21,12 @@ After=rc-local.service
Before=getty.target
IgnoreOnIsolate=yes
+# IgnoreOnIsolate causes issues with sulogin, if someone isolates
+# rescue.target or starts rescue.service from multi-user.target or
+# graphical.target.
+Conflicts=rescue.service
+Before=rescue.service
+
[Service]
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
Type=idle
diff --git a/units/systemd-journal-upload.service.in b/units/systemd-journal-upload.service.in
index b9eab21542..d00b929211 100644
--- a/units/systemd-journal-upload.service.in
+++ b/units/systemd-journal-upload.service.in
@@ -28,6 +28,7 @@ RestrictRealtime=yes
RestrictNamespaces=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
SystemCallArchitectures=native
+ReadWritePaths=/var/lib/systemd/journal-upload
# If there are many split up journal files we need a lot of fds to
# access them all and combine
diff --git a/units/systemd-networkd.service.m4.in b/units/systemd-networkd.service.m4.in
index c3f153046a..5811b00819 100644
--- a/units/systemd-networkd.service.m4.in
+++ b/units/systemd-networkd.service.m4.in
@@ -42,3 +42,9 @@ ReadWritePaths=/run/systemd
[Install]
WantedBy=multi-user.target
Also=systemd-networkd.socket
+
+# We want to enable systemd-networkd-wait-online.service whenever this service
+# is enabled. systemd-networkd-wait-online.service has
+# WantedBy=network-online.target, so enabling it only has an effect if
+# network-online.target itself is enabled or pulled in by some other unit.
+Also=systemd-networkd-wait-online.service
diff --git a/units/systemd-quotacheck.service.in b/units/systemd-quotacheck.service.in
index 5cb9bc3bc9..6b1999aa51 100644
--- a/units/systemd-quotacheck.service.in
+++ b/units/systemd-quotacheck.service.in
@@ -10,7 +10,7 @@ Description=File System Quota Check
Documentation=man:systemd-quotacheck.service(8)
DefaultDependencies=no
After=systemd-remount-fs.service
-Before=local-fs.target shutdown.target
+Before=remote-fs.target shutdown.target
ConditionPathExists=@QUOTACHECK@
[Service]