    // 2. Save configuration to the configuration file
    // Truncate file first
    if (::ftruncate(m_writeFd, 0) != 0) {
        return false;
    }

    int written = ::write(m_writeFd, str.data(), str.size());
    if (written < 0) {
        return false;