File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,20 @@ def gzip_then_base64_encode(s: str) -> str:
351351 instance .terminate ()
352352 raise TimeoutError ("init.sh failed to complete within the timeout period" )
353353
354+ # Start fail2ban service before health checks
355+ logger .info ("Starting fail2ban service..." )
356+ result = run_ssh_command (ssh , "sudo systemctl start fail2ban.service" )
357+ if not result ["succeeded" ]:
358+ logger .warning (f"Failed to start fail2ban: { result ['stderr' ]} " )
359+ # Check fail2ban logs for more details
360+ log_result = run_ssh_command (
361+ ssh , "sudo journalctl -u fail2ban -n 20 --no-pager"
362+ )
363+ if log_result ["succeeded" ]:
364+ logger .warning (f"fail2ban logs:\n { log_result ['stdout' ]} " )
365+ else :
366+ logger .info ("fail2ban service started successfully" )
367+
354368 def is_healthy (ssh ) -> bool :
355369 health_checks = [
356370 ("postgres" , "sudo -u postgres /usr/bin/pg_isready -U postgres" ),
You can’t perform that action at this time.
0 commit comments