Enable system servivces 'containerd' and 'docker' at system boot.

This commit is contained in:
Christoph 2025-01-28 11:40:20 +00:00
parent 273eaebc89
commit 5598a0f9b7

View File

@ -627,4 +627,60 @@ else
fi fi
fi fi
blank_line
_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 clean_up 0