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

PID file /var/run/inadyn.pid already exists, inadyn already running? should try to send 'kill -0' to figure out. #247

Closed
nihilus opened this issue May 3, 2019 · 6 comments

Comments

@nihilus
Copy link
Contributor

nihilus commented May 3, 2019

PID file /var/run/inadyn.pid already exists, inadyn already running? should try to send 'kill -0' to figure out if the PID is running or not. Especially if you have it running as an auto-restarted service this can be a problem if it segmentation faults due to hw or memory accesses.

@nihilus
Copy link
Contributor Author

nihilus commented May 4, 2019

In fact my run-script is designed to kill the process in the pidfile before restarting the inadyn daemon, so i killed it explicitly and found out this annoying behavior of not being able to restart correctly.

@nihilus
Copy link
Contributor Author

nihilus commented May 4, 2019

And yes, I've seen a wrongly mapped DMA controller trashing processes in-production.

@troglobit
Copy link
Owner

This seems to annoy you a lot more than other users. My obvious question is; how did you kill it? Inadyn cleans up its PID file if it receives SIGTERM. Sure, it could do all sorts of things to detect if the PID really is running, but how many other UNIX daemons do that, really? A kill -0 sure checks if there's someone at home, but is it really inadyn or some other process with the same PID?

And surely, if there's badly mapped DMA, I'm sure you don't expect all applications in your system to take that into consideration. Isn't it better to fix the DMA mapping?

If you care this much about this issue, create a pull request with a fix you consider appropriate and we can discuss it. For me personally, and the company I work for, this has never been a real world problem.

@nihilus
Copy link
Contributor Author

nihilus commented May 4, 2019

Well it would have been better to fix the DMA-mapping and it was fixed. But since I didn't have the documentation for the SoC I was pretty much unable to figure out why processes started to die spontaneously.

I killed it with a SIGKILL and accidentally with a SIGSEGV.

I could create a pull request; or I could let the run-script remove the pidfile. :) I guess the latter is to prefer.

Now I am stuck at figuring out why a custom user-agent doesn't work with no-ip and TLS whereas it works using curl.

@nihilus
Copy link
Contributor Author

nihilus commented May 4, 2019

And yes, we do run everything supervised from the inittab with 'runit' (set as 'respawn') since we don't want the OOM-killer to interfer and we don't want an OOM to restart the system.

@troglobit
Copy link
Owner

I hope 576ea71 was what you meant.

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

2 participants