Bug #7382
closed
When daemons run in parallel, pid files are generated with wrong PID in name
Added by Pavel Kácha over 3 years ago.
Updated over 2 years ago.
Category:
Development - Core
Description
Seems PID in filename does not correspond with PID in file.
- Assignee set to Rajmund Hruška
- Assignee changed from Rajmund Hruška to Jan Mach
- Status changed from New to Feedback
- To be discussed changed from No to Yes
I have investigated this and the reason is that the name of the PID file is determined before double detach from terminal, so the PID in the name refers to one of the parent process. Problem is with the daemonization library, it is written to be generally usable and knows nothing about the name generation, it expects name to be given. There are following possible solutions:
- We keep things as they are now. The PID is located inside the PID file, the number in the name is there just for the purpose of uniqueness. This was the original idea, it was never intended to be correct.
- We change the daemonizer to be more active in generating the PID file name. It will receive just the base name and it will append the correct PID and .pid extension to it. It will however become more opinionated and less testable. Unless there will be some kind of option to enforce the given static PID file name, it will stop being deterministic in tests.
The PID in the name of the file is there only to easily ensure the filename to be unique. However, it can be misleading for bystander (admin ). So let's make it hexa to strip its likeness to PID and mitigate the possibility of confusion?
- Target version changed from Backlog to 2.9
- To be discussed changed from Yes to No
- % Done changed from 0 to 90
- Status changed from Feedback to In Progress
- Status changed from In Progress to In Review
- % Done changed from 90 to 100
Deployed to mentat-alt for observation.
- Status changed from In Review to Closed
Also available in: Atom
PDF