{
    "content": [
        {
            "type": "text",
            "text": "# systemd-sleep(8) (man)\n\n**Summary:** systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd- suspend-then-hibernate.service, systemd-sleep - System sleep state logic\n\n**Synopsis:** systemd-suspend.service\nsystemd-hibernate.service\nsystemd-hybrid-sleep.service\nsystemd-suspend-then-hibernate.service\n/lib/systemd/system-sleep\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -h | --help | — | Print a short help text and exit. |\n| — | --version | — | Print a short version string and exit. suspend, hibernate, suspend-then-hibernate, hybrid-sleep Suspend, hibernate, susp |\n\n## See Also\n\n- systemd-sleep.conf(5)\n- systemd(1)\n- systemctl(1)\n- systemd.special(7)\n- systemd-halt.service(8)\n\n## Section Outline\n\n- **NAME** (3 lines)\n- **SYNOPSIS** (10 lines)\n- **DESCRIPTION** (31 lines)\n- **OPTIONS** (2 lines) — 2 subsections\n  - -h --help (2 lines)\n  - --version (5 lines)\n- **SEE ALSO** (2 lines)\n- **NOTES** (6 lines)\n\n## Full Content\n\n### NAME\n\nsystemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-\nsuspend-then-hibernate.service, systemd-sleep - System sleep state logic\n\n### SYNOPSIS\n\nsystemd-suspend.service\n\nsystemd-hibernate.service\n\nsystemd-hybrid-sleep.service\n\nsystemd-suspend-then-hibernate.service\n\n/lib/systemd/system-sleep\n\n### DESCRIPTION\n\nsystemd-suspend.service is a system service that is pulled in by suspend.target and is\nresponsible for the actual system suspend. Similarly, systemd-hibernate.service is pulled in\nby hibernate.target to execute the actual hibernation. Finally, systemd-hybrid-sleep.service\nis pulled in by hybrid-sleep.target to execute hybrid hibernation with system suspend and\npulled in by suspend-then-hibernate.target to execute system suspend with a timeout that will\nactivate hibernate later.\n\nImmediately before entering system suspend and/or hibernation systemd-suspend.service (and\nthe other mentioned units, respectively) will run all executables in\n/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be \"pre\",\nthe second either \"suspend\", \"hibernate\", \"hybrid-sleep\", or \"suspend-then-hibernate\"\ndepending on the chosen action. An environment variable called \"SYSTEMDSLEEPACTION\" will be\nset and contain the sleep action that is processing. This is primarily helpful for\n\"suspend-then-hibernate\" where the value of the variable will be \"suspend\", \"hibernate\", or\n\"suspend-after-failed-hibernate\" in cases where hibernation has failed. Immediately after\nleaving system suspend and/or hibernation the same executables are run, but the first\nargument is now \"post\". All executables in this directory are executed in parallel, and\nexecution of the action is not continued until all executables have finished.\n\nNote that scripts or binaries dropped in /lib/systemd/system-sleep/ are intended for local\nuse only and should be considered hacks. If applications want to react to system\nsuspend/hibernation and resume, they should rather use the Inhibitor interface[1].\n\nNote that systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service,\nand systemd-suspend-then-hibernate.service should never be executed directly. Instead,\ntrigger system sleep with a command such as systemctl suspend or systemctl hibernate.\n\nInternally, this service will echo a string like \"mem\" into /sys/power/state, to trigger the\nactual system suspend. What exactly is written where can be configured in the [Sleep] section\nof /etc/systemd/sleep.conf or a sleep.conf.d file. See systemd-sleep.conf(5).\n\n### OPTIONS\n\nsystemd-sleep understands the following commands:\n\n#### -h --help\n\nPrint a short help text and exit.\n\n#### --version\n\nPrint a short version string and exit.\n\nsuspend, hibernate, suspend-then-hibernate, hybrid-sleep\nSuspend, hibernate, suspend then hibernate, or put the system to hybrid sleep.\n\n### SEE ALSO\n\nsystemd-sleep.conf(5), systemd(1), systemctl(1), systemd.special(7), systemd-halt.service(8)\n\n### NOTES\n\n1. Inhibitor interface\nhttps://www.freedesktop.org/wiki/Software/systemd/inhibit\n\n\n\nsystemd 249                                                               SYSTEMD-SUSPEND.SERVICE(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "systemd-sleep",
        "section": "8",
        "mode": "man",
        "summary": "systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd- suspend-then-hibernate.service, systemd-sleep - System sleep state logic",
        "synopsis": "systemd-suspend.service\nsystemd-hibernate.service\nsystemd-hybrid-sleep.service\nsystemd-suspend-then-hibernate.service\n/lib/systemd/system-sleep",
        "flags": [
            {
                "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. suspend, hibernate, suspend-then-hibernate, hybrid-sleep Suspend, hibernate, suspend then hibernate, or put the system to hybrid sleep."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "systemd-sleep.conf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-sleep.conf/5/json"
            },
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "systemctl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
            },
            {
                "name": "systemd.special",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.special/7/json"
            },
            {
                "name": "systemd-halt.service",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-halt.service/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "lines": 5,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}