Skip to content

Commit

Permalink
Revive pre / post steps, update offline location
Browse files Browse the repository at this point in the history
Signed-off-by: Eli Uriegas <[email protected]>
  • Loading branch information
seemethere committed Aug 15, 2018
1 parent df2a0d6 commit 519a0d3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,29 @@ popd
%install
# Install containerd-proxy as dockerd
install -D -m 0755 %{_topdir}/BUILD/src/containerd-proxy/bin/containerd-proxy $RPM_BUILD_ROOT/%{_bindir}/dockerd
install -D -m 0644 %{_topdir}/SOURCES/containerd-shim-process.tar $RPM_BUILD_ROOT/%{_sharedstatedir}/containerd/containerd-shim-process.tar
install -D -m 0644 %{_topdir}/SOURCES/containerd-shim-process.tar $RPM_BUILD_ROOT/%{_sharedstatedir}/containerd-offline-installer/containerd-shim-process.tar
install -D -m 0644 %{_topdir}/SOURCES/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
install -D -m 0644 %{_topdir}/SOURCES/dockerd.json $RPM_BUILD_ROOT/etc/containerd-proxy/dockerd.json

%files
/%{_bindir}/dockerd
/%{_sharedstatedir}/containerd/containerd-shim-process.tar
/%{_sharedstatedir}/containerd-offline-installer/containerd-shim-process.tar
/%{_unitdir}/docker.service
/etc/containerd-proxy/dockerd.json

%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
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
Expand All @@ -99,14 +99,14 @@ fi
%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
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

0 comments on commit 519a0d3

Please sign in to comment.