question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trap the sigterm during the stop of a container

See original GitHub issue

Hi,

I would like to know if with dumb-init it’s possible to trap the sigkill to be able to do something else during the stop of the container ?

I used keepalived and two process was created but the second one doesn’t have the pid 1 for parent so it’s not killed correctly.

root 7711 1 0 18:15 ? 00:00:00 keepalived -P xxx root 7714 7711 0 18:15 ? 00:00:00 keepalived -P xxx

Regards,

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ErwanAliasr1commented, Feb 9, 2021

@devTechi You can consider looking at the latest version of it if you like it : https://github.com/ceph/ceph-container/blob/master/src/daemon/docker_exec.sh

1reaction
ErwanAliasr1commented, Feb 9, 2021

@devTechi thanks for the feedback, glad it helped some

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trapping signals in Docker containers | by Grigorii Chudnov
One common signal is SIGTERM that tells the process to shut down and terminate. It could be used to close down sockets, database...
Read more >
Trapping Signals in Docker Containers | Cloudbees Blog
One common signal is SIGTERM, which tells the process to shut down and terminate. It could be used to close down sockets, database...
Read more >
Trap termination signal (SIGTERM) sent to the container ...
Cloud Run sends a SIGTERM signal to your container instance before the container instance terminates, due to an event like scale down or...
Read more >
trapping signal from "docker stop" in bash - Stack Overflow
The STOPSIGNAL sets the system call signal that will be sent to the container to exit. This signal can be a valid unsigned...
Read more >
Docker - Trapping Signals inside a Container
The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process ( ie. process...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found