Router instance liveliness marker for multi-instance detection.
This class periodically writes a timestamp to a "ping file" to
indicate that this router instance is alive and running. Other
router instances attempting to use the same configuration directory
can check this file to detect if another instance is already active.
Purpose:
- Prevent multiple router instances using same config
- Allow detection of active router instances
- Provide timestamp-based liveliness indication
- Support automatic cleanup on router shutdown
Behavior:
- Updates timestamp periodically while router is alive
- Deletes ping file when router shuts down
- Logs errors only once to prevent log spam
- Uses secure file writing for atomic updates
The ping file contains only the current timestamp in milliseconds
since epoch. Other instances can check the file age to determine
if the router is recently active or abandoned.