From 14022896aac44af54677e4bfd99324f8685cf3b4 Mon Sep 17 00:00:00 2001 From: digimer Date: Wed, 24 Jan 2024 23:41:52 -0500 Subject: [PATCH] Added a call for non-striker machines to call check_sshd if no DBs. Also added a check for sshd_config.d so that it doesn't error on EL8 machines. Signed-off-by: digimer --- Anvil/Tools.pm | 1 + tools/anvil-daemon | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Anvil/Tools.pm b/Anvil/Tools.pm index 1addce07..87ed9f6e 100644 --- a/Anvil/Tools.pm +++ b/Anvil/Tools.pm @@ -1131,6 +1131,7 @@ sub _set_paths provision => "/mnt/shared/provision", temp => "/mnt/shared/temp", }, + 'sshd_config.d' => "/etc/ssh/sshd_config.d", skins => "/var/www/html/skins", status => "/var/www/html/status", syslinux => "/usr/share/syslinux", diff --git a/tools/anvil-daemon b/tools/anvil-daemon index 51ff9437..05e6cdd0 100755 --- a/tools/anvil-daemon +++ b/tools/anvil-daemon @@ -101,6 +101,9 @@ if (not $anvil->data->{sys}{database}{connections}) } else { + # Striker can't initialize us unless it can ssh into us, so make sure root login is enabled. + chech_sshd($anvil); + # Wait until we have one. $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "error_0075"}); @@ -1035,6 +1038,13 @@ sub chech_sshd { my ($anvil) = @_; + # On EL8, the 'sshd_config.d' directory doesn't exist and root is enabled. + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'path::directories::sshd_config.d' => $anvil->data->{path}{directories}{'sshd_config.d'} }}); + if (not -d $anvil->data->{path}{directories}{'sshd_config.d'}) + { + return(0); + } + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'path::configs::sshd_root_password' => $anvil->data->{path}{configs}{sshd_root_password} }}); if (not -f $anvil->data->{path}{configs}{sshd_root_password}) {