def _manage_pid_file(self, operation: str):
        """Manage PID file operations (read/write/cleanup)."""
        try:
            if operation == "write" and self._process and self._process.pid:
                with open(self._pid_file, 'w') as f:
                    f.write(str(self._process.pid))
            elif operation == "read" and os.path.exists(self._pid_file):
                with open(self._pid_file, 'r') as f:
                    return int(f.read().strip())
            elif operation == "cleanup" and os.path.exists(self._pid_file):
                os.remove(self._pid_file)
        except Exception:
            pass
        
        return None if operation == "read" else False
Manage PID file operations (read/write/cleanup).
src/upsonic/server_manager.py