Feature #2460
Why is charon.pid deleted before SA teardown is performed?
Description
In the main function of charon:
/* normal termination, cleanup and exit */
unlink_pidfile();
status = 0;
deinit:
libcharon_deinit();
library_deinit();
return status;
When charon tries to exit, it deletes charon.pid file and then do some cleanup.
It seems to make more sense to delete charon.pid afterwards, so that the existence of charon.pid better indicates whenter charon is still alive. Or else there seems no convenient to check the liveness of charon if not wanting to use ps or top.
History
#1 Updated by Tobias Brunner almost 8 years ago
- Status changed from New to Feedback
I guess we could do that later, but must ensure we don't delete the PID file if we didn't actually create it (e.g. if we abort due to an already existing PID file, or when called with --help
). I pushed a commit to the 2460-pidfile-unlink branch.
#2 Updated by c c almost 8 years ago
Why "abort due to an already existing PID file"?
To ensure that there is only one charon instance running? What if charon gets killed and the pid file remains?
#3 Updated by Tobias Brunner almost 8 years ago
To ensure that there is only one charon instance running?
Yes.
What if charon gets killed and the pid file remains?
source:src/charon/charon.c#L193
#4 Updated by Tobias Brunner almost 8 years ago
- Tracker changed from Issue to Feature
- Category set to charon
- Status changed from Feedback to Closed
- Assignee set to Tobias Brunner
- Target version set to 5.6.1
- Resolution set to Fixed