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

Handle SIGHUP #80

Open
Ppjet6 opened this issue Oct 26, 2018 · 4 comments
Open

Handle SIGHUP #80

Ppjet6 opened this issue Oct 26, 2018 · 4 comments

Comments

@Ppjet6
Copy link

Ppjet6 commented Oct 26, 2018

This is related to https://forum.restic.net/t/rest-server-crashes-or-exits-unexpectedly/1073/4

version: 0.9.7 or dfe9755 (master)

Steps to reproduce

  • Start rest-server
  • kill -HUP <pid>

What happens

rest-server exits.

What I expect

At least not to die, (ignoring the signal?). Reloading log files would be nice, and that seems to be the usual behaviour for this signal.

Some background, I discovered this because rest-server was unexpectedly dying, and logfiles would be empty. It appears that synology, the box we're running it on, generated a logrotate configuration for it and was killing it every so often. That wasn't fun.

I deactivated it for now, but handling SIGHUP would be nice. Rotating log files can be useful :)

@mholt
Copy link
Contributor

mholt commented Oct 26, 2018

Have you tried with nohup?

@Ppjet6
Copy link
Author

Ppjet6 commented Oct 29, 2018

Right. I have another workaround for the moment.

Can we repurpose this issue then to have SIGHUP handled entirely, (as in reopening fds etc.)

@mholt
Copy link
Contributor

mholt commented Oct 29, 2018

Sure, I think we can do that. So what behavior do you need for the log rotation to work? Just ignore HUP?

@Ppjet6
Copy link
Author

Ppjet6 commented Oct 29, 2018

No, for log rotation to work, we'd need to have rest-server reopen every fds it has open, so that logrotate can move/archive them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants