Skip to content

Docker: Fix entrypoint to run as PID 1#731

Merged
phnzb merged 4 commits intonzbgetcom:developfrom
calvinbui:develop
Feb 6, 2026
Merged

Docker: Fix entrypoint to run as PID 1#731
phnzb merged 4 commits intonzbgetcom:developfrom
calvinbui:develop

Conversation

@calvinbui
Copy link
Copy Markdown
Contributor

Description

Replace su -p -c with exec su-exec when running as root, and add exec when running as non-root user.

Without exec, the shell script remains as PID 1 and nzbget runs as a child process. This means Docker's stop signal (SIGTERM) are sent to the shell, not nzbget, preventing graceful shutdown. SIGKILL is sent when the SIGTERM times out.

Using exec replaces the shell process with nzbget, making it PID 1.

There are also small improvements in the Dockerfile:

Lib changes

N/A

Testing

I built and ran the image. When I restarted/stopped it and saw [INFO] Stopping, please wait... in the logs.

I performed the same test with ghcr.io/nzbgetcom/nzbget:v26.0 and the log message didn't appear.

@dnzbk dnzbk requested review from dnzbk and phnzb February 5, 2026 13:16
@phnzb
Copy link
Copy Markdown
Collaborator

phnzb commented Feb 6, 2026

@calvinbui Thank you for the contribution. Tested on Ubuntu 24.04.3 LTS and Docker 28.3.3; no issues found. Merged into develop.

@phnzb phnzb merged commit 1ad70a2 into nzbgetcom:develop Feb 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants