{
    "mode": "man",
    "parameter": "finalrd",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/finalrd/1/json",
    "generated": "2026-06-16T01:00:33Z",
    "synopsis": "systemctl enable --now finalrd.service",
    "sections": {
        "NAME": {
            "content": "finalrd - final runtime directory generator for shutdown\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "systemctl enable --now finalrd.service\n",
            "subsections": []
        },
        "HOOKS DIRECTORIES": {
            "content": "/usr/share/finalrd/*.finalrd\n/etc/finalrd/*.finalrd\n/run/finalrd/*.finalrd\n",
            "subsections": []
        },
        "HOOKS INTERFACE": {
            "content": "foo.finalrd setup\nfoo.finalrd halt|poweroff|reboot|kexec\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "finalrd generates a shutdown directory /run/initramfs which systemd-shutdown pivots to during\nshutdown. There system shutdown can be finalised and arbitrary hooks can be executed off-\nroot, to safely cleanup rootfs and perform any other shutdown tasks.\n\nFor example, a hook may takeover monitoring external metadata RAID arrays, wait for them to\nbe clean, and stop them. If one is using iscsiroot, it maybe needed to perform iscsi logout\non shutdown.\n\nTypically, one would not run finalrd directly, but instead activate finalrd.service. This\nwould execute finalrd generator late in the shutdown cycle, just in time for pivot.\n",
            "subsections": []
        },
        "HOOKLESS OPERATION": {
            "content": "If initramfs-tools is not available, and thus copyexec is not available, hooks will not be\nexecuted or copied into the shutdown directory. However, shutdown dir will still be created\nto ensure init has somewhere to pivot, and attempt a cleaner shutdown without holding up the\nroot filesystem.\n\nFor example, Ubuntu Core is such system.\n",
            "subsections": []
        },
        "HOOKS INTERFACE DESCRIPTION": {
            "content": "*.finalrd hooks can be shipped in /usr, /etc, /run. These directories are for distribution,\nsysadmin, and transient hooks respectively.\n\nThey are multi-purpose binaries with action passed as the first argument.\n\nDuring setup stage, hooks are executed from the rootfs with one argument setup passed as the\nfirst arg. All hooks are executed in all the directories in order, first everything in /usr,\nthen from /etc, then from /run. Environmental variables DESTDIR and DESTROOTDIR are set\npointing at the finalrd location. This is done for convenience to use initramfs-tools's\ncopyexec function or dracut-install, for copying binaries.\n\nDuring shutdown stage, hooks are executed from finalrd in parallel with one argument passed\nto them. The argument is one of halt, poweroff, reboot, kexec.\n\nNote if there are identically named hooks in multiple configuration directories, all of them\nwill be executed during setup stage. But only the last one will be copied into the finalrd\nand executed during the shutdown stage.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "The initrd Interface of systemd\n<https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface>\n\n\n\nfinalrd 2                                                                                 FINALRD(1)",
            "subsections": []
        }
    },
    "summary": "finalrd - final runtime directory generator for shutdown",
    "flags": [],
    "examples": [],
    "see_also": []
}