Docker containers should start at boottime.
This commit is contained in:
parent
e953eb8053
commit
0482e55f86
@ -60,8 +60,17 @@ apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docke
|
||||
# systemctl disable docker.service
|
||||
# systemctl disable containerd.service
|
||||
#
|
||||
systemctl enable docker.service
|
||||
systemctl enable containerd.service
|
||||
systemctl enable docker.service
|
||||
|
||||
# !! Note !!
|
||||
#
|
||||
# if enabling 'docker service' failed, you can try to manually set the symlink that causes
|
||||
# automatic booting:
|
||||
#
|
||||
# ln -s /lib/systemd/system/docker.service /etc/systemd/system/multi-user.target.wants/
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
|
||||
# ----------
|
||||
|
@ -538,5 +538,60 @@ else
|
||||
info "All needed debian packages already installed."
|
||||
fi
|
||||
|
||||
|
||||
_service_name="containerd"
|
||||
echononl "Enable '${_service_name}.service' - start at boot time.."
|
||||
if $(systemctl is-enabled ${_service_name}.service --quiet 2> /dev/null) ; then
|
||||
echo_skipped
|
||||
else
|
||||
systemctl enable ${_service_name}.service > "$log_file" 2>&1
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
echo_ok
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat $log_file)"
|
||||
|
||||
echononl "continue anyway [yes/no]: "
|
||||
read OK
|
||||
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||
echononl "Wrong entry! - repeat [yes/no]: "
|
||||
read OK
|
||||
done
|
||||
[[ $OK = "yes" ]] || fatal "Interrupted by user."
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
_service_name="docker"
|
||||
echononl "Enable '${_service_name}.service' - start at boot time.."
|
||||
if $(systemctl is-enabled ${_service_name}.service --quiet 2> /dev/null) ; then
|
||||
echo_skipped
|
||||
else
|
||||
systemctl enable ${_service_name}.service > "$log_file" 2>&1
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
echo_ok
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat $log_file)"
|
||||
|
||||
info "You can try to manually set the symlink that causes automatic booting:
|
||||
|
||||
\033[1mln -s /lib/systemd/system/docker.service /etc/systemd/system/multi-user.target.wants/\033[m"
|
||||
|
||||
echononl "continue anyway [yes/no]: "
|
||||
read OK
|
||||
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||
echononl "Wrong entry! - repeat [yes/no]: "
|
||||
read OK
|
||||
done
|
||||
[[ $OK = "yes" ]] || fatal "Interrupted by user."
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
clean_up 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user