From 28d36da64a7a23a55e8d0a139f2620384fd058b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 May 2018 13:01:55 +0200 Subject: [PATCH 1/3] rpm: remove confusing --user before --global Fixes #9027. --- src/core/macros.systemd.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index 89fc68ceb3d..660775f17a8 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -42,7 +42,7 @@ if [ $1 -eq 1 ] ; then \ fi \ %{nil} -%systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}} +%systemd_user_post() %{expand:%systemd_post \\--global %%{?*}} %systemd_preun() \ if [ $1 -eq 0 ] ; then \ @@ -54,7 +54,7 @@ fi \ %systemd_user_preun() \ if [ $1 -eq 0 ] ; then \ # Package removal, not upgrade \ - systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \ + systemctl --global disable %{?*} > /dev/null 2>&1 || : \ fi \ %{nil} From 030caa650118e7cbd79f93c2f04d2692d461fd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 May 2018 13:04:21 +0200 Subject: [PATCH 2/3] rpm: simplify redirects to /dev/null --- src/core/macros.systemd.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index 660775f17a8..3fbc952debf 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -38,7 +38,7 @@ OrderWithRequires(postun): systemd \ %systemd_post() \ if [ $1 -eq 1 ] ; then \ # Initial installation \ - systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \ + systemctl --no-reload preset %{?*} &>/dev/null || : \ fi \ %{nil} @@ -47,14 +47,14 @@ fi \ %systemd_preun() \ if [ $1 -eq 0 ] ; then \ # Package removal, not upgrade \ - systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \ + systemctl --no-reload disable --now %{?*} &>/dev/null || : \ fi \ %{nil} %systemd_user_preun() \ if [ $1 -eq 0 ] ; then \ # Package removal, not upgrade \ - systemctl --global disable %{?*} > /dev/null 2>&1 || : \ + systemctl --global disable %{?*} &>/dev/null || : \ fi \ %{nil} @@ -65,7 +65,7 @@ fi \ %systemd_postun_with_restart() \ if [ $1 -ge 1 ] ; then \ # Package upgrade, not uninstall \ - systemctl try-restart %{?*} >/dev/null 2>&1 || : \ + systemctl try-restart %{?*} &>/dev/null || : \ fi \ %{nil} @@ -79,16 +79,16 @@ fi \ # Deprecated. Use %tmpfiles_create_package instead %tmpfiles_create() \ -systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \ +systemd-tmpfiles --create %{?*} &>/dev/null || : \ %{nil} # Deprecated. Use %sysusers_create_package instead %sysusers_create() \ -systemd-sysusers %{?*} >/dev/null 2>&1 || : \ +systemd-sysusers %{?*} &>/dev/null || : \ %{nil} %sysusers_create_inline() \ -systemd-sysusers - </dev/null 2>&1 || : \ +systemd-sysusers - </dev/null || : \ %{?*} \ SYSTEMD_INLINE_EOF \ %{nil} @@ -107,7 +107,7 @@ SYSTEMD_INLINE_EOF \ # %files # %{_sysusersdir}/%{name}.conf %sysusers_create_package() \ -systemd-sysusers --replace=%_sysusersdir/%1.conf - </dev/null 2>&1 || : \ +systemd-sysusers --replace=%_sysusersdir/%1.conf - </dev/null || : \ %(cat %2) \ SYSTEMD_INLINE_EOF \ %{nil} @@ -126,15 +126,15 @@ SYSTEMD_INLINE_EOF \ # %files # %{_tmpfilesdir}/%{name}.conf %tmpfiles_create_package() \ -systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - </dev/null 2>&1 || : \ +systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - </dev/null || : \ %(cat %2) \ SYSTEMD_INLINE_EOF \ %{nil} %sysctl_apply() \ -@rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \ +@rootlibexecdir@/systemd-sysctl %{?*} &>/dev/null || : \ %{nil} %binfmt_apply() \ -@rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \ +@rootlibexecdir@/systemd-binfmt %{?*} &>/dev/null || : \ %{nil} From 424e80b4b73266d110c12702e15295c0deed5592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 May 2018 17:02:37 +0200 Subject: [PATCH 3/3] rpm: add macros for common configuration dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit %_environmnentdir /usr/lib/environment.d %_modulesloaddir /usr/lib/modules-load.d %_modprobedir /usr/lib/modprobe.d This makes installing files there more convenient because people don't need to construct the path from %_prefix/lib/… . See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GBF5WJLTQVSXMHGYGBF3723ZYCWFBR7C/. --- meson.build | 2 ++ src/core/macros.systemd.in | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 469737819d8..287032aff6a 100644 --- a/meson.build +++ b/meson.build @@ -241,12 +241,14 @@ substs.set('userpresetdir', userpresetdir) substs.set('udevhwdbdir', udevhwdbdir) substs.set('udevrulesdir', udevrulesdir) substs.set('udevlibexecdir', udevlibexecdir) +substs.set('environmentdir', environmentdir) substs.set('catalogdir', catalogdir) substs.set('tmpfilesdir', tmpfilesdir) substs.set('sysusersdir', sysusersdir) substs.set('sysctldir', sysctldir) substs.set('binfmtdir', binfmtdir) substs.set('modulesloaddir', modulesloaddir) +substs.set('modprobedir', modprobedir) substs.set('systemgeneratordir', systemgeneratordir) substs.set('usergeneratordir', usergeneratordir) substs.set('systemenvgeneratordir', systemenvgeneratordir) diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index 3fbc952debf..f3b74f42739 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -14,10 +14,13 @@ %_udevhwdbdir @udevhwdbdir@ %_udevrulesdir @udevrulesdir@ %_journalcatalogdir @catalogdir@ -%_tmpfilesdir @tmpfilesdir@ -%_sysusersdir @sysusersdir@ -%_sysctldir @sysctldir@ %_binfmtdir @binfmtdir@ +%_sysctldir @sysctldir@ +%_sysusersdir @sysusersdir@ +%_tmpfilesdir @tmpfilesdir@ +%_environmnentdir @environmentdir@ +%_modulesloaddir @modulesloaddir@ +%_modprobedir @modprobedir@ %_systemdgeneratordir @systemgeneratordir@ %_systemdusergeneratordir @usergeneratordir@ %_systemd_system_env_generator_dir @systemenvgeneratordir@