From 3e9eda5444a717e5ba20733d4600fddfcba75749 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Fri, 24 Feb 2012 10:38:04 +0800 Subject: [PATCH] * Fri Feb 24 2012 Ian Kent - 1:5.0.6-12 - fix some typos in systemd support fixes patch - fix same in spec file. --- autofs-5.0.6-systemd-support-fixes.patch | 43 ++++++++++++++---------- autofs.spec | 40 ++++++++++++++++------ 2 files changed, 55 insertions(+), 28 deletions(-) diff --git a/autofs-5.0.6-systemd-support-fixes.patch b/autofs-5.0.6-systemd-support-fixes.patch index e16f695..2d784ea 100644 --- a/autofs-5.0.6-systemd-support-fixes.patch +++ b/autofs-5.0.6-systemd-support-fixes.patch @@ -10,14 +10,16 @@ be done in a distro spec file. --- CHANGELOG | 1 + - autofs.spec | 35 +++++++++++++++++++++++++++-------- + autofs.spec | 41 ++++++++++++++++++++++++++++++----------- samples/autofs.service.in | 1 + - 3 files changed, 29 insertions(+), 8 deletions(-) + 3 files changed, 32 insertions(+), 11 deletions(-) ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -29,6 +29,7 @@ +diff --git a/CHANGELOG b/CHANGELOG +index 69ade49..b9c3149 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -32,6 +32,7 @@ - reinstate singleton mount probe. - rework error return handling in rpc code. - catch EHOSTUNREACH and bail out early. @@ -25,9 +27,11 @@ be done in a distro spec file. 28/06/2011 autofs-5.0.6 ----------------------- ---- autofs-5.0.6.orig/autofs.spec -+++ autofs-5.0.6/autofs.spec -@@ -105,27 +105,36 @@ install -m 644 redhat/autofs.sysconfig $ +diff --git a/autofs.spec b/autofs.spec +index d854b1f..a73fefb 100644 +--- a/autofs.spec ++++ b/autofs.spec +@@ -105,34 +105,53 @@ install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs %post %if %{with_systemd} @@ -35,12 +39,12 @@ be done in a distro spec file. +if [ $1 -eq 1 ]; then + %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || : + # autofs has been approved to be enabled by default -+ %{_bindir}systemctl enable %{name}.service >/dev/null 2>&1 || : ++ %{_bindir}/systemctl enable %{name}.service >/dev/null 2>&1 || : +fi %else -chkconfig --add autofs +if [ $1 -eq 1 ]; then -+ chkconfig --add autofs ++ %{_sbindir}/chkconfig --add autofs +fi %endif @@ -54,10 +58,12 @@ be done in a distro spec file. + %{_bindir}/systemctl stop %{name}.service > /dev/null 2>&1 || : +fi %else -+if [ $1 -eq 0 ] ; then - /sbin/service autofs stop > /dev/null 2>&1 || : - /sbin/chkconfig --del autofs +- /sbin/service autofs stop > /dev/null 2>&1 || : +- /sbin/chkconfig --del autofs -%endif ++if [ $1 -eq 0 ] ; then ++ %{_sbindir}/service autofs stop > /dev/null 2>&1 || : ++ %{_sbindir}/chkconfig --del autofs fi +%endif @@ -68,11 +74,12 @@ be done in a distro spec file. if [ $1 -ge 1 ] ; then - /bin/systemctl try-restart autofs.service >/dev/null 2>&1 || : + # Package upgrade, not removal -+ /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : ++ %{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || : fi %else if [ $1 -ge 1 ] ; then -@@ -133,6 +142,16 @@ if [ $1 -ge 1 ] ; then +- /sbin/service autofs condrestart > /dev/null 2>&1 || : ++ %{_sbindir}/service autofs condrestart > /dev/null 2>&1 || : fi %endif @@ -89,8 +96,10 @@ be done in a distro spec file. %files %defattr(-,root,root) %doc CREDITS CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf ---- autofs-5.0.6.orig/samples/autofs.service.in -+++ autofs-5.0.6/samples/autofs.service.in +diff --git a/samples/autofs.service.in b/samples/autofs.service.in +index 3756078..879b47b 100644 +--- a/samples/autofs.service.in ++++ b/samples/autofs.service.in @@ -7,6 +7,7 @@ Type=forking PIDFile=@@autofspiddir@@/autofs.pid EnvironmentFile=-@@autofsconfdir@@/autofs diff --git a/autofs.spec b/autofs.spec index 4188f91..6d9fd07 100644 --- a/autofs.spec +++ b/autofs.spec @@ -172,33 +172,51 @@ rm -rf $RPM_BUILD_ROOT %post %if %{with_systemd} /bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -eq 1 ]; then + %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || : + # autofs has been approved to be enabled by default + %{_bindir}/systemctl enable %{name}.service >/dev/null 2>&1 || : %else -/sbin/chkconfig --add autofs +if [ $1 -eq 1 ]; then + %{_sbindir}/sbin/chkconfig --add autofs +fi %endif %preun -if [ "$1" = 0 ] ; then %if %{with_systemd} - /bin/systemctl --no-reload disable autofs.service > /dev/null 2>&1 || : - /bin/systemctl stop autofs.service > /dev/null 2>&1 || : -%else - /sbin/service autofs stop > /dev/null 2>&1 || : - /sbin/chkconfig --del autofs -%endif +if [ $1 -eq 0 ] ; then + %{_bindir}/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || : + %{_bindir}/systemctl stop %{name}.service > /dev/null 2>&1 || : fi +%else +if [ $1 -eq 0 ] ; then + %{_sbindir}/service autofs stop > /dev/null 2>&1 || : + %{_sbindir}/chkconfig --del autofs +fi +%endif %postun %if %{with_systemd} -/bin/systemctl daemon-reload >/dev/null 2>&1 || : +%{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then - /bin/systemctl try-restart autofs.service >/dev/null 2>&1 || : + %{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || : fi %else if [ $1 -ge 1 ] ; then - /sbin/service autofs condrestart > /dev/null 2>&1 || : + %{_sbindir}/sbin/service autofs condrestart > /dev/null 2>&1 || : fi %endif +%triggerun -- %{name} < 5.0.6-5 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply %{name} +# to migrate them to systemd targets +%{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +%{_sbindir}/chkconfig --del %{name} >/dev/null 2>&1 || : +%{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || : + %files %defattr(-,root,root,-) %doc CREDITS INSTALL COPY* README* patches/* samples/ldap* samples/autofs.schema