@@ -335,38 +335,38 @@ def is_healthy(host, instance_ip, ssh_identity_file) -> bool:
335335
336336 # Log Nix profile setup checks
337337 logger .info ("Checking Nix profile setup:" )
338- nix_profile_result = host .run ("sudo -u postgres ls -la /home/postgres/.nix-profile" )
338+ nix_profile_result = host .run ("ls -la /home/postgres/.nix-profile" )
339339 logger .info (f"Nix profile directory:\n { nix_profile_result .stdout } \n { nix_profile_result .stderr } " )
340340
341- nix_bin_result = host .run ("sudo -u postgres ls -la /home/postgres/.nix-profile/bin" )
341+ nix_bin_result = host .run ("ls -la /home/postgres/.nix-profile/bin" )
342342 logger .info (f"Nix profile bin directory:\n { nix_bin_result .stdout } \n { nix_bin_result .stderr } " )
343343
344- nix_script_result = host .run ("sudo -u postgres test -x /home/postgres/.nix-profile/bin/switch_pg_cron_version" )
344+ nix_script_result = host .run ("test -x /home/postgres/.nix-profile/bin/switch_pg_cron_version" )
345345 logger .info (f"Switch script executable check: { 'success' if not nix_script_result .failed else 'failed' } " )
346346
347- nix_script_output = host .run ("sudo -u postgres /home/postgres/.nix-profile/bin/switch_pg_cron_version" )
347+ nix_script_output = host .run ("/home/postgres/.nix-profile/bin/switch_pg_cron_version" )
348348 logger .info (f"Switch script output:\n { nix_script_output .stdout } \n { nix_script_output .stderr } " )
349349
350350 if systemd_status .failed :
351351 logger .error ("PostgreSQL systemd service is not active" )
352352 logger .error (f"systemd status: { systemd_status .stdout } " )
353353 logger .error (f"systemd error: { systemd_status .stderr } " )
354-
354+
355355 # Check systemd service unit file
356356 logger .error ("PostgreSQL systemd service unit file:" )
357357 result = host .run ("sudo systemctl cat postgresql" )
358358 logger .error (f"service unit file:\n { result .stdout } \n { result .stderr } " )
359-
359+
360360 # Check systemd service environment
361361 logger .error ("PostgreSQL systemd service environment:" )
362362 result = host .run ("sudo systemctl show postgresql" )
363363 logger .error (f"service environment:\n { result .stdout } \n { result .stderr } " )
364-
364+
365365 # Check systemd service dependencies
366366 logger .error ("PostgreSQL systemd service dependencies:" )
367367 result = host .run ("sudo systemctl list-dependencies postgresql" )
368368 logger .error (f"service dependencies:\n { result .stdout } \n { result .stderr } " )
369-
369+
370370 # Check if service is enabled
371371 logger .error ("PostgreSQL service enabled status:" )
372372 result = host .run ("sudo systemctl is-enabled postgresql" )
0 commit comments