You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove After=foreman.target to fix systemd ordering cycles
After=foreman.target was added in 805217d to ensure systemctl stop
foreman.target blocks until all constituent services fully stop, preventing
a rapid stop+start race. However, every service is also WantedBy=foreman.target,
making After=foreman.target inherently circular: foreman.target cannot finish
starting until its Wants are satisfied, but those services cannot start until
foreman.target has started.
This caused both start and stop ordering cycles, which systemd resolved by
dropping jobs — leading to unclean postgresql shutdowns, stale postmaster.pid
files, and the very race condition the original fix was trying to prevent.
Remove After=foreman.target from all services. Stop ordering is preserved
through inter-service After= relationships: all application services are
After=redis.service postgresql.service (reversed: redis/postgresql stop after
all application services). PartOf=foreman.target ensures services stop when
foreman.target stops, and systemctl stop foreman.target waits for the full
PartOf-propagated transaction to complete.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments