Revive pre / post steps, update offline location

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 558cd9c4bb28a11fe1ff3da45a4efd19265d7ce5
Component: packaging
This commit is contained in:
Eli Uriegas
2018-08-15 23:17:54 +00:00
parent cbb6da8c29
commit 4670e93b92
2 changed files with 24 additions and 24 deletions
+23 -23
View File
@@ -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
@@ -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
+1 -1
View File
@@ -6,7 +6,7 @@ Wants=network-online.target containerd.service
[Service]
# Install containerd-shim-process if it's not already installed
ExecStartPre=/usr/libexec/containerd-offline-installer /var/lib/containerd/containerd-shim-process.tar docker.io/docker/containerd-shim-process
ExecStartPre=/usr/libexec/containerd-offline-installer /var/lib/containerd-offline-installer/containerd-shim-process.tar docker.io/docker/containerd-shim-process
ExecStart=/usr/bin/dockerd
TimeoutSec=infinity
KillMode=process