Migrate to systemd.

This commit is contained in:
Jon Ciesla 2012-02-15 14:30:06 -06:00
parent 32df002184
commit 5a3b9a2b5c
2 changed files with 56 additions and 12 deletions

View File

@ -1,13 +1,13 @@
Name: isns-utils Name: isns-utils
Version: 0.91 Version: 0.91
Release: 6%{?dist} Release: 7%{?dist}
Summary: The iSNS daemon and utility programs Summary: The iSNS daemon and utility programs
Group: System Environment/Daemons Group: System Environment/Daemons
License: LGPLv2+ License: LGPLv2+
URL: http://oss.oracle.com/~okir/open-isns/ URL: http://oss.oracle.com/~okir/open-isns/
Source0: http://oss.oracle.com/~okir/open-isns/open-isns-%{version}.tar.bz2 Source0: http://oss.oracle.com/~okir/open-isns/open-isns-%{version}.tar.bz2
Source1: isnsd.init Source1: isnsd.service
Patch0: isns-utils-turn-default-dd-on-to-match-msft.patch Patch0: isns-utils-turn-default-dd-on-to-match-msft.patch
Patch1: isns-utils-update-isnsadm-man.patch Patch1: isns-utils-update-isnsadm-man.patch
Patch2: isns-utils-fix-non-utf8-chars-in-copying.patch Patch2: isns-utils-fix-non-utf8-chars-in-copying.patch
@ -16,7 +16,11 @@ Patch3: isns-utils-include-limits.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: openssl-devel automake pkgconfig BuildRequires: openssl-devel automake pkgconfig
Requires: /sbin/chkconfig /sbin/service #Requires: /sbin/chkconfig /sbin/service
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%description %description
The iSNS package contains the daemon and tools to setup a iSNS server, The iSNS package contains the daemon and tools to setup a iSNS server,
@ -50,7 +54,7 @@ autoheader
%{__install} -d %{buildroot}%{_sbindir} %{__install} -d %{buildroot}%{_sbindir}
%{__install} -d %{buildroot}%{_mandir}/man8 %{__install} -d %{buildroot}%{_mandir}/man8
%{__install} -d %{buildroot}%{_mandir}/man5 %{__install} -d %{buildroot}%{_mandir}/man5
%{__install} -d %{buildroot}%{_initrddir} %{__install} -d %{buildroot}%{_unitdir}
%{__install} -d %{buildroot}%{_sysconfdir}/isns %{__install} -d %{buildroot}%{_sysconfdir}/isns
%{__install} -d %{buildroot}%{_var}/lib %{__install} -d %{buildroot}%{_var}/lib
%{__install} -d %{buildroot}%{_var}/lib/isns %{__install} -d %{buildroot}%{_var}/lib/isns
@ -60,25 +64,53 @@ autoheader
%{__install} -p -m 644 etc/isnsadm.conf %{buildroot}%{_sysconfdir}/isns/isnsadm.conf %{__install} -p -m 644 etc/isnsadm.conf %{buildroot}%{_sysconfdir}/isns/isnsadm.conf
%{__install} -p -m 755 isnsd isnsdd isnsadm isnssetup %{buildroot}%{_sbindir} %{__install} -p -m 755 isnsd isnsdd isnsadm isnssetup %{buildroot}%{_sbindir}
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/isnsd %{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service
%{__install} -p -m 644 doc/isns_config.5 %{buildroot}/%{_mandir}/man5/ %{__install} -p -m 644 doc/isns_config.5 %{buildroot}/%{_mandir}/man5/
%{__install} -p -m 644 doc/isnsd.8 doc/isnsdd.8 doc/isnsadm.8 %{buildroot}/%{_mandir}/man8/ %{__install} -p -m 644 doc/isnsd.8 doc/isnsdd.8 doc/isnsadm.8 %{buildroot}/%{_mandir}/man8/
%post %post
/sbin/chkconfig --add isnsd #/sbin/chkconfig --add isnsd
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%postun %postun
if [ "$1" = "1" ] ; then #if [ "$1" = "1" ] ; then
/sbin/service isnsd condrestart > /dev/null 2>&1 # /sbin/service isnsd condrestart > /dev/null 2>&1
#fi
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart isnsd.service >/dev/null 2>&1 || :
fi fi
%preun %preun
if [ "$1" = "0" ] ; then #if [ "$1" = "0" ] ; then
/sbin/chkconfig isnsd stop > /dev/null 2>&1 # /sbin/chkconfig isnsd stop > /dev/null 2>&1
/sbin/chkconfig --del isnsd # /sbin/chkconfig --del isnsd
#fi
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable isnsd.service > /dev/null 2>&1 || :
/bin/systemctl stop isnsd.service > /dev/null 2>&1 || :
fi fi
%triggerun -- isns-utils < 0.91-7
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply httpd
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save isnsd >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del isnsd >/dev/null 2>&1 || :
/bin/systemctl try-restart isnsd.service >/dev/null 2>&1 || :
%clean %clean
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
@ -91,12 +123,15 @@ fi
%{_sbindir}/isnssetup %{_sbindir}/isnssetup
%{_mandir}/man8/* %{_mandir}/man8/*
%{_mandir}/man5/* %{_mandir}/man5/*
%{_initrddir}/isnsd %{_unitdir}/isnsd.service
%dir %{_sysconfdir}/isns %dir %{_sysconfdir}/isns
%dir %{_var}/lib/isns %dir %{_var}/lib/isns
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/isns/* %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/isns/*
%changelog %changelog
* Wed Feb 15 2012 Jon Ciesla <limburgher@gmail.com> - 0.91-7
- Migrate to systemd, BZ 789707.
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-6 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.91-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

9
isnsd.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=ISNS Server
After=network.target
[Service]
ExecStart=/usr/sbin/isnsd -f
[Install]
WantedBy=multi-user.target