[389-admin/f16] Bug 695741 - Providing native systemd file

Richard Allen Megginson rmeggins at fedoraproject.org
Wed Sep 21 18:47:19 UTC 2011


commit 363621b40af3d54942ccfc2dbab8491eaed1a65f
Author: Rich Megginson <rmeggins at redhat.com>
Date:   Tue Sep 6 19:16:56 2011 -0600

    Bug 695741 - Providing native systemd file
    
    389-admin now provides native systemd service files, and controls
    389-ds-base with native systemd service files

 .gitignore             |    1 +
 389-admin-git-local.sh |    2 +-
 389-admin-git.sh       |    2 +-
 389-admin.spec         |   36 ++++++++++++++++++++----------------
 sources                |    2 +-
 5 files changed, 24 insertions(+), 19 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b3d3fd2..5ab3efb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@
 /389-admin-1.1.21.tar.bz2
 /389-admin-1.1.22.tar.bz2
 /389-admin-1.1.23.tar.bz2
+/389-admin-1.1.24.tar.bz2
diff --git a/389-admin-git-local.sh b/389-admin-git-local.sh
index d5bdce8..bfad85c 100755
--- a/389-admin-git-local.sh
+++ b/389-admin-git-local.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 DATE=`date +%Y%m%d`
-VERSION=1.1.23
+VERSION=1.1.24
 PKGNAME=389-admin
 TAG=${TAG:-$PKGNAME-$VERSION}
 SRCNAME=${PKGNAME}-${VERSION}
diff --git a/389-admin-git.sh b/389-admin-git.sh
index 82a549a..8e55ecc 100755
--- a/389-admin-git.sh
+++ b/389-admin-git.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 DATE=`date +%Y%m%d`
-VERSION=1.1.23
+VERSION=1.1.24
 PKGNAME=389-admin
 #SRCNAME=$PKGNAME-$VERSION-$DATE
 SRCNAME=$PKGNAME-$VERSION
diff --git a/389-admin.spec b/389-admin.spec
index b48a77d..6440709 100644
--- a/389-admin.spec
+++ b/389-admin.spec
@@ -4,9 +4,12 @@
 # also need the relprefix 0. field for a pre-release - also comment out for official release
 # % global relprefix 0.
 
+# systemd support
+%global groupname %{pkgname}.target
+
 Summary:          389 Administration Server (admin)
 Name:             389-admin
-Version:          1.1.23
+Version:          1.1.24
 Release:          %{?relprefix}1%{?prerel}%{?dist}
 License:          GPLv2 and ASL 2.0
 URL:              http://port389.org/
@@ -30,19 +33,14 @@ Requires:         mod_nss
 # this is needed for using semanage from our setup scripts
 Requires:         policycoreutils-python
 
-# this is needed to load and unload the policy module
-Requires(post):         policycoreutils
-Requires(preun):        policycoreutils
-Requires(postun):       policycoreutils
-
 # the following are needed for some of our scripts
 Requires:         perl-Mozilla-LDAP
 Requires:         nss-tools
 
-# for the init script
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
+# for systemd
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
 
 Source0:          http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz2
 # 389-admin-git.sh should be used to generate the source tarball from git
@@ -58,7 +56,9 @@ and CGI utilities used by the console.
 %setup -q -n %{name}-%{version}%{?prerel}
 
 %build
-%configure --disable-rpath --with-selinux --with-openldap --enable-service
+%configure --disable-rpath --with-selinux --with-openldap \
+           --with-systemdsystemunitdir=%{_unitdir} \
+           --with-systemddirsrvgroupname=%{groupname}
 
 # Generate symbolic info for debuggers
 export XCFLAGS=$RPM_OPT_FLAGS
@@ -97,7 +97,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %post -p <lua>
 -- do the usual daemon post setup stuff
-os.execute('/sbin/chkconfig --add %{pkgname}-admin')
+os.execute('/bin/systemctl enable %{pkgname}-admin.service >/dev/null 2>&1 || :')
 os.execute('/sbin/ldconfig')
 -- restore permissions if upgrading
 if %{pkgname}admin_adminserv then
@@ -110,9 +110,10 @@ if %{pkgname}admin_consoleconf then
 end
 
 %preun
-if [ $1 = 0 ]; then
-        /sbin/service %{pkgname}-admin stop >/dev/null 2>&1 || :
-        /sbin/chkconfig --del %{pkgname}-admin
+if [ $1 -eq 0 ]; then
+   # Package removal, not upgrade
+   /bin/systemctl stop %{pkgname}-admin.service > /dev/null 2>&1 || :
+   /bin/systemctl --no-reload disable %{pkgname}-admin.service >/dev/null 2>&1 || :
 fi
 
 %postun
@@ -124,14 +125,17 @@ fi
 %dir %{_sysconfdir}/%{pkgname}/admin-serv
 %config(noreplace)%{_sysconfdir}/%{pkgname}/admin-serv/*.conf
 %{_datadir}/%{pkgname}
-%{_sysconfdir}/rc.d/init.d/%{pkgname}-admin
 %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}-admin
+%{_unitdir}/%{pkgname}-admin.service
 %{_sbindir}/*
 %{_libdir}/*.so.*
 %{_libdir}/%{pkgname}
 %{_mandir}/man8/*
 
 %changelog
+* Wed Sep 21 2011 Rich Megginson <rmeggins at redhat.com> - 1.1.24-1
+- Bug 695741 - Providing native systemd file
+
 * Thu Aug 11 2011 Rich Megginson <rmeggins at redhat.com> - 1.1.23-1
 - Bug 730079 - Update SELinux policy during upgrades
 
diff --git a/sources b/sources
index 5e0e19f..b075bcf 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-34d7608a1b4b7c1b56d649a3dc407682  389-admin-1.1.23.tar.bz2
+78ea668dd79cedc07fe0e12887a9fd37  389-admin-1.1.24.tar.bz2


More information about the scm-commits mailing list