Merge pull request #20 from andrewhsu/restart
restart docker service if needed for rpm upgrade Upstream-commit: 7267953ecb55a0c0ac73cc04edd68746e725105c Component: packaging
This commit is contained in:
@ -164,6 +164,20 @@ done
|
||||
/usr/share/vim/vimfiles/syntax/dockerfile.vim
|
||||
/usr/share/nano/Dockerfile.nanorc
|
||||
|
||||
%pre
|
||||
if [ $1 -gt 0 ] ; then
|
||||
# package upgrade scenario, before new files are installed
|
||||
|
||||
# clear any old state
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
|
||||
# check if docker service is running
|
||||
if systemctl is-active docker > /dev/null 2>&1; then
|
||||
systemctl stop docker > /dev/null 2>&1 || :
|
||||
touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
%systemd_post docker
|
||||
if ! getent group docker > /dev/null; then
|
||||
@ -176,6 +190,17 @@ fi
|
||||
%postun
|
||||
%systemd_postun_with_restart docker
|
||||
|
||||
%posttrans
|
||||
if [ $1 -ge 0 ] ; then
|
||||
# package upgrade scenario, after new files are installed
|
||||
|
||||
# check if docker was running before upgrade
|
||||
if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then
|
||||
systemctl start docker > /dev/null 2>&1 || :
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%changelog
|
||||
|
||||
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
|
||||
|
||||
@ -165,6 +165,20 @@ done
|
||||
/usr/share/vim/vimfiles/syntax/dockerfile.vim
|
||||
/usr/share/nano/Dockerfile.nanorc
|
||||
|
||||
%pre
|
||||
if [ $1 -gt 0 ] ; then
|
||||
# package upgrade scenario, before new files are installed
|
||||
|
||||
# clear any old state
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
|
||||
# check if docker service is running
|
||||
if systemctl is-active docker > /dev/null 2>&1; then
|
||||
systemctl stop docker > /dev/null 2>&1 || :
|
||||
touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
%systemd_post docker
|
||||
if ! getent group docker > /dev/null; then
|
||||
@ -177,6 +191,17 @@ fi
|
||||
%postun
|
||||
%systemd_postun_with_restart docker
|
||||
|
||||
%posttrans
|
||||
if [ $1 -ge 0 ] ; then
|
||||
# package upgrade scenario, after new files are installed
|
||||
|
||||
# check if docker was running before upgrade
|
||||
if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then
|
||||
systemctl start docker > /dev/null 2>&1 || :
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%changelog
|
||||
|
||||
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
|
||||
|
||||
@ -163,6 +163,20 @@ done
|
||||
/usr/share/vim/vimfiles/syntax/dockerfile.vim
|
||||
/usr/share/nano/Dockerfile.nanorc
|
||||
|
||||
%pre
|
||||
if [ $1 -gt 0 ] ; then
|
||||
# package upgrade scenario, before new files are installed
|
||||
|
||||
# clear any old state
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
|
||||
# check if docker service is running
|
||||
if systemctl is-active docker > /dev/null 2>&1; then
|
||||
systemctl stop docker > /dev/null 2>&1 || :
|
||||
touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
%systemd_post docker
|
||||
if ! getent group docker > /dev/null; then
|
||||
@ -175,6 +189,17 @@ fi
|
||||
%postun
|
||||
%systemd_postun_with_restart docker
|
||||
|
||||
%posttrans
|
||||
if [ $1 -ge 0 ] ; then
|
||||
# package upgrade scenario, after new files are installed
|
||||
|
||||
# check if docker was running before upgrade
|
||||
if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then
|
||||
systemctl start docker > /dev/null 2>&1 || :
|
||||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%changelog
|
||||
|
||||
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
|
||||
|
||||
Reference in New Issue
Block a user