Closed 4quarks closed 1 month ago
My proposal
Add global settings to enable PID file creation.
global:
pid-file: "/path/to/your/pidfile.pid"
By default, this setting will be empty. If the pid-file
parameter is configured, the program will create a PID file.
This sounds perfect for us. Thanks!
feature implemented in master branch
The issue seems to be resolved. Thanks for your quick action!
Implement PID File for go-dnscollector to Enable SIGHUP Configuration Reload
Description: Now that SIGHUP is implemented on the go-dnscollector side (see), we (pDNSSOC) need to integrate this functionality for configuration reload without restarting the process. This will allow us to make changes on-the-fly, such as reading updated files, by sending a SIGHUP signal to the process without having to restart the process manually.
Background: It became common practice for daemonized processes to use SIGHUP for configuration reload. This allows changes to be made without terminating the process.
Current Implementation Steps:
Challenge: The PID changes every time the process restarts, which makes it difficult to automate this with a static command.
Proposed Solution: Implement a PID file in go-dnscollector that stores the current PID of the running process. This PID file will be created on startup and can be referenced to send the SIGHUP signal.
Benefits:
Additional Notes:
References:
Action Items: