From 7ec5700fd35407ddf441d05166f8547a4769bb3b252e6d1cec2b80ef75aaea3d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 30 Jun 2017 19:56:06 +0000 Subject: [PATCH] - Stop on errors from useradd/groupadd remove duplicate tmpfiles invocation OBS-URL: https://build.opensuse.org/package/show/network:dhcp/kea?expand=0&rev=4 --- kea.changes | 6 +++++- kea.spec | 11 +++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kea.changes b/kea.changes index 29983cc..4dbd82e 100644 --- a/kea.changes +++ b/kea.changes @@ -1,9 +1,13 @@ +------------------------------------------------------------------- +Fri Jun 30 19:55:50 UTC 2017 - jengelh@inai.de + +- Stop on errors from useradd/groupadd + ------------------------------------------------------------------- Thu Jun 30 10:02:50 UTC 2017 - obs@botter.cc - compile in support for MySQL and PostgresQL - add symlink to rckea -- create tmpfiles in %post - add environment variable for PID_FILE_DIR to service file ------------------------------------------------------------------- diff --git a/kea.spec b/kea.spec index dc17d9b..410f179 100644 --- a/kea.spec +++ b/kea.spec @@ -45,7 +45,7 @@ BuildRequires: pkgconfig(libcrypto) BuildRequires: systemd-rpm-macros %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build -Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd +Requires(pre): shadow %description Kea is a new DHCPv4/DHCPv6 server being developed by ISC in C++, a @@ -291,20 +291,19 @@ EOF perl -i -pe 's{/var/run}{/run};s{/var/log/kea-}{/var/log/kea/}' \ "$b/%_sysconfdir/kea"/*.conf mkdir -p "$b/var/log/kea" -ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} +ln -s "%_sbindir/service" "%buildroot/%_sbindir/rc%name" %fdupes %buildroot/%_prefix %pre -getent group keadhcp >/dev/null || groupadd -r keadhcp || : +getent group keadhcp >/dev/null || groupadd -r keadhcp getent passwd keadhcp >/dev/null || useradd -r -N -M -g keadhcp \ -s /sbin/nologin -d /var/lib/kea -c "Kea DHCP server" \ - keadhcp || : + keadhcp systemd-tmpfiles --create kea.conf || : %service_add_pre kea.service %post %service_add_post kea.service -%tmpfiles_create %{_tmpfilesdir}/kea.conf %preun %service_del_preun kea.service @@ -365,7 +364,7 @@ systemd-tmpfiles --create kea.conf || : %_unitdir/*.service %_prefix/lib/tmpfiles.d/ %attr(0775,keadhcp,keadhcp) %_localstatedir/log/kea/ -%ghost %dir %{_rundir}/%{name} +%ghost %dir %_rundir/%name %files -n libkea-asiodns0 %defattr(-,root,root)