Обсуждение: untracked child process (PID XXXXX) exited with exit code 120
Hi, I am running PostgreSQL 18.3 (Debian 18.3-1.pgdg13+1) (docker image) and found this in my database logs the other day: 2026-05-07 18:39:13.947 CEST [1] LOG: untracked child process (PID 33254) exited with exit code 120 2026-05-07 18:39:13.947 CEST [1] LOG: terminating any other active server processes 2026-05-07 18:39:14.077 CEST [1] LOG: all server processes terminated; reinitializing Anyone an idea about that untracked child process and what exit code 120 of that process would mean / want to tell me? Thanks. Torsten PS: I used https://www.postgresql.org/search/ , but was unsuccessful so far to get any hints on this, but maybe I just did not find the correct question yet ;).
My guess would be that the postmaster in your container is running with PID=1.
The unexpected process was probably started by docker entrypoint before it did exec postgres [...].
As a result, this subprocess became a direct child of the postmaster and we got the problem.
The most common solution is to avoid running postmaster with PID=1.
There are two options available:
1. dumb-init
2. start container using "docker run --init [...]"
On Thu, 7 May 2026 at 19:37, Torsten Krah <krah.tm@gmail.com> wrote:
Hi,
I am running PostgreSQL 18.3 (Debian 18.3-1.pgdg13+1) (docker image)
and found this in my database logs the other day:
2026-05-07 18:39:13.947 CEST [1] LOG: untracked child process (PID 33254) exited with exit code 120
2026-05-07 18:39:13.947 CEST [1] LOG: terminating any other active server processes
2026-05-07 18:39:14.077 CEST [1] LOG: all server processes terminated; reinitializing
Anyone an idea about that untracked child process and what exit code
120 of that process would mean / want to tell me?
Thanks.
Torsten
PS: I used https://www.postgresql.org/search/ , but was unsuccessful so
far to get any hints on this, but maybe I just did not find the correct
question yet ;).
--
Regards,
--
Alexander Kukushkin
Am Donnerstag, dem 07.05.2026 um 19:51 +0200 schrieb Alexander Kukushkin: > My guess would be that the postmaster in your container is running > with > PID=1. > The unexpected process was probably started by docker entrypoint > before it > did exec postgres [...]. > As a result, this subprocess became a direct child of the postmaster > and we > got the problem. > > The most common solution is to avoid running postmaster with PID=1. > There are two options available: > 1. dumb-init > 2. start container using "docker run --init [...]" My /docker-entrypoint-initdb.d is empty and I did not customize the default entrypoint or command to run (there was a ready to use data dir / volume, so it just skipped initialization on start), so I am not sure what else should have been started, but I know, just guesswork here. Between starting the pod initially: 16:52:28.317 and the time the untracked process did fail: 18:39:13.947 nearly 2 hours passed, ah too bad I will never know what PID 120 was. Yes, the postgres image postgres:18-trixie does run the postgres process with PID=1: postgres 1 0.0 0.2 4443124 139360 ? Ss May06 0:27 postgres Using kubernetes as runtime, there is no "--init" option and e.g. tini is not in the image - if is is a problem running postgres with pid=1, could e.g. tini be added to the image (if so, do you know where to address this?) and used as default entrypoint (I know I can build one myself and extend that image to provide tini, but I would prefer just to use the upstream image as-is)? kind regards Torsten
Torsten Krah <krah.tm@gmail.com> writes:
> Yes, the postgres image postgres:18-trixie does run the postgres
> process with PID=1:
That's just insane. You should file a bug with whoever supplies
that image.
regards, tom lane
https://github.com/docker-library/postgres/issues/1349
Someone already did, unfortunately they denied that request ... it seems I have to build my own image or use another one.
Thanks anyway, I can work with that and fix it.
kind regards
Torsten