On 16.11.2012 09:48, Jakub Hrozek wrote:
On Tue, Nov 13, 2012 at 09:40:54AM +0100, Jan Cholasta wrote:
Honza agreed to take over this patch.
Updated patch attached.
Also created a new patch with fixes for errors reported by rpmlint.
Honza
--
Jan Cholasta
Patch 1 is mostly good builds on all releases we care about, there is just
one issue I'd like to discuss on the list:
+%triggerun -- sssd < 1.9.90
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply sssd
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save sssd >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+/bin/systemctl --no-reload enable sssd.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del sssd >/dev/null 2>&1 || :
+/bin/systemctl try-restart sssd.service >/dev/null 2>&1 || :
+%else
+# sysv
%post
/sbin/chkconfig --add %{servicename}
The above snippet conforms to the Fedora Packaging Guidelines. However,
the comparison "sssd < 1.9.90" would only match pre-1.90 packages, not
those that are already built from master, just before this change.
We discussed the approach a little with Honza and came up with a simple
solution - bump up the release number that is currently hardcoded and then
compare against "1.9.90.1". When we bump the version again during the 1.11
devel cycle, we could revert the release back to zero.
Any objections?
From 3ee5fbe2358e29e9f3c662d3953fca3f95cefa2c Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 12 Nov 2012 13:00:45 -0500
Subject: [PATCH 2/2] Fix errors reported by rpmlint
Ack. I tested that the keyutils-libs requires is picked up automatically
by RPM. The upgrade_config.py change is also fine as the file is
installed outside $PATH.
Updated patch attached.
Honza
--
Jan Cholasta
>From 1e5c7b5e9182150acd66e04a1a8a8bc4d196a90b Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 12 Nov 2012 13:00:11 -0500
Subject: [PATCH 1/2] Use systemd by default on Fedora 16+
https://fedorahosted.org/sssd/ticket/1437
---
contrib/sssd.spec.in | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 60 insertions(+), 2 deletions(-)
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 4f39647..45f6e1f 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -22,6 +22,16 @@
%global with_ccache --with-default-ccache-dir='/run/user/%U' --with-default-ccname-template="DIR:%d/krb5cc"
%endif
+%if (0%{?fedora} >= 16)
+ %global use_systemd 1
+%endif
+
+%if (0%{?use_systemd} == 1)
+ %global with_initscript --with-initscript=systemd --with-systemdunitdir=%{_unitdir}
+%else
+ %global with_initscript --with-initscript=sysv
+%endif
+
%global enable_experimental 1
%if (0%{?enable_experimental} == 1)
@@ -33,7 +43,7 @@
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
-Release: 0@PRERELEASE_VERSION@%{?dist}
+Release: 1@PRERELEASE_VERSION@%{?dist}
Group: Applications/System
Summary: System Security Services Daemon
License: GPLv3+
@@ -53,9 +63,15 @@ Requires: libipa_hbac = %{version}-%{release}
Requires: libsss_idmap = %{version}-%{release}
Requires: cyrus-sasl-gssapi
Requires: keyutils-libs
+%if (0%{?use_systemd} == 1)
+Requires(post): systemd-units systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
Requires(post): initscripts chkconfig
Requires(preun): initscripts chkconfig
Requires(postun): initscripts chkconfig
+%endif
%global servicename sssd
%global sssdstatedir %{_localstatedir}/lib/sss
@@ -250,6 +266,7 @@ autoreconf -ivf
--disable-static \
--disable-rpath \
%{with_ccache} \
+ %{with_initscript} \
%{experimental}
make %{?_smp_mflags} all
@@ -336,8 +353,12 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc COPYING
%doc src/examples/sssd-example.conf
-%{_initrddir}/%{name}
%{_sbindir}/sssd
+%if (0%{?use_systemd} == 1)
+%{_unitdir}/sssd.service
+%else
+%{_initrddir}/%{name}
+%endif
%dir %{_libexecdir}/%{servicename}
%{_libexecdir}/%{servicename}/krb5_child
@@ -506,6 +527,42 @@ A utility library to allow communication between Autofs and SSSD
%doc src/sss_client/COPYING src/sss_client/COPYING.LESSER
%{_libdir}/sssd/modules/libsss_autofs.so*
+%if (0%{?use_systemd} == 1)
+# systemd
+%post
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%preun
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable sssd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop sssd.service > /dev/null 2>&1 || :
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart sssd.service >/dev/null 2>&1 || :
+fi
+
+%triggerun -- sssd < 1.9.90-1
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply sssd
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save sssd >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+/bin/systemctl --no-reload enable sssd.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del sssd >/dev/null 2>&1 || :
+/bin/systemctl try-restart sssd.service >/dev/null 2>&1 || :
+%else
+# sysv
%post
/sbin/chkconfig --add %{servicename}
@@ -518,6 +575,7 @@ if [ $1 = 0 ]; then
/sbin/service %{servicename} stop 2>&1 > /dev/null
/sbin/chkconfig --del %{servicename}
fi
+%endif
%post client -p /sbin/ldconfig
--
1.7.11.4
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel