Skip to content
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

systemctl does not tail logs anymore immediately after pid 1 receives SIGTERM #182

Open
dimikot opened this issue Oct 15, 2024 · 0 comments

Comments

@dimikot
Copy link

dimikot commented Oct 15, 2024

Some services have graceful shutdown mechanism, and they print to stdout while they drain. When pid 1 receives SIGTERM (docker container stops), systemctl sends signals to the services and waits until they die. The problem is that whatever the service prints to its stdout/stderr gets swallowed unfortunately.

I think it's because self.print_log_files() (aka read_log_files) is not called anymore after init_loop_until_stop() finishes.

INFO:systemctl:interrupted - exit init-loop
INFO:systemctl:init-loop SIGTERM
INFO:systemctl:system is stopping
INFO:systemctl: stop unit app.service => '/etc/systemd/system/app.service'
INFO:systemctl:no ExecStop => systemctl kill
INFO:systemctl:STATUS /run/app.service.status 11

<<<< I expect app's journal to be tailing here

INFO:systemctl:stop kill PID 73
INFO:systemctl:done kill PID 73 OK
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

No branches or pull requests

1 participant