Skip to content

Commit f02eade

Browse files
committed
fix: ensure that Kong service is stopped before Envoy service is started
Per https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Before=, "Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is After= or Before=, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place." Also ensures that Envoy will take priority over Kong on reboot if both are enabled.
1 parent 7942c68 commit f02eade

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ansible/files/kong_config/kong.service.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ After=postgrest.service gotrue.service adminapi.service
44
Wants=postgrest.service gotrue.service adminapi.service
55
Conflicts=envoy.service
66

7+
# Ensures that Kong service is stopped before Envoy service is started
8+
Before=envoy.service
9+
710
[Service]
811
Type=forking
912
ExecStart=/usr/local/bin/kong start -c /etc/kong/kong.conf

0 commit comments

Comments
 (0)