From 619387334f2768da8cb4e44cd1ad7e945b7f84260e4f2a2cd13ab337ba973788 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 23 Jun 2017 11:30:07 +0000 Subject: [PATCH] Accepting request 505715 from home:fbui:systemd:Factory - Don't try to restart networkd/resolved if they're disabled (boo#1045521) - Stop shipping /usr/lib/sysusers.d/basic.conf (bsc#1006978) OBS-URL: https://build.opensuse.org/request/show/505715 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=979 --- systemd-mini.changes | 27 ++++++++++++++++++++++++++- systemd-mini.spec | 25 +++++++++++++++---------- systemd.changes | 27 ++++++++++++++++++++++++++- systemd.spec | 25 +++++++++++++++---------- 4 files changed, 82 insertions(+), 22 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index ffafade9..09daca09 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Thu Jun 22 15:24:22 UTC 2017 - fbui@suse.com + +- Don't try to restart networkd/resolved if they're disabled (boo#1045521) + + "systemctl try-restart/preset" wants the unit files exist. + +------------------------------------------------------------------- +Thu Jun 22 13:50:46 UTC 2017 - fbui@suse.com + +- Stop shipping /usr/lib/sysusers.d/basic.conf (bsc#1006978) + + Ok looks like the previous change was the right thing to do and we + continue to follow this path by relying on the new user/group scheme + + Therefore the basic system user/group are now managed and created by + system-sysusers and udev also relies on this for the groups it uses + in its rule files. + + Ideally we should have listed all of the groups in the deps (with + "Requires: group(disk)" but the list of the groups is rather long + and the risk for those groups to be re-organized is probably low, so + currently we simply use "Requires: system-group-hardware" as a + shortcut. + ------------------------------------------------------------------- Fri Jun 16 09:14:43 UTC 2017 - fbui@suse.com @@ -11,7 +36,7 @@ Fri Jun 16 09:14:43 UTC 2017 - fbui@suse.com package isn't pulled in anymore when building the rescue system. For now make systemd creates the group by adding - "Requires: group(post)". + "Requires: group(lock)". I'm currently not sure why we don't use sysusers.d stuff for that purpose and if the "lock" group on /run/lock is still diff --git a/systemd-mini.spec b/systemd-mini.spec index a40555f2..a33d0889 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -225,9 +225,8 @@ Summary: A rule-based device node and kernel event manager License: GPL-2.0 Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +Requires: system-group-hardware Requires(pre): /usr/bin/stat -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/bin/getent Requires(post): sed Requires(post): /usr/bin/systemctl @@ -530,6 +529,10 @@ rm %{buildroot}%{_libexecdir}/systemd/libsystemd-shared.so # aaa_base (in procps for now) rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf +# The definition of the basic users/groups are defined by system-user +# on SUSE (bsc#1006978). +rm -f %{buildroot}%{_prefix}/lib/sysusers.d/basic.conf + # Remove README file in init.d as (SUSE) rpm requires executable files # in this directory... oh well. rm -f %{buildroot}/etc/init.d/README @@ -682,10 +685,14 @@ if [ $1 -eq 1 ]; then # unit. systemctl preset remote-fs.target || : systemctl preset getty@.service || : + systemctl preset systemd-timesyncd.service || : +%if %{with networkd} systemctl preset systemd-networkd.service || : systemctl preset systemd-networkd-wait-online.service || : - systemctl preset systemd-timesyncd.service || : +%endif +%if %{with resolved} systemctl preset systemd-resolved.service || : +%endif fi >/dev/null # since v207 /etc/sysctl.conf is no longer parsed, however @@ -745,9 +752,13 @@ fi %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163) %systemd_postun_with_restart systemd-journald.service -%systemd_postun_with_restart systemd-networkd.service %systemd_postun_with_restart systemd-timesyncd.service +%if %{with networkd} +%systemd_postun_with_restart systemd-networkd.service +%endif +%if %{with resolved} %systemd_postun_with_restart systemd-resolved.service +%endif %pretrans -n udev%{?mini} -p if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then @@ -773,12 +784,6 @@ if [ $1 -eq 1 ]; then echo "COMPAT_SYMLINK_GENERATION=2">/usr/lib/udev/compat-symlink-generation fi -# Create "tape"/"input" group which is referenced by some udev rules -# that we're shipping. FIXME: maybe we should consider using -# "sysusers_create basic.conf" instead ? -getent group tape >/dev/null || groupadd -r tape || : -getent group input >/dev/null || groupadd -r input || : - %post -n udev%{?mini} %udev_hwdb_update diff --git a/systemd.changes b/systemd.changes index ffafade9..09daca09 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Thu Jun 22 15:24:22 UTC 2017 - fbui@suse.com + +- Don't try to restart networkd/resolved if they're disabled (boo#1045521) + + "systemctl try-restart/preset" wants the unit files exist. + +------------------------------------------------------------------- +Thu Jun 22 13:50:46 UTC 2017 - fbui@suse.com + +- Stop shipping /usr/lib/sysusers.d/basic.conf (bsc#1006978) + + Ok looks like the previous change was the right thing to do and we + continue to follow this path by relying on the new user/group scheme + + Therefore the basic system user/group are now managed and created by + system-sysusers and udev also relies on this for the groups it uses + in its rule files. + + Ideally we should have listed all of the groups in the deps (with + "Requires: group(disk)" but the list of the groups is rather long + and the risk for those groups to be re-organized is probably low, so + currently we simply use "Requires: system-group-hardware" as a + shortcut. + ------------------------------------------------------------------- Fri Jun 16 09:14:43 UTC 2017 - fbui@suse.com @@ -11,7 +36,7 @@ Fri Jun 16 09:14:43 UTC 2017 - fbui@suse.com package isn't pulled in anymore when building the rescue system. For now make systemd creates the group by adding - "Requires: group(post)". + "Requires: group(lock)". I'm currently not sure why we don't use sysusers.d stuff for that purpose and if the "lock" group on /run/lock is still diff --git a/systemd.spec b/systemd.spec index 55318178..512bce3d 100644 --- a/systemd.spec +++ b/systemd.spec @@ -223,9 +223,8 @@ Summary: A rule-based device node and kernel event manager License: GPL-2.0 Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +Requires: system-group-hardware Requires(pre): /usr/bin/stat -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/bin/getent Requires(post): sed Requires(post): /usr/bin/systemctl @@ -528,6 +527,10 @@ rm %{buildroot}%{_libexecdir}/systemd/libsystemd-shared.so # aaa_base (in procps for now) rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf +# The definition of the basic users/groups are defined by system-user +# on SUSE (bsc#1006978). +rm -f %{buildroot}%{_prefix}/lib/sysusers.d/basic.conf + # Remove README file in init.d as (SUSE) rpm requires executable files # in this directory... oh well. rm -f %{buildroot}/etc/init.d/README @@ -680,10 +683,14 @@ if [ $1 -eq 1 ]; then # unit. systemctl preset remote-fs.target || : systemctl preset getty@.service || : + systemctl preset systemd-timesyncd.service || : +%if %{with networkd} systemctl preset systemd-networkd.service || : systemctl preset systemd-networkd-wait-online.service || : - systemctl preset systemd-timesyncd.service || : +%endif +%if %{with resolved} systemctl preset systemd-resolved.service || : +%endif fi >/dev/null # since v207 /etc/sysctl.conf is no longer parsed, however @@ -743,9 +750,13 @@ fi %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163) %systemd_postun_with_restart systemd-journald.service -%systemd_postun_with_restart systemd-networkd.service %systemd_postun_with_restart systemd-timesyncd.service +%if %{with networkd} +%systemd_postun_with_restart systemd-networkd.service +%endif +%if %{with resolved} %systemd_postun_with_restart systemd-resolved.service +%endif %pretrans -n udev%{?mini} -p if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then @@ -771,12 +782,6 @@ if [ $1 -eq 1 ]; then echo "COMPAT_SYMLINK_GENERATION=2">/usr/lib/udev/compat-symlink-generation fi -# Create "tape"/"input" group which is referenced by some udev rules -# that we're shipping. FIXME: maybe we should consider using -# "sysusers_create basic.conf" instead ? -getent group tape >/dev/null || groupadd -r tape || : -getent group input >/dev/null || groupadd -r input || : - %post -n udev%{?mini} %udev_hwdb_update