@@ -335,38 +335,38 @@ def is_healthy(host, instance_ip, ssh_identity_file) -> bool:
335
335
336
336
# Log Nix profile setup checks
337
337
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" )
339
339
logger .info (f"Nix profile directory:\n { nix_profile_result .stdout } \n { nix_profile_result .stderr } " )
340
340
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" )
342
342
logger .info (f"Nix profile bin directory:\n { nix_bin_result .stdout } \n { nix_bin_result .stderr } " )
343
343
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" )
345
345
logger .info (f"Switch script executable check: { 'success' if not nix_script_result .failed else 'failed' } " )
346
346
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" )
348
348
logger .info (f"Switch script output:\n { nix_script_output .stdout } \n { nix_script_output .stderr } " )
349
349
350
350
if systemd_status .failed :
351
351
logger .error ("PostgreSQL systemd service is not active" )
352
352
logger .error (f"systemd status: { systemd_status .stdout } " )
353
353
logger .error (f"systemd error: { systemd_status .stderr } " )
354
-
354
+
355
355
# Check systemd service unit file
356
356
logger .error ("PostgreSQL systemd service unit file:" )
357
357
result = host .run ("sudo systemctl cat postgresql" )
358
358
logger .error (f"service unit file:\n { result .stdout } \n { result .stderr } " )
359
-
359
+
360
360
# Check systemd service environment
361
361
logger .error ("PostgreSQL systemd service environment:" )
362
362
result = host .run ("sudo systemctl show postgresql" )
363
363
logger .error (f"service environment:\n { result .stdout } \n { result .stderr } " )
364
-
364
+
365
365
# Check systemd service dependencies
366
366
logger .error ("PostgreSQL systemd service dependencies:" )
367
367
result = host .run ("sudo systemctl list-dependencies postgresql" )
368
368
logger .error (f"service dependencies:\n { result .stdout } \n { result .stderr } " )
369
-
369
+
370
370
# Check if service is enabled
371
371
logger .error ("PostgreSQL service enabled status:" )
372
372
result = host .run ("sudo systemctl is-enabled postgresql" )
0 commit comments