{
    "content": [
        {
            "type": "text",
            "text": "# systemd-machine-id-setup (man)\n\n## NAME\n\nsystemd-machine-id-setup - Initialize the machine ID in /etc/machine-id\n\n## DESCRIPTION\n\nsystemd-machine-id-setup may be used by system installer tools to initialize the machine ID\nstored in /etc/machine-id at install time, with a provisioned or randomly generated ID. See\nmachine-id(5) for more information about this file.\n\n## TLDR\n\n> Initialize the machine ID stored in `/etc/machine-id` at install time with a provisioned or randomly generated ID.\n\n- Print the generated or committed machine ID:\n  `systemd-machine-id-setup --print`\n- Specify an image policy:\n  `systemd-machine-id-setup --image-policy {{your_policy}}`\n- Display the output as JSON:\n  `sudo systemd-machine-id-setup --json pretty`\n- Operate on a disk image instead of a directory tree:\n  `systemd-machine-id-setup --image /{{path/to/image}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **EXIT STATUS**\n- **SEE ALSO**\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "systemd-machine-id-setup",
        "section": "",
        "mode": "man",
        "summary": "systemd-machine-id-setup - Initialize the machine ID in /etc/machine-id",
        "synopsis": "",
        "tldr_summary": "Initialize the machine ID stored in `/etc/machine-id` at install time with a provisioned or randomly generated ID.",
        "tldr_examples": [
            {
                "description": "Print the generated or committed machine ID",
                "command": "systemd-machine-id-setup --print"
            },
            {
                "description": "Specify an image policy",
                "command": "systemd-machine-id-setup --image-policy {{your_policy}}"
            },
            {
                "description": "Display the output as JSON",
                "command": "sudo systemd-machine-id-setup --json pretty"
            },
            {
                "description": "Operate on a disk image instead of a directory tree",
                "command": "systemd-machine-id-setup --image /{{path/to/image}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--commit",
                "arg": null,
                "description": "Commit a transient machine ID to disk. This command may be used to convert a transient machine ID into a persistent one. A transient machine ID file is one that was bind mounted from a memory file system (usually \"tmpfs\") to /etc/machine-id during the early phase of the boot process. This may happen because /etc/ is initially read-only and was missing a valid machine ID file at that point. This command will execute no operation if /etc/machine-id is not mounted from a memory file system, or if /etc/ is read-only. The command will write the current transient machine ID to disk and unmount the /etc/machine-id mount point in a race-free manner to ensure that this file is always valid and accessible for other processes. This command is primarily used by the systemd-machine-id-commit.service(8) early boot service."
            },
            {
                "flag": "",
                "long": "--print",
                "arg": null,
                "description": "Print the machine ID generated or committed after the operation is complete."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Print a short help text and exit."
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Print a short version string and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "machine-id",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/machine-id/5/json"
            },
            {
                "name": "systemd-machine-id-commit.service",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-machine-id-commit.service/8/json"
            },
            {
                "name": "dbus-uuidgen",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/dbus-uuidgen/1/json"
            },
            {
                "name": "firstboot",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/firstboot/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "systemd-machine-id-setup",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 10,
                "subsections": [
                    {
                        "name": "--commit",
                        "lines": 14,
                        "long": "--commit"
                    },
                    {
                        "name": "--print",
                        "lines": 2,
                        "long": "--print"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "systemd-machine-id-setup - Initialize the machine ID in /etc/machine-id\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "systemd-machine-id-setup",
                        "content": ""
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "systemd-machine-id-setup may be used by system installer tools to initialize the machine ID\nstored in /etc/machine-id at install time, with a provisioned or randomly generated ID. See\nmachine-id(5) for more information about this file.\n\nIf the tool is invoked without the --commit switch, /etc/machine-id is initialized with a\nvalid, new machined ID if it is missing or empty. The new machine ID will be acquired in the\nfollowing fashion:\n\n1. If a valid D-Bus machine ID is already configured for the system, the D-Bus machine ID is\ncopied and used to initialize the machine ID in /etc/machine-id.\n\n2. If run inside a KVM virtual machine and a UUID is configured (via the -uuid option), this\nUUID is used to initialize the machine ID. The caller must ensure that the UUID passed is\nsufficiently unique and is different for every booted instance of the VM.\n\n3. Similarly, if run inside a Linux container environment and a UUID is configured for the\ncontainer, this is used to initialize the machine ID. For details, see the documentation\nof the Container Interface[1].\n\n4. Otherwise, a new ID is randomly generated.\n\nThe --commit switch may be used to commit a transient machined ID to disk, making it\npersistent. For details, see below.\n\nUse systemd-firstboot(1) to initialize the machine ID on mounted (but not booted) system\nimages.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The following options are understood:\n\n--root=path\nTakes a directory path as argument. All paths operated on will be prefixed with the given\nalternate root path, including the path for /etc/machine-id itself.\n\n--image=path\nTakes a path to a device node or regular file as argument. This is similar to --root= as\ndescribed above, but operates on a disk image instead of a directory tree.\n",
                "subsections": [
                    {
                        "name": "--commit",
                        "content": "Commit a transient machine ID to disk. This command may be used to convert a transient\nmachine ID into a persistent one. A transient machine ID file is one that was bind\nmounted from a memory file system (usually \"tmpfs\") to /etc/machine-id during the early\nphase of the boot process. This may happen because /etc/ is initially read-only and was\nmissing a valid machine ID file at that point.\n\nThis command will execute no operation if /etc/machine-id is not mounted from a memory\nfile system, or if /etc/ is read-only. The command will write the current transient\nmachine ID to disk and unmount the /etc/machine-id mount point in a race-free manner to\nensure that this file is always valid and accessible for other processes.\n\nThis command is primarily used by the systemd-machine-id-commit.service(8) early boot\nservice.\n",
                        "long": "--commit"
                    },
                    {
                        "name": "--print",
                        "content": "Print the machine ID generated or committed after the operation is complete.\n",
                        "long": "--print"
                    },
                    {
                        "name": "-h --help",
                        "content": "Print a short help text and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "content": "Print a short version string and exit.\n",
                        "long": "--version"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "On success, 0 is returned, a non-zero failure code otherwise.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd(1), machine-id(5), systemd-machine-id-commit.service(8), dbus-uuidgen(1), systemd-\nfirstboot(1)\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. Container Interface\nhttps://systemd.io/CONTAINERINTERFACE\n\n\n\nsystemd 249                                                              SYSTEMD-MACHINE-ID-SETUP(1)",
                "subsections": []
            }
        }
    }
}