From: Rafael dos Santos Silva Date: Tue, 31 Jan 2023 18:31:02 +0000 (-0300) Subject: Add kernel version check (#673) [ci skip] X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b952c711a17ec0e08eaef7cd1aed71c9285b7b30;p=discourse_docker.git Add kernel version check (#673) [ci skip] On Ruby 3.1 there is a `RuntimeException` when calling `Random.urandom` on platforms where it's not properly implemented, which includes people running Ubuntu 14.04 with kernel 3.13. See https://meta.discourse.org/t/docker-build-broken-site-down/252047 https://meta.discourse.org/t/undefined-method-deprecated-for-nil-nilclass-on-rebuild/251711 https://meta.discourse.org/t/discourse-update-error/253197 https://meta.discourse.org/t/bootstrap-failure-during-most-recent-upgrade/253424 --- diff --git a/launcher b/launcher index dddfa94..ada7509 100755 --- a/launcher +++ b/launcher @@ -87,6 +87,7 @@ docker_min_version='17.03.1' docker_rec_version='17.06.2' git_min_version='1.8.0' git_rec_version='1.8.0' +kernel_min_version='4.14.0' config_file=containers/"$config".yml cidbootstrap=cids/"$config"_bootstrap.cid @@ -259,6 +260,15 @@ check_prereqs() { echo "WARNING: Git version ${test} deprecated, recommend upgrade to ${git_rec_version} or newer." fi + # Check minimum kernel version due to https://bugs.ruby-lang.org/issues/13885 + test=($(uname -r)) + + # At least minimum version + if compare_version "${kernel_min_version}" "${test}"; then + echo "ERROR: Kernel version ${test} not supported, please upgrade to at least ${kernel_min_version}" + exit 1 + fi + # 6. able to attach stderr / out / tty test=`$docker_path run $user_args -i --rm -a stdout -a stderr $image echo working` if [[ "$test" =~ "working" ]] ; then : ; else