import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
import {
  execAsync,
  init_execAsync
} from "./chunk-L2A6JPIQ.js";
import {
  diag,
  init_esm
} from "./chunk-MV6JXS2P.js";
import {
  __esm
} from "./chunk-KVSDPGUI.js";

// ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js
import { promises as fs } from "fs";
async function getMachineId() {
  try {
    const result = await fs.readFile("/etc/hostid", { encoding: "utf8" });
    return result.trim();
  } catch (e) {
    diag.debug(`error reading machine id: ${e}`);
  }
  try {
    const result = await execAsync("kenv -q smbios.system.uuid");
    return result.stdout.trim();
  } catch (e) {
    diag.debug(`error reading machine id: ${e}`);
  }
  return void 0;
}
var init_getMachineId_bsd = __esm({
  "../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js"() {
    init_execAsync();
    init_esm();
  }
});
init_getMachineId_bsd();
export {
  getMachineId
};
//# sourceMappingURL=getMachineId-bsd-ZJR2OQTA.js.map