{
    "content": [
        {
            "type": "text",
            "text": "# systemd.scope (man)\n\n## NAME\n\nsystemd.scope - Scope unit configuration\n\n## SYNOPSIS\n\nscope.scope\n\n## DESCRIPTION\n\nScope units are not configured via unit configuration files, but are only created\nprogrammatically using the bus interfaces of systemd. They are named similar to filenames. A\nunit whose name ends in \".scope\" refers to a scope unit. Scopes units manage a set of system\nprocesses. Unlike service units, scope units manage externally created processes, and do not\nfork off processes on its own.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **AUTOMATIC DEPENDENCIES** (2 subsections)\n- **OPTIONS**\n- **SEE ALSO**\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "systemd.scope",
        "section": "",
        "mode": "man",
        "summary": "systemd.scope - Scope unit configuration",
        "synopsis": "scope.scope",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "systemd-run",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-run/1/json"
            },
            {
                "name": "systemd.unit",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.unit/5/json"
            },
            {
                "name": "systemd.resource-control",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.resource-control/5/json"
            },
            {
                "name": "systemd.service",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.service/5/json"
            },
            {
                "name": "systemd.directives",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.directives/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "AUTOMATIC DEPENDENCIES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Implicit Dependencies",
                        "lines": 3
                    },
                    {
                        "name": "Default Dependencies",
                        "lines": 7
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 52,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "systemd.scope - Scope unit configuration\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "scope.scope\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Scope units are not configured via unit configuration files, but are only created\nprogrammatically using the bus interfaces of systemd. They are named similar to filenames. A\nunit whose name ends in \".scope\" refers to a scope unit. Scopes units manage a set of system\nprocesses. Unlike service units, scope units manage externally created processes, and do not\nfork off processes on its own.\n\nThe main purpose of scope units is grouping worker processes of a system service for\norganization and for managing resources.\n\nsystemd-run --scope may be used to easily launch a command in a new scope unit from the\ncommand line.\n\nSee the \u001b[34mNew Control Group Interfaces[1] for an introduction on how to make use of scope units\nfrom programs.\n\nNote that, unlike service units, scope units have no \"main\" process: all processes in the\nscope are equivalent. The lifecycle of the scope unit is thus not bound to the lifetime of\none specific process, but to the existence of at least one process in the scope. This also\nmeans that the exit statuses of these processes are not relevant for the scope unit failure\nstate. Scope units may still enter a failure state, for example due to resource exhaustion or\nstop timeouts being reached, but not due to programs inside of them terminating uncleanly.\nSince processes managed as scope units generally remain children of the original process that\nforked them off, it is also the job of that process to collect their exit statuses and act on\nthem as needed.\n",
                "subsections": []
            },
            "AUTOMATIC DEPENDENCIES": {
                "content": "",
                "subsections": [
                    {
                        "name": "Implicit Dependencies",
                        "content": "Implicit dependencies may be added as result of resource control parameters as documented in\nsystemd.resource-control(5).\n"
                    },
                    {
                        "name": "Default Dependencies",
                        "content": "The following dependencies are added unless DefaultDependencies=no is set:\n\n•   Scope units will automatically have dependencies of type Conflicts= and Before= on\nshutdown.target. These ensure that scope units are removed prior to system shutdown. Only\nscope units involved with early boot or late system shutdown should disable\nDefaultDependencies= option.\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "Scope files may include a [Unit] section, which is described in systemd.unit(5).\n\nScope files may include a [Scope] section, which carries information about the scope and the\nunits it contains. A number of options that may be used in this section are shared with other\nunit types. These options are documented in systemd.kill(5) and systemd.resource-control(5).\nThe options specific to the [Scope] section of scope units are the following:\n\nOOMPolicy=\nConfigure the out-of-memory (OOM) killing policy for the kernel and the userspace OOM\nkiller systemd-oomd.service(8). On Linux, when memory becomes scarce to the point that\nthe kernel has trouble allocating memory for itself, it might decide to kill a running\nprocess in order to free up memory and reduce memory pressure. Note that\nsystemd-oomd.service is a more flexible solution that aims to prevent out-of-memory\nsituations for the userspace too, not just the kernel, by attempting to terminate\nservices earlier, before the kernel would have to act.\n\nThis setting takes one of continue, stop or kill. If set to continue and a process in the\nunit is killed by the OOM killer, this is logged but the unit continues running. If set\nto stop the event is logged but the unit is terminated cleanly by the service manager. If\nset to kill and one of the unit's processes is killed by the OOM killer the kernel is\ninstructed to kill all remaining processes of the unit too, by setting the\nmemory.oom.group attribute to 1; also see kernel page \u001b[34mControl Group v2[2].\n\nDefaults to the setting DefaultOOMPolicy= in systemd-system.conf(5) is set to, except for\nunits where Delegate= is turned on, where it defaults to continue.\n\nUse the OOMScoreAdjust= setting to configure whether processes of the unit shall be\nconsidered preferred or less preferred candidates for process termination by the Linux\nOOM killer logic. See systemd.exec(5) for details.\n\nThis setting also applies to systemd-oomd.service(8). Similarly to the kernel OOM kills\nperformed by the kernel, this setting determines the state of the unit after systemd-oomd\nkills a cgroup associated with it.\n\nAdded in version 243.\n\nRuntimeMaxSec=\nConfigures a maximum time for the scope to run. If this is used and the scope has been\nactive for longer than the specified time it is terminated and put into a failure state.\nPass \"infinity\" (the default) to configure no runtime limit.\n\nAdded in version 244.\n\nRuntimeRandomizedExtraSec=\nThis option modifies RuntimeMaxSec= by increasing the maximum runtime by an evenly\ndistributed duration between 0 and the specified value (in seconds). If RuntimeMaxSec= is\nunspecified, then this feature will be disabled.\n\nAdded in version 250.\n\nCheck systemd.unit(5), systemd.exec(5), and systemd.kill(5) for more settings.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd(1), systemd-run(1), systemd.unit(5), systemd.resource-control(5), systemd.service(5),\nsystemd.directives(7).\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. New Control Group Interfaces\nhttps://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface\n\n2. Control Group v2\nhttps://docs.kernel.org/admin-guide/cgroup-v2.html\n\nsystemd 255                                                                         SYSTEMD.SCOPE(5)",
                "subsections": []
            }
        }
    }
}