Skip to content

[Bug]: stop_grace_period not honoured #987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hanjo opened this issue May 20, 2025 · 2 comments
Open

[Bug]: stop_grace_period not honoured #987

hanjo opened this issue May 20, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@hanjo
Copy link

hanjo commented May 20, 2025

Operating system

Debian GNU/Linux 12 (bookworm)

Description

Hi,

I noticed that my DSM complains about unclean shutdown whenever I stop it. To fix this, I tried to increase the timeout and set stop_grace_period: 5m in my compose file. However, the VM is getting killed after exactly 50 seconds, which I believe is the threshold hardcoded in power.sh.

Now I don't fully understand how these two values are interacting, but I captured the log file for reference below.

Is there any way to increase those 50 seconds to the 5 minutes I want?

Thanks!

Docker compose

stop_grace_period: 5m

Docker log

May 20 17:48:37 server c6dc96d5f0f6[7140]: ❯ Received SIGTERM signal, sending shutdown command...
May 20 17:48:37 server c6dc96d5f0f6[7140]: ❯ Virtual DSM is now ready to shutdown...

[...]

May 20 17:49:27 server c6dc96d5f0f6[7140]: ❯ ERROR: Shutdown timeout reached, aborting...
May 20 17:49:27 server c6dc96d5f0f6[7140]:
May 20 17:49:27 server c6dc96d5f0f6[7140]: ❯ ERROR: Forcefully terminating QEMU process, reason: 143...
May 20 17:49:27 server c6dc96d5f0f6[7140]:
May 20 17:49:27 server c6dc96d5f0f6[7140]: qemu-system-x86_64: terminating on signal 15 from pid 7 (bash)
May 20 17:49:29 server c6dc96d5f0f6[7140]:
May 20 17:49:29 server c6dc96d5f0f6[7140]: ❯ Shutdown completed!
May 20 17:49:34 server 8fcb86069ecc[7140]: ❯ Starting Virtual DSM for Docker v7.36...

[...]

Screenshots (optional)

No response

@hanjo hanjo added the bug Something isn't working label May 20, 2025
@xrh0905
Copy link
Contributor

xrh0905 commented Jun 5, 2025

Looks like a duplication of #439 to me.
The current version of power.sh indeed hard-coded a 50 second timeout on shutdown request. Maybe convert that into a ENV?

@hanjo
Copy link
Author

hanjo commented Jun 6, 2025

Not really a duplicate, but related, I agree. This parameter configurable through an environment variable would be a good solution, I think. Another option - or maybe in addition - but not sure if possible, would be to just make the script kill the process after stop_grace_period - 10s (or whatever), instead of the hardcoded 50s.

xrh0905 added a commit to xrh0905/virtual-dsm that referenced this issue Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants