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

add RestartMode=direct #740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spalfs
Copy link

@spalfs spalfs commented Oct 5, 2024

i've noticed when my clightning crashes, services that have it as a dependency (clightning-rest, rtl) will be deactived without restarting:
2024-10-05-210614_1280x1024_scrot
if we set RestartMode="direct", it should restart the services along with the parent:
https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#RestartMode=
i just started testing this on my server, will report back once clightning crashes again (in a day or two) to see if I have the expected result
would we want this on all dependency services?
these are the only two i am using and can test.

@spalfs
Copy link
Author

spalfs commented Oct 10, 2024

yup, looks to work:
2024-10-10-085611_1280x1024_scrot

Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @spalfs. Thanks for the PR.

Sigh... how can it be so hard to make systemd behave reasonably. It's not like we're doing anything out of the ordinary...

If clightning crashes, then the dependent services are restarted correctly. This can be tested by sending SIGKILL or some other signal to the lightningd process.

The problem appears to be that the dependent services are "shut down" when clightning fails to start up due to the ExecPostStart script timing out. When clightning successfully restarts after that failure, then contrary to expectation, the dependent services are not restarted as well.

I haven't managed to reproduce this, but I would like to, because we have other services that may fail in a similar way. The docs of RestartMode don't seem to indicate to me that this is the right way to solve this.

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