From 5598a0f9b790b92e7cb69a98f17d1d94a51d2c86 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 28 Jan 2025 11:40:20 +0000 Subject: [PATCH] Enable system servivces 'containerd' and 'docker' at system boot. --- bbb-pre-install.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/bbb-pre-install.sh b/bbb-pre-install.sh index 85ea84c..dd894c7 100755 --- a/bbb-pre-install.sh +++ b/bbb-pre-install.sh @@ -627,4 +627,60 @@ else 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