clean up systemd service

This commit is contained in:
Than Ngo 2020-10-01 10:48:19 +02:00
parent bd1bae9a41
commit 1f084d071c

View File

@ -1,6 +1,6 @@
Name: powerpc-utils Name: powerpc-utils
Version: 1.3.8 Version: 1.3.8
Release: 1%{?dist} Release: 2%{?dist}
Summary: Utilities for PowerPC platforms Summary: Utilities for PowerPC platforms
License: GPLv2 License: GPLv2
@ -11,6 +11,7 @@ Source1: nvsetenv
ExclusiveArch: ppc %{power64} ExclusiveArch: ppc %{power64}
BuildRequires: gcc BuildRequires: gcc
BuildRequires: make
BuildRequires: automake BuildRequires: automake
BuildRequires: doxygen BuildRequires: doxygen
BuildRequires: zlib-devel BuildRequires: zlib-devel
@ -98,26 +99,26 @@ ln -s serv_config.8 %{buildroot}%{_mandir}/man8/uspchrp.8
rm -f $RPM_BUILD_ROOT%{_sbindir}/snap $RPM_BUILD_ROOT%{_mandir}/man8/snap.8* rm -f $RPM_BUILD_ROOT%{_sbindir}/snap $RPM_BUILD_ROOT%{_mandir}/man8/snap.8*
%post %post
systemctl daemon-reload systemctl daemon-reload >/dev/null 2>&1 || :
#systemctl start hcn-init.service systemctl start hcn-init.service >/dev/null 2>&1 || :
#systemctl enable hcn-init.service systemctl enable hcn-init.service >/dev/null 2>&1 || :
# update the smt.state file with current SMT # update the smt.state file with current SMT
/usr/sbin/smtstate --save /usr/sbin/smtstate --save >/dev/null 2>&1 || :
%preun %preun
svc=$(systemctl list-units -la | grep -Fq smtstate.service; echo $?) svc=$(systemctl list-units -la | grep -Fq smtstate.service; echo $?)
if [ "$svc" = "0" ]; then if [ "$svc" = "0" ]; then
systemctl stop smtstate.service systemctl stop smtstate.service >/dev/null 2>&1 || :
systemctl disable smtstate.service systemctl disable smtstate.service >/dev/null 2>&1 || :
fi
if systemctl is-enabled hcn-init.service |grep -q "enabled"; then
systemctl stop hcn-init.service >/dev/null 2>&1 || :
systemctl disable hcn-init.service >/dev/null 2>&1 || :
fi fi
#if systemctl is-enabled hcn-init.service |grep -q "enabled"; then
# systemctl stop hcn-init.service
# systemctl disable hcn-init.service
#fi
%postun %postun
systemctl daemon-reload systemctl daemon-reload >/dev/null 2>&1 || :
%files %files
%doc README Changelog %doc README Changelog
@ -205,6 +206,9 @@ systemctl daemon-reload
%changelog %changelog
* Thu Oct 01 2020 Than Ngo <than@redhat.com> - 1.3.8-2
- clean up systemd service
* Fri Sep 04 2020 Than Ngo <than@redhat.com> - 1.3.8-1 * Fri Sep 04 2020 Than Ngo <than@redhat.com> - 1.3.8-1
- update to 1.3.8 - update to 1.3.8