Skip to content

Commit 2d0d9a3

Browse files
authored
Merge pull request #763 from GameScripting/patch-1
Changed default stopsignal from SIGTERM to SIGINT
2 parents 09c342c + bfc5d81 commit 2d0d9a3

14 files changed

+420
-0
lines changed

10/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
184184
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
185185
ENTRYPOINT ["docker-entrypoint.sh"]
186186

187+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
188+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
189+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
190+
# flush tables to disk, which is the best compromise available to avoid data
191+
# corruption.
192+
#
193+
# Users who know their applications do not keep open long-lived idle connections
194+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
195+
# Shutdown mode" in which any existing sessions are allowed to finish and the
196+
# server stops when all sessions are terminated.
197+
#
198+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
199+
# about available PostgreSQL server shutdown signals.
200+
#
201+
# See also https://www.postgresql.org/docs/12/server-start.html for further
202+
# justification of this as the default value, namely that the example (and
203+
# shipped) systemd service files use the "Fast Shutdown mode" for service
204+
# termination.
205+
#
206+
STOPSIGNAL SIGINT
207+
#
208+
# An additional setting that is recommended for all users regardless of this
209+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
210+
# equivalent) for controlling how long to wait between sending the defined
211+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
212+
#
213+
# The default in most runtimes (such as Docker) is 10 seconds, and the
214+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
215+
# that even 90 seconds may not be long enough in many instances.
216+
187217
EXPOSE 5432
188218
CMD ["postgres"]

10/alpine/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
148148
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
149149
ENTRYPOINT ["docker-entrypoint.sh"]
150150

151+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
152+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
153+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
154+
# flush tables to disk, which is the best compromise available to avoid data
155+
# corruption.
156+
#
157+
# Users who know their applications do not keep open long-lived idle connections
158+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
159+
# Shutdown mode" in which any existing sessions are allowed to finish and the
160+
# server stops when all sessions are terminated.
161+
#
162+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
163+
# about available PostgreSQL server shutdown signals.
164+
#
165+
# See also https://www.postgresql.org/docs/12/server-start.html for further
166+
# justification of this as the default value, namely that the example (and
167+
# shipped) systemd service files use the "Fast Shutdown mode" for service
168+
# termination.
169+
#
170+
STOPSIGNAL SIGINT
171+
#
172+
# An additional setting that is recommended for all users regardless of this
173+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
174+
# equivalent) for controlling how long to wait between sending the defined
175+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
176+
#
177+
# The default in most runtimes (such as Docker) is 10 seconds, and the
178+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
179+
# that even 90 seconds may not be long enough in many instances.
180+
151181
EXPOSE 5432
152182
CMD ["postgres"]

11/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
184184
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
185185
ENTRYPOINT ["docker-entrypoint.sh"]
186186

187+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
188+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
189+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
190+
# flush tables to disk, which is the best compromise available to avoid data
191+
# corruption.
192+
#
193+
# Users who know their applications do not keep open long-lived idle connections
194+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
195+
# Shutdown mode" in which any existing sessions are allowed to finish and the
196+
# server stops when all sessions are terminated.
197+
#
198+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
199+
# about available PostgreSQL server shutdown signals.
200+
#
201+
# See also https://www.postgresql.org/docs/12/server-start.html for further
202+
# justification of this as the default value, namely that the example (and
203+
# shipped) systemd service files use the "Fast Shutdown mode" for service
204+
# termination.
205+
#
206+
STOPSIGNAL SIGINT
207+
#
208+
# An additional setting that is recommended for all users regardless of this
209+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
210+
# equivalent) for controlling how long to wait between sending the defined
211+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
212+
#
213+
# The default in most runtimes (such as Docker) is 10 seconds, and the
214+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
215+
# that even 90 seconds may not be long enough in many instances.
216+
187217
EXPOSE 5432
188218
CMD ["postgres"]

11/alpine/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
150150
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
151151
ENTRYPOINT ["docker-entrypoint.sh"]
152152

153+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
154+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
155+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
156+
# flush tables to disk, which is the best compromise available to avoid data
157+
# corruption.
158+
#
159+
# Users who know their applications do not keep open long-lived idle connections
160+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
161+
# Shutdown mode" in which any existing sessions are allowed to finish and the
162+
# server stops when all sessions are terminated.
163+
#
164+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
165+
# about available PostgreSQL server shutdown signals.
166+
#
167+
# See also https://www.postgresql.org/docs/12/server-start.html for further
168+
# justification of this as the default value, namely that the example (and
169+
# shipped) systemd service files use the "Fast Shutdown mode" for service
170+
# termination.
171+
#
172+
STOPSIGNAL SIGINT
173+
#
174+
# An additional setting that is recommended for all users regardless of this
175+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
176+
# equivalent) for controlling how long to wait between sending the defined
177+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
178+
#
179+
# The default in most runtimes (such as Docker) is 10 seconds, and the
180+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
181+
# that even 90 seconds may not be long enough in many instances.
182+
153183
EXPOSE 5432
154184
CMD ["postgres"]

12/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
184184
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
185185
ENTRYPOINT ["docker-entrypoint.sh"]
186186

187+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
188+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
189+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
190+
# flush tables to disk, which is the best compromise available to avoid data
191+
# corruption.
192+
#
193+
# Users who know their applications do not keep open long-lived idle connections
194+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
195+
# Shutdown mode" in which any existing sessions are allowed to finish and the
196+
# server stops when all sessions are terminated.
197+
#
198+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
199+
# about available PostgreSQL server shutdown signals.
200+
#
201+
# See also https://www.postgresql.org/docs/12/server-start.html for further
202+
# justification of this as the default value, namely that the example (and
203+
# shipped) systemd service files use the "Fast Shutdown mode" for service
204+
# termination.
205+
#
206+
STOPSIGNAL SIGINT
207+
#
208+
# An additional setting that is recommended for all users regardless of this
209+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
210+
# equivalent) for controlling how long to wait between sending the defined
211+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
212+
#
213+
# The default in most runtimes (such as Docker) is 10 seconds, and the
214+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
215+
# that even 90 seconds may not be long enough in many instances.
216+
187217
EXPOSE 5432
188218
CMD ["postgres"]

12/alpine/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,35 @@ VOLUME /var/lib/postgresql/data
149149
COPY docker-entrypoint.sh /usr/local/bin/
150150
ENTRYPOINT ["docker-entrypoint.sh"]
151151

152+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
153+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
154+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
155+
# flush tables to disk, which is the best compromise available to avoid data
156+
# corruption.
157+
#
158+
# Users who know their applications do not keep open long-lived idle connections
159+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
160+
# Shutdown mode" in which any existing sessions are allowed to finish and the
161+
# server stops when all sessions are terminated.
162+
#
163+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
164+
# about available PostgreSQL server shutdown signals.
165+
#
166+
# See also https://www.postgresql.org/docs/12/server-start.html for further
167+
# justification of this as the default value, namely that the example (and
168+
# shipped) systemd service files use the "Fast Shutdown mode" for service
169+
# termination.
170+
#
171+
STOPSIGNAL SIGINT
172+
#
173+
# An additional setting that is recommended for all users regardless of this
174+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
175+
# equivalent) for controlling how long to wait between sending the defined
176+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
177+
#
178+
# The default in most runtimes (such as Docker) is 10 seconds, and the
179+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
180+
# that even 90 seconds may not be long enough in many instances.
181+
152182
EXPOSE 5432
153183
CMD ["postgres"]

13/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
186186
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
187187
ENTRYPOINT ["docker-entrypoint.sh"]
188188

189+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
190+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
191+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
192+
# flush tables to disk, which is the best compromise available to avoid data
193+
# corruption.
194+
#
195+
# Users who know their applications do not keep open long-lived idle connections
196+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
197+
# Shutdown mode" in which any existing sessions are allowed to finish and the
198+
# server stops when all sessions are terminated.
199+
#
200+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
201+
# about available PostgreSQL server shutdown signals.
202+
#
203+
# See also https://www.postgresql.org/docs/12/server-start.html for further
204+
# justification of this as the default value, namely that the example (and
205+
# shipped) systemd service files use the "Fast Shutdown mode" for service
206+
# termination.
207+
#
208+
STOPSIGNAL SIGINT
209+
#
210+
# An additional setting that is recommended for all users regardless of this
211+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
212+
# equivalent) for controlling how long to wait between sending the defined
213+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
214+
#
215+
# The default in most runtimes (such as Docker) is 10 seconds, and the
216+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
217+
# that even 90 seconds may not be long enough in many instances.
218+
189219
EXPOSE 5432
190220
CMD ["postgres"]

13/alpine/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,35 @@ VOLUME /var/lib/postgresql/data
149149
COPY docker-entrypoint.sh /usr/local/bin/
150150
ENTRYPOINT ["docker-entrypoint.sh"]
151151

152+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
153+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
154+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
155+
# flush tables to disk, which is the best compromise available to avoid data
156+
# corruption.
157+
#
158+
# Users who know their applications do not keep open long-lived idle connections
159+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
160+
# Shutdown mode" in which any existing sessions are allowed to finish and the
161+
# server stops when all sessions are terminated.
162+
#
163+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
164+
# about available PostgreSQL server shutdown signals.
165+
#
166+
# See also https://www.postgresql.org/docs/12/server-start.html for further
167+
# justification of this as the default value, namely that the example (and
168+
# shipped) systemd service files use the "Fast Shutdown mode" for service
169+
# termination.
170+
#
171+
STOPSIGNAL SIGINT
172+
#
173+
# An additional setting that is recommended for all users regardless of this
174+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
175+
# equivalent) for controlling how long to wait between sending the defined
176+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
177+
#
178+
# The default in most runtimes (such as Docker) is 10 seconds, and the
179+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
180+
# that even 90 seconds may not be long enough in many instances.
181+
152182
EXPOSE 5432
153183
CMD ["postgres"]

9.5/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
185185
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
186186
ENTRYPOINT ["docker-entrypoint.sh"]
187187

188+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
189+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
190+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
191+
# flush tables to disk, which is the best compromise available to avoid data
192+
# corruption.
193+
#
194+
# Users who know their applications do not keep open long-lived idle connections
195+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
196+
# Shutdown mode" in which any existing sessions are allowed to finish and the
197+
# server stops when all sessions are terminated.
198+
#
199+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
200+
# about available PostgreSQL server shutdown signals.
201+
#
202+
# See also https://www.postgresql.org/docs/12/server-start.html for further
203+
# justification of this as the default value, namely that the example (and
204+
# shipped) systemd service files use the "Fast Shutdown mode" for service
205+
# termination.
206+
#
207+
STOPSIGNAL SIGINT
208+
#
209+
# An additional setting that is recommended for all users regardless of this
210+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
211+
# equivalent) for controlling how long to wait between sending the defined
212+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
213+
#
214+
# The default in most runtimes (such as Docker) is 10 seconds, and the
215+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
216+
# that even 90 seconds may not be long enough in many instances.
217+
188218
EXPOSE 5432
189219
CMD ["postgres"]

9.5/alpine/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
146146
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
147147
ENTRYPOINT ["docker-entrypoint.sh"]
148148

149+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
150+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
151+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
152+
# flush tables to disk, which is the best compromise available to avoid data
153+
# corruption.
154+
#
155+
# Users who know their applications do not keep open long-lived idle connections
156+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
157+
# Shutdown mode" in which any existing sessions are allowed to finish and the
158+
# server stops when all sessions are terminated.
159+
#
160+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
161+
# about available PostgreSQL server shutdown signals.
162+
#
163+
# See also https://www.postgresql.org/docs/12/server-start.html for further
164+
# justification of this as the default value, namely that the example (and
165+
# shipped) systemd service files use the "Fast Shutdown mode" for service
166+
# termination.
167+
#
168+
STOPSIGNAL SIGINT
169+
#
170+
# An additional setting that is recommended for all users regardless of this
171+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
172+
# equivalent) for controlling how long to wait between sending the defined
173+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
174+
#
175+
# The default in most runtimes (such as Docker) is 10 seconds, and the
176+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
177+
# that even 90 seconds may not be long enough in many instances.
178+
149179
EXPOSE 5432
150180
CMD ["postgres"]

9.6/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,35 @@ COPY docker-entrypoint.sh /usr/local/bin/
185185
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
186186
ENTRYPOINT ["docker-entrypoint.sh"]
187187

188+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
189+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
190+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
191+
# flush tables to disk, which is the best compromise available to avoid data
192+
# corruption.
193+
#
194+
# Users who know their applications do not keep open long-lived idle connections
195+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
196+
# Shutdown mode" in which any existing sessions are allowed to finish and the
197+
# server stops when all sessions are terminated.
198+
#
199+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
200+
# about available PostgreSQL server shutdown signals.
201+
#
202+
# See also https://www.postgresql.org/docs/12/server-start.html for further
203+
# justification of this as the default value, namely that the example (and
204+
# shipped) systemd service files use the "Fast Shutdown mode" for service
205+
# termination.
206+
#
207+
STOPSIGNAL SIGINT
208+
#
209+
# An additional setting that is recommended for all users regardless of this
210+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
211+
# equivalent) for controlling how long to wait between sending the defined
212+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
213+
#
214+
# The default in most runtimes (such as Docker) is 10 seconds, and the
215+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
216+
# that even 90 seconds may not be long enough in many instances.
217+
188218
EXPOSE 5432
189219
CMD ["postgres"]

0 commit comments

Comments
 (0)