readLogCollectorPid function
Read the log collector PID from its PID file.
Implementation
int? readLogCollectorPid() {
final file = File(logCollectorPidFile);
if (!file.existsSync()) return null;
final content = file.readAsStringSync().trim();
return int.tryParse(content);
}