{
    "content": [
        {
            "type": "text",
            "text": "# systemd-analyze (man)\n\n## NAME\n\nsystemd-analyze - Analyze and debug system manager\n\n## SYNOPSIS\n\nsystemd-analyze [OPTIONS...] [time]\nsystemd-analyze [OPTIONS...] blame\nsystemd-analyze [OPTIONS...] critical-chain [UNIT...]\nsystemd-analyze [OPTIONS...] dump\nsystemd-analyze [OPTIONS...] plot [>file.svg]\nsystemd-analyze [OPTIONS...] dot [PATTERN...] [>file.dot]\nsystemd-analyze [OPTIONS...] unit-paths\nsystemd-analyze [OPTIONS...] exit-status [STATUS...]\nsystemd-analyze [OPTIONS...] capability [CAPABILITY...]\nsystemd-analyze [OPTIONS...] condition CONDITION...\nsystemd-analyze [OPTIONS...] syscall-filter [SET...]\nsystemd-analyze [OPTIONS...] calendar SPEC...\nsystemd-analyze [OPTIONS...] timestamp TIMESTAMP...\nsystemd-analyze [OPTIONS...] timespan SPAN...\nsystemd-analyze [OPTIONS...] cat-config NAME|PATH...\nsystemd-analyze [OPTIONS...] verify [FILE...]\nsystemd-analyze [OPTIONS...] security UNIT...\n\n## DESCRIPTION\n\nsystemd-analyze may be used to determine system boot-up performance statistics and retrieve\nother state and tracing information from the system and service manager, and to verify the\ncorrectness of unit files. It is also used to access special functions useful for advanced\nsystem manager debugging.\n\n## TLDR\n\n> Analyze and debug system manager.\n\n- Print the last system startup time:\n  `systemd-analyze`\n- List all running units, ordered by the time they took to initialize:\n  `systemd-analyze blame`\n- Print a tree of the time-critical chain of bootup units:\n  `systemd-analyze critical-chain`\n- Create an SVG file showing when each system service started, highlighting the time that they spent on initialization:\n  `systemd-analyze plot > {{path/to/file.svg}}`\n- Plot a dependency graph and convert it to an SVG file:\n  `systemd-analyze dot | dot -T {{svg}} > {{path/to/file.svg}}`\n- Show security scores of running units:\n  `systemd-analyze security`\n- View all udev rules together without showing comments:\n  `systemd-analyze cat-config udev/rules.d --tldr`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (24 subsections)\n- **OPTIONS** (10 subsections)\n- **EXIT STATUS**\n- **ENVIRONMENT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "systemd-analyze",
        "section": "",
        "mode": "man",
        "summary": "systemd-analyze - Analyze and debug system manager",
        "synopsis": "systemd-analyze [OPTIONS...] [time]\nsystemd-analyze [OPTIONS...] blame\nsystemd-analyze [OPTIONS...] critical-chain [UNIT...]\nsystemd-analyze [OPTIONS...] dump\nsystemd-analyze [OPTIONS...] plot [>file.svg]\nsystemd-analyze [OPTIONS...] dot [PATTERN...] [>file.dot]\nsystemd-analyze [OPTIONS...] unit-paths\nsystemd-analyze [OPTIONS...] exit-status [STATUS...]\nsystemd-analyze [OPTIONS...] capability [CAPABILITY...]\nsystemd-analyze [OPTIONS...] condition CONDITION...\nsystemd-analyze [OPTIONS...] syscall-filter [SET...]\nsystemd-analyze [OPTIONS...] calendar SPEC...\nsystemd-analyze [OPTIONS...] timestamp TIMESTAMP...\nsystemd-analyze [OPTIONS...] timespan SPAN...\nsystemd-analyze [OPTIONS...] cat-config NAME|PATH...\nsystemd-analyze [OPTIONS...] verify [FILE...]\nsystemd-analyze [OPTIONS...] security UNIT...",
        "tldr_summary": "Analyze and debug system manager.",
        "tldr_examples": [
            {
                "description": "Print the last system startup time",
                "command": "systemd-analyze"
            },
            {
                "description": "List all running units, ordered by the time they took to initialize",
                "command": "systemd-analyze blame"
            },
            {
                "description": "Print a tree of the time-critical chain of bootup units",
                "command": "systemd-analyze critical-chain"
            },
            {
                "description": "Create an SVG file showing when each system service started, highlighting the time that they spent on initialization",
                "command": "systemd-analyze plot > {{path/to/file.svg}}"
            },
            {
                "description": "Plot a dependency graph and convert it to an SVG file",
                "command": "systemd-analyze dot | dot -T {{svg}} > {{path/to/file.svg}}"
            },
            {
                "description": "Show security scores of running units",
                "command": "systemd-analyze security"
            },
            {
                "description": "View all udev rules together without showing comments",
                "command": "systemd-analyze cat-config udev/rules.d --tldr"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--system",
                "arg": null,
                "description": "Operates on the system systemd instance. This is the implied default."
            },
            {
                "flag": "",
                "long": "--user",
                "arg": null,
                "description": "Operates on the user systemd instance."
            },
            {
                "flag": "",
                "long": "--global",
                "arg": null,
                "description": "Operates on the system-wide configuration for user systemd instance. --order, --require When used in conjunction with the dot command (see above), selects which dependencies are shown in the dependency graph. If --order is passed, only dependencies of type After= or Before= are shown. If --require is passed, only dependencies of type Requires=, Requisite=, Wants= and Conflicts= are shown. If neither is passed, this shows dependencies of all these types. --from-pattern=, --to-pattern= When used in conjunction with the dot command (see above), this selects which relationships are shown in the dependency graph. Both options require a glob(7) pattern as an argument, which will be matched against the left-hand and the right-hand, respectively, nodes of a relationship. Each of these can be used more than once, in which case the unit name must match one of the values. When tests for both sides of the relation are present, a relation must pass both tests to be shown. When patterns are also specified as positional arguments, they must match at least one side of the relation. In other words, patterns specified with those two options will trim the list of edges matched by the positional arguments, if any are given, and fully determine the list of edges shown otherwise. --fuzz=timespan When used in conjunction with the critical-chain command (see above), also show units, which finished timespan earlier, than the latest unit in the same level. The unit of timespan is seconds unless specified with a different unit, e.g. \"50ms\"."
            },
            {
                "flag": "",
                "long": "--man",
                "arg": "no",
                "description": "Do not invoke man(1) to verify the existence of man pages listed in Documentation=."
            },
            {
                "flag": "",
                "long": "--generators",
                "arg": null,
                "description": "Invoke unit generators, see systemd.generator(7). Some generators require root privileges. Under a normal user, running with generators enabled will generally result in some warnings. --root=PATH With cat-files, show config files underneath the specified root path PATH. --iterations=NUMBER When used with the calendar command, show the specified number of iterations the specified calendar expression will elapse next. Defaults to 1. --base-time=TIMESTAMP When used with the calendar command, show next iterations relative to the specified point in time. If not specified defaults to the current time."
            },
            {
                "flag": "-H",
                "long": null,
                "arg": null,
                "description": "Execute the operation remotely. Specify a hostname, or a username and hostname separated by \"@\", to connect to. The hostname may optionally be suffixed by a port ssh is listening on, separated by \":\", and then a container name, separated by \"/\", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST. Put IPv6 addresses in brackets."
            },
            {
                "flag": "-M",
                "long": null,
                "arg": null,
                "description": "Execute operation on a local container. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating \"@\" character. If the special string \".host\" is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user's user bus: \"--user --machine=lennart@.host\"). If the \"@\" syntax is not used, the connection is made as root user. If the \"@\" syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and \".host\" are implied."
            },
            {
                "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."
            },
            {
                "flag": "",
                "long": "--no-pager",
                "arg": null,
                "description": "Do not pipe output into a pager."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "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-ANALYZE",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/SYSTEMD-ANALYZE/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 34,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "systemd-analyze time",
                        "lines": 6
                    },
                    {
                        "name": "Example 1. Show how long the boot took",
                        "lines": 10
                    },
                    {
                        "name": "systemd-analyze blame",
                        "lines": 13
                    },
                    {
                        "name": "Example 2. Show which units took the most time during boot",
                        "lines": 21
                    },
                    {
                        "name": "Example 3. systemd-analyze critical-chain",
                        "lines": 14
                    },
                    {
                        "name": "systemd-analyze dump",
                        "lines": 4
                    },
                    {
                        "name": "Example 4. Show the internal state of user manager",
                        "lines": 14
                    },
                    {
                        "name": "systemd-analyze plot",
                        "lines": 3
                    },
                    {
                        "name": "Example 5. Plot a bootchart",
                        "lines": 6
                    },
                    {
                        "name": "-Tsvg --order --require",
                        "lines": 5,
                        "long": "--require"
                    },
                    {
                        "name": "Example 6. Plot all dependencies of any unit whose name starts with \"avahi-daemon\"",
                        "lines": 3
                    },
                    {
                        "name": "Example 7. Plot the dependencies between all known target units",
                        "lines": 4
                    },
                    {
                        "name": "systemd-analyze unit-paths",
                        "lines": 4
                    },
                    {
                        "name": "Example 8. Show all paths for generated units",
                        "lines": 22
                    },
                    {
                        "name": "Example 9. Show some example exit status names",
                        "lines": 16
                    },
                    {
                        "name": "Example 10. Show some example capability names",
                        "lines": 13
                    },
                    {
                        "name": "Example 11. Evaluate conditions that check kernel versions",
                        "lines": 25
                    },
                    {
                        "name": "Example 12. Show leap days in the near future",
                        "lines": 19
                    },
                    {
                        "name": "Example 13. Show parsing of timestamps",
                        "lines": 25
                    },
                    {
                        "name": "Example 14. Show parsing of timespans",
                        "lines": 20
                    },
                    {
                        "name": "Example 15. Showing logind configuration",
                        "lines": 34
                    },
                    {
                        "name": "Example 16. Misspelt directives",
                        "lines": 19
                    },
                    {
                        "name": "Example 17. Missing service units",
                        "lines": 45
                    },
                    {
                        "name": "Example 18. Analyze systemd-logind.service",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "--system",
                        "lines": 2,
                        "long": "--system"
                    },
                    {
                        "name": "--user",
                        "lines": 2,
                        "long": "--user"
                    },
                    {
                        "name": "--global",
                        "lines": 27,
                        "long": "--global"
                    },
                    {
                        "name": "--man=no",
                        "lines": 2,
                        "long": "--man",
                        "arg": "no"
                    },
                    {
                        "name": "--generators",
                        "lines": 15,
                        "long": "--generators"
                    },
                    {
                        "name": "-H --host=",
                        "lines": 7,
                        "flag": "-H"
                    },
                    {
                        "name": "-M --machine=",
                        "lines": 8,
                        "flag": "-M"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    },
                    {
                        "name": "--no-pager",
                        "lines": 2,
                        "long": "--no-pager"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 105,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "systemd-analyze - Analyze and debug system manager\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "systemd-analyze [OPTIONS...] [time]\n\nsystemd-analyze [OPTIONS...] blame\n\nsystemd-analyze [OPTIONS...] critical-chain [UNIT...]\n\nsystemd-analyze [OPTIONS...] dump\n\nsystemd-analyze [OPTIONS...] plot [>file.svg]\n\nsystemd-analyze [OPTIONS...] dot [PATTERN...] [>file.dot]\n\nsystemd-analyze [OPTIONS...] unit-paths\n\nsystemd-analyze [OPTIONS...] exit-status [STATUS...]\n\nsystemd-analyze [OPTIONS...] capability [CAPABILITY...]\n\nsystemd-analyze [OPTIONS...] condition CONDITION...\n\nsystemd-analyze [OPTIONS...] syscall-filter [SET...]\n\nsystemd-analyze [OPTIONS...] calendar SPEC...\n\nsystemd-analyze [OPTIONS...] timestamp TIMESTAMP...\n\nsystemd-analyze [OPTIONS...] timespan SPAN...\n\nsystemd-analyze [OPTIONS...] cat-config NAME|PATH...\n\nsystemd-analyze [OPTIONS...] verify [FILE...]\n\nsystemd-analyze [OPTIONS...] security UNIT...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "systemd-analyze may be used to determine system boot-up performance statistics and retrieve\nother state and tracing information from the system and service manager, and to verify the\ncorrectness of unit files. It is also used to access special functions useful for advanced\nsystem manager debugging.\n\nIf no command is passed, systemd-analyze time is implied.\n",
                "subsections": [
                    {
                        "name": "systemd-analyze time",
                        "content": "This command prints the time spent in the kernel before userspace has been reached, the time\nspent in the initial RAM disk (initrd) before normal system userspace has been reached, and\nthe time normal system userspace took to initialize. Note that these measurements simply\nmeasure the time passed up to the point where all system services have been spawned, but not\nnecessarily until they fully finished initialization or the disk is idle.\n"
                    },
                    {
                        "name": "Example 1. Show how long the boot took",
                        "content": "# in a container\n$ systemd-analyze time\nStartup finished in 296ms (userspace)\nmulti-user.target reached after 275ms in userspace\n\n# on a real machine\n$ systemd-analyze time\nStartup finished in 2.584s (kernel) + 19.176s (initrd) + 47.847s (userspace) = 1min 9.608s\nmulti-user.target reached after 47.820s in userspace\n"
                    },
                    {
                        "name": "systemd-analyze blame",
                        "content": "This command prints a list of all running units, ordered by the time they took to initialize.\nThis information may be used to optimize boot-up times. Note that the output might be\nmisleading as the initialization of one service might be slow simply because it waits for the\ninitialization of another service to complete. Also note: systemd-analyze blame doesn't\ndisplay results for services with Type=simple, because systemd considers such services to be\nstarted immediately, hence no measurement of the initialization delays can be done. Also note\nthat this command only shows the time units took for starting up, it does not show how long\nunit jobs spent in the execution queue. In particular it shows the time units spent in\n\"activating\" state, which is not defined for units such as device units that transition\ndirectly from \"inactive\" to \"active\". This command hence gives an impression of the\nperformance of program code, but cannot accurately reflect latency introduced by waiting for\nhardware and similar events.\n"
                    },
                    {
                        "name": "Example 2. Show which units took the most time during boot",
                        "content": "$ systemd-analyze blame\n32.875s pmlogger.service\n20.905s systemd-networkd-wait-online.service\n13.299s dev-vda1.device\n...\n23ms sysroot.mount\n11ms initrd-udevadm-cleanup-db.service\n3ms sys-kernel-config.mount\n\n\nsystemd-analyze critical-chain [UNIT...]\nThis command prints a tree of the time-critical chain of units (for each of the specified\nUNITs or for the default target otherwise). The time after the unit is active or started is\nprinted after the \"@\" character. The time the unit takes to start is printed after the \"+\"\ncharacter. Note that the output might be misleading as the initialization of services might\ndepend on socket activation and because of the parallel execution of units. Also, similar to\nthe blame command, this only takes into account the time units spent in \"activating\" state,\nand hence does not cover units that never went through an \"activating\" state (such as device\nunits that transition directly from \"inactive\" to \"active\"). Moreover it does not show\ninformation on jobs (and in particular not jobs that timed out).\n"
                    },
                    {
                        "name": "Example 3. systemd-analyze critical-chain",
                        "content": "$ systemd-analyze critical-chain\nmulti-user.target @47.820s\n└─pmie.service @35.968s +548ms\n└─pmcd.service @33.715s +2.247s\n└─network-online.target @33.712s\n└─systemd-networkd-wait-online.service @12.804s +20.905s\n└─systemd-networkd.service @11.109s +1.690s\n└─systemd-udevd.service @9.201s +1.904s\n└─systemd-tmpfiles-setup-dev.service @7.306s +1.776s\n└─kmod-static-nodes.service @6.976s +177ms\n└─systemd-journald.socket\n└─system.slice\n└─-.slice\n"
                    },
                    {
                        "name": "systemd-analyze dump",
                        "content": "This command outputs a (usually very long) human-readable serialization of the complete\nserver state. Its format is subject to change without notice and should not be parsed by\napplications.\n"
                    },
                    {
                        "name": "Example 4. Show the internal state of user manager",
                        "content": "$ systemd-analyze --user dump\nTimestamp userspace: Thu 2019-03-14 23:28:07 CET\nTimestamp finish: Thu 2019-03-14 23:28:07 CET\nTimestamp generators-start: Thu 2019-03-14 23:28:07 CET\nTimestamp generators-finish: Thu 2019-03-14 23:28:07 CET\nTimestamp units-load-start: Thu 2019-03-14 23:28:07 CET\nTimestamp units-load-finish: Thu 2019-03-14 23:28:07 CET\n-> Unit proc-timerlist.mount:\nDescription: /proc/timerlist\n...\n-> Unit default.target:\nDescription: Main user target\n...\n"
                    },
                    {
                        "name": "systemd-analyze plot",
                        "content": "This command prints an SVG graphic detailing which system services have been started at what\ntime, highlighting the time they spent on initialization.\n"
                    },
                    {
                        "name": "Example 5. Plot a bootchart",
                        "content": "$ systemd-analyze plot >bootup.svg\n$ eog bootup.svg&\n\nsystemd-analyze dot [pattern...]\nThis command generates textual dependency graph description in dot format for further\nprocessing with the GraphViz dot(1) tool. Use a command line like systemd-analyze dot | dot"
                    },
                    {
                        "name": "-Tsvg --order --require",
                        "content": "passed, the generated graph will show both ordering and requirement dependencies. Optional\npattern globbing style specifications (e.g.  *.target) may be given at the end. A unit\ndependency is included in the graph if any of these patterns match either the origin or\ndestination node.\n",
                        "long": "--require"
                    },
                    {
                        "name": "Example 6. Plot all dependencies of any unit whose name starts with \"avahi-daemon\"",
                        "content": "$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg >avahi.svg\n$ eog avahi.svg\n"
                    },
                    {
                        "name": "Example 7. Plot the dependencies between all known target units",
                        "content": "$ systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' \\\n| dot -Tsvg >targets.svg\n$ eog targets.svg\n"
                    },
                    {
                        "name": "systemd-analyze unit-paths",
                        "content": "This command outputs a list of all directories from which unit files, .d overrides, and\n.wants, .requires symlinks may be loaded. Combine with --user to retrieve the list for the\nuser manager instance, and --global for the global configuration of user manager instances.\n"
                    },
                    {
                        "name": "Example 8. Show all paths for generated units",
                        "content": "$ systemd-analyze unit-paths | grep '^/run'\n/run/systemd/system.control\n/run/systemd/transient\n/run/systemd/generator.early\n/run/systemd/system\n/run/systemd/system.attached\n/run/systemd/generator\n/run/systemd/generator.late\n\nNote that this verb prints the list that is compiled into systemd-analyze itself, and does\nnot communicate with the running manager. Use\n\nsystemctl [--user] [--global] show -p UnitPath --value\n\nto retrieve the actual list that the manager uses, with any empty directories omitted.\n\nsystemd-analyze exit-status [STATUS...]\nThis command prints a list of exit statuses along with their \"class\", i.e. the source of the\ndefinition (one of \"glibc\", \"systemd\", \"LSB\", or \"BSD\"), see the Process Exit Codes section\nin systemd.exec(5). If no additional arguments are specified, all known statuses are shown.\nOtherwise, only the definitions for the specified codes are shown.\n"
                    },
                    {
                        "name": "Example 9. Show some example exit status names",
                        "content": "$ systemd-analyze exit-status 0 1 {63..65}\nNAME    STATUS CLASS\nSUCCESS 0      glibc\nFAILURE 1      glibc\n-       63     -\nUSAGE   64     BSD\nDATAERR 65     BSD\n\nsystemd-analyze capability [CAPABILITY...]\nThis command prints a list of Linux capabilities along with their numeric IDs. See\ncapabilities(7) for details. If no argument is specified the full list of capabilities known\nto the service manager and the kernel is shown. Capabilities defined by the kernel but not\nknown to the service manager are shown as \"cap???\". Optionally, if arguments are specified\nthey may refer to specific cabilities by name or numeric ID, in which case only the indicated\ncapabilities are shown in the table.\n"
                    },
                    {
                        "name": "Example 10. Show some example capability names",
                        "content": "$ systemd-analyze capability 0 1 {30..32}\nNAME              NUMBER\ncapchown              0\ncapdacoverride       1\ncapauditcontrol     30\ncapsetfcap           31\ncapmacoverride      32\n\nsystemd-analyze condition CONDITION...\nThis command will evaluate Condition*=...  and Assert*=...  assignments, and print their\nvalues, and the resulting value of the combined condition set. See systemd.unit(5) for a list\nof available conditions and asserts.\n"
                    },
                    {
                        "name": "Example 11. Evaluate conditions that check kernel versions",
                        "content": "$ systemd-analyze condition 'ConditionKernelVersion = ! <4.0' \\\n'ConditionKernelVersion = >=5.1' \\\n'ConditionACPower=|false' \\\n'ConditionArchitecture=|!arm' \\\n'AssertPathExists=/etc/os-release'\ntest.service: AssertPathExists=/etc/os-release succeeded.\nAsserts succeeded.\ntest.service: ConditionArchitecture=|!arm succeeded.\ntest.service: ConditionACPower=|false failed.\ntest.service: ConditionKernelVersion=>=5.1 succeeded.\ntest.service: ConditionKernelVersion=!<4.0 succeeded.\nConditions succeeded.\n\nsystemd-analyze syscall-filter [SET...]\nThis command will list system calls contained in the specified system call set SET, or all\nknown sets if no sets are specified. Argument SET must include the \"@\" prefix.\n\nsystemd-analyze calendar EXPRESSION...\nThis command will parse and normalize repetitive calendar time events, and will calculate\nwhen they elapse next. This takes the same input as the OnCalendar= setting in\nsystemd.timer(5), following the syntax described in systemd.time(7). By default, only the\nnext time the calendar expression will elapse is shown; use --iterations= to show the\nspecified number of next times the expression elapses. Each time the expression elapses forms\na timestamp, see the timestamp verb below.\n"
                    },
                    {
                        "name": "Example 12. Show leap days in the near future",
                        "content": "$ systemd-analyze calendar --iterations=5 '*-2-29 0:0:0'\nOriginal form: *-2-29 0:0:0\nNormalized form: *-02-29 00:00:00\nNext elapse: Sat 2020-02-29 00:00:00 UTC\nFrom now: 11 months 15 days left\nIter. #2: Thu 2024-02-29 00:00:00 UTC\nFrom now: 4 years 11 months left\nIter. #3: Tue 2028-02-29 00:00:00 UTC\nFrom now: 8 years 11 months left\nIter. #4: Sun 2032-02-29 00:00:00 UTC\nFrom now: 12 years 11 months left\nIter. #5: Fri 2036-02-29 00:00:00 UTC\nFrom now: 16 years 11 months left\n\nsystemd-analyze timestamp TIMESTAMP...\nThis command parses a timestamp (i.e. a single point in time) and outputs the normalized form\nand the difference between this timestamp and now. The timestamp should adhere to the syntax\ndocumented in systemd.time(7), section \"PARSING TIMESTAMPS\".\n"
                    },
                    {
                        "name": "Example 13. Show parsing of timestamps",
                        "content": "$ systemd-analyze timestamp yesterday now tomorrow\nOriginal form: yesterday\nNormalized form: Mon 2019-05-20 00:00:00 CEST\n(in UTC): Sun 2019-05-19 22:00:00 UTC\nUNIX seconds: @15583032000\nFrom now: 1 day 9h ago\n\nOriginal form: now\nNormalized form: Tue 2019-05-21 09:48:39 CEST\n(in UTC): Tue 2019-05-21 07:48:39 UTC\nUNIX seconds: @1558424919.659757\nFrom now: 43us ago\n\nOriginal form: tomorrow\nNormalized form: Wed 2019-05-22 00:00:00 CEST\n(in UTC): Tue 2019-05-21 22:00:00 UTC\nUNIX seconds: @15584760000\nFrom now: 14h left\n\nsystemd-analyze timespan EXPRESSION...\nThis command parses a time span (i.e. a difference between two timestamps) and outputs the\nnormalized form and the equivalent value in microseconds. The time span should adhere to the\nsyntax documented in systemd.time(7), section \"PARSING TIME SPANS\". Values without units are\nparsed as seconds.\n"
                    },
                    {
                        "name": "Example 14. Show parsing of timespans",
                        "content": "$ systemd-analyze timespan 1s 300s '1year 0.000001s'\nOriginal: 1s\nμs: 1000000\nHuman: 1s\n\nOriginal: 300s\nμs: 300000000\nHuman: 5min\n\nOriginal: 1year 0.000001s\nμs: 31557600000001\nHuman: 1y 1us\n\nsystemd-analyze cat-config NAME|PATH...\nThis command is similar to systemctl cat, but operates on config files. It will copy the\ncontents of a config file and any drop-ins to standard output, using the usual systemd set of\ndirectories and rules for precedence. Each argument must be either an absolute path including\nthe prefix (such as /etc/systemd/logind.conf or /usr/lib/systemd/logind.conf), or a name\nrelative to the prefix (such as systemd/logind.conf).\n"
                    },
                    {
                        "name": "Example 15. Showing logind configuration",
                        "content": "$ systemd-analyze cat-config systemd/logind.conf\n# /etc/systemd/logind.conf\n...\n[Login]\nNAutoVTs=8\n...\n\n# /usr/lib/systemd/logind.conf.d/20-test.conf\n... some override from another package\n\n# /etc/systemd/logind.conf.d/50-override.conf\n... some administrator override\n\n\nsystemd-analyze verify FILE...\nThis command will load unit files and print warnings if any errors are detected. Files\nspecified on the command line will be loaded, but also any other units referenced by them.\nThe full unit search path is formed by combining the directories for all command line\narguments, and the usual unit load paths. The variable $SYSTEMDUNITPATH is supported, and\nmay be used to replace or augment the compiled in set of unit load paths; see\nsystemd.unit(5). All units files present in the directories containing the command line\narguments will be used in preference to the other paths.\n\nThe following errors are currently detected:\n\n•   unknown sections and directives,\n\n•   missing dependencies which are required to start the given unit,\n\n•   man pages listed in Documentation= which are not found in the system,\n\n•   commands listed in ExecStart= and similar which are not found in the system or not\nexecutable.\n"
                    },
                    {
                        "name": "Example 16. Misspelt directives",
                        "content": "$ cat ./user.slice\n[Unit]\nWhatIsThis=11\nDocumentation=man:nosuchfile(1)\nRequires=different.service\n\n[Service]\nDescription=x\n\n$ systemd-analyze verify ./user.slice\n[./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'\n[./user.slice:13] Unknown section 'Service'. Ignoring.\nError: org.freedesktop.systemd1.LoadFailed:\nUnit different.service failed to load:\nNo such file or directory.\nFailed to create user.slice/start: Invalid argument\nuser.slice: man nosuchfile(1) command failed with code 16\n\n"
                    },
                    {
                        "name": "Example 17. Missing service units",
                        "content": "$ tail ./a.socket ./b.socket\n==> ./a.socket <==\n[Socket]\nListenStream=100\n\n==> ./b.socket <==\n[Socket]\nListenStream=100\nAccept=yes\n\n$ systemd-analyze verify ./a.socket ./b.socket\nService a.service not loaded, a.socket cannot be started.\nService b@0.service not loaded, b.socket cannot be started.\n\n\nsystemd-analyze security [UNIT...]\nThis command analyzes the security and sandboxing settings of one or more specified service\nunits. If at least one unit name is specified the security settings of the specified service\nunits are inspected and a detailed analysis is shown. If no unit name is specified, all\ncurrently loaded, long-running service units are inspected and a terse table with results\nshown. The command checks for various security-related service settings, assigning each a\nnumeric \"exposure level\" value, depending on how important a setting is. It then calculates\nan overall exposure level for the whole unit, which is an estimation in the range 0.0...10.0\nindicating how exposed a service is security-wise. High exposure levels indicate very little\napplied sandboxing. Low exposure levels indicate tight sandboxing and strongest security\nrestrictions. Note that this only analyzes the per-service security features systemd itself\nimplements. This means that any additional security mechanisms applied by the service code\nitself are not accounted for. The exposure level determined this way should not be\nmisunderstood: a high exposure level neither means that there is no effective sandboxing\napplied by the service code itself, nor that the service is actually vulnerable to remote or\nlocal attacks. High exposure levels do indicate however that most likely the service might\nbenefit from additional settings applied to them.\n\nPlease note that many of the security and sandboxing settings individually can be\ncircumvented — unless combined with others. For example, if a service retains the privilege\nto establish or undo mount points many of the sandboxing options can be undone by the service\ncode itself. Due to that is essential that each service uses the most comprehensive and\nstrict sandboxing and security settings possible. The tool will take into account some of\nthese combinations and relationships between the settings, but not all. Also note that the\nsecurity and sandboxing settings analyzed here only apply to the operations executed by the\nservice code itself. If a service has access to an IPC system (such as D-Bus) it might\nrequest operations from other services that are not subject to the same restrictions. Any\ncomprehensive security and sandboxing analysis is hence incomplete if the IPC access policy\nis not validated too.\n"
                    },
                    {
                        "name": "Example 18. Analyze systemd-logind.service",
                        "content": "$ systemd-analyze security --no-pager systemd-logind.service\nNAME                DESCRIPTION                              EXPOSURE\n✗ PrivateNetwork=     Service has access to the host's network      0.5\n✗ User=/DynamicUser=  Service runs as root user                     0.4\n✗ DeviceAllow=        Service has no device ACL                     0.2\n✓ IPAddressDeny=      Service blocks all IP address ranges\n...\n→ Overall exposure level for systemd-logind.service: 4.1 OK 🙂\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "The following options are understood:\n",
                "subsections": [
                    {
                        "name": "--system",
                        "content": "Operates on the system systemd instance. This is the implied default.\n",
                        "long": "--system"
                    },
                    {
                        "name": "--user",
                        "content": "Operates on the user systemd instance.\n",
                        "long": "--user"
                    },
                    {
                        "name": "--global",
                        "content": "Operates on the system-wide configuration for user systemd instance.\n\n--order, --require\nWhen used in conjunction with the dot command (see above), selects which dependencies are\nshown in the dependency graph. If --order is passed, only dependencies of type After= or\nBefore= are shown. If --require is passed, only dependencies of type Requires=,\nRequisite=, Wants= and Conflicts= are shown. If neither is passed, this shows\ndependencies of all these types.\n\n--from-pattern=, --to-pattern=\nWhen used in conjunction with the dot command (see above), this selects which\nrelationships are shown in the dependency graph. Both options require a glob(7) pattern\nas an argument, which will be matched against the left-hand and the right-hand,\nrespectively, nodes of a relationship.\n\nEach of these can be used more than once, in which case the unit name must match one of\nthe values. When tests for both sides of the relation are present, a relation must pass\nboth tests to be shown. When patterns are also specified as positional arguments, they\nmust match at least one side of the relation. In other words, patterns specified with\nthose two options will trim the list of edges matched by the positional arguments, if any\nare given, and fully determine the list of edges shown otherwise.\n\n--fuzz=timespan\nWhen used in conjunction with the critical-chain command (see above), also show units,\nwhich finished timespan earlier, than the latest unit in the same level. The unit of\ntimespan is seconds unless specified with a different unit, e.g. \"50ms\".\n",
                        "long": "--global"
                    },
                    {
                        "name": "--man=no",
                        "content": "Do not invoke man(1) to verify the existence of man pages listed in Documentation=.\n",
                        "long": "--man",
                        "arg": "no"
                    },
                    {
                        "name": "--generators",
                        "content": "Invoke unit generators, see systemd.generator(7). Some generators require root\nprivileges. Under a normal user, running with generators enabled will generally result in\nsome warnings.\n\n--root=PATH\nWith cat-files, show config files underneath the specified root path PATH.\n\n--iterations=NUMBER\nWhen used with the calendar command, show the specified number of iterations the\nspecified calendar expression will elapse next. Defaults to 1.\n\n--base-time=TIMESTAMP\nWhen used with the calendar command, show next iterations relative to the specified point\nin time. If not specified defaults to the current time.\n",
                        "long": "--generators"
                    },
                    {
                        "name": "-H --host=",
                        "content": "Execute the operation remotely. Specify a hostname, or a username and hostname separated\nby \"@\", to connect to. The hostname may optionally be suffixed by a port ssh is listening\non, separated by \":\", and then a container name, separated by \"/\", which connects\ndirectly to a specific container on the specified host. This will use SSH to talk to the\nremote machine manager instance. Container names may be enumerated with machinectl -H\nHOST. Put IPv6 addresses in brackets.\n",
                        "flag": "-H"
                    },
                    {
                        "name": "-M --machine=",
                        "content": "Execute operation on a local container. Specify a container name to connect to,\noptionally prefixed by a user name to connect as and a separating \"@\" character. If the\nspecial string \".host\" is used in place of the container name, a connection to the local\nsystem is made (which is useful to connect to a specific user's user bus: \"--user\n--machine=lennart@.host\"). If the \"@\" syntax is not used, the connection is made as root\nuser. If the \"@\" syntax is used either the left hand side or the right hand side may be\nomitted (but not both) in which case the local user name and \".host\" are implied.\n",
                        "flag": "-M"
                    },
                    {
                        "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"
                    },
                    {
                        "name": "--no-pager",
                        "content": "Do not pipe output into a pager.\n",
                        "long": "--no-pager"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "On success, 0 is returned, a non-zero failure code otherwise.\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "$SYSTEMDLOGLEVEL\nThe maximum log level of emitted messages (messages with a higher log level, i.e. less\nimportant ones, will be suppressed). Either one of (in order of decreasing importance)\nemerg, alert, crit, err, warning, notice, info, debug, or an integer in the range 0...7.\nSee syslog(3) for more information.\n\n$SYSTEMDLOGCOLOR\nA boolean. If true, messages written to the tty will be colored according to priority.\n\nThis setting is only useful when messages are written directly to the terminal, because\njournalctl(1) and other tools that display logs will color messages based on the log\nlevel on their own.\n\n$SYSTEMDLOGTIME\nA boolean. If true, console log messages will be prefixed with a timestamp.\n\nThis setting is only useful when messages are written directly to the terminal or a file,\nbecause journalctl(1) and other tools that display logs will attach timestamps based on\nthe entry metadata on their own.\n\n$SYSTEMDLOGLOCATION\nA boolean. If true, messages will be prefixed with a filename and line number in the\nsource code where the message originates.\n\nNote that the log location is often attached as metadata to journal entries anyway.\nIncluding it directly in the message text can nevertheless be convenient when debugging\nprograms.\n\n$SYSTEMDLOGTID\nA boolean. If true, messages will be prefixed with the current numerical thread ID (TID).\n\nNote that the this information is attached as metadata to journal entries anyway.\nIncluding it directly in the message text can nevertheless be convenient when debugging\nprograms.\n\n$SYSTEMDLOGTARGET\nThe destination for log messages. One of console (log to the attached tty),\nconsole-prefixed (log to the attached tty but with prefixes encoding the log level and\n\"facility\", see syslog(3), kmsg (log to the kernel circular log buffer), journal (log to\nthe journal), journal-or-kmsg (log to the journal if available, and to kmsg otherwise),\nauto (determine the appropriate log target automatically, the default), null (disable log\noutput).\n\n$SYSTEMDPAGER\nPager to use when --no-pager is not given; overrides $PAGER. If neither $SYSTEMDPAGER\nnor $PAGER are set, a set of well-known pager implementations are tried in turn,\nincluding less(1) and more(1), until one is found. If no pager implementation is\ndiscovered no pager is invoked. Setting this environment variable to an empty string or\nthe value \"cat\" is equivalent to passing --no-pager.\n\n$SYSTEMDLESS\nOverride the options passed to less (by default \"FRSXMK\").\n\nUsers might want to change two options in particular:\n\nK\nThis option instructs the pager to exit immediately when Ctrl+C is pressed. To allow\nless to handle Ctrl+C itself to switch back to the pager command prompt, unset this\noption.\n\nIf the value of $SYSTEMDLESS does not include \"K\", and the pager that is invoked is\nless, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.\n\nX\nThis option instructs the pager to not send termcap initialization and\ndeinitialization strings to the terminal. It is set by default to allow command\noutput to remain visible in the terminal even after the pager exits. Nevertheless,\nthis prevents some pager functionality from working, in particular paged output\ncannot be scrolled with the mouse.\n\nSee less(1) for more discussion.\n\n$SYSTEMDLESSCHARSET\nOverride the charset passed to less (by default \"utf-8\", if the invoking terminal is\ndetermined to be UTF-8 compatible).\n\n$SYSTEMDPAGERSECURE\nTakes a boolean argument. When true, the \"secure\" mode of the pager is enabled; if false,\ndisabled. If $SYSTEMDPAGERSECURE is not set at all, secure mode is enabled if the\neffective UID is not the same as the owner of the login session, see geteuid(2) and\nsdpidgetowneruid(3). In secure mode, LESSSECURE=1 will be set when invoking the\npager, and the pager shall disable commands that open or create new files or start new\nsubprocesses. When $SYSTEMDPAGERSECURE is not set at all, pagers which are not known to\nimplement secure mode will not be used. (Currently only less(1) implements secure mode.)\n\nNote: when commands are invoked with elevated privileges, for example under sudo(8) or\npkexec(1), care must be taken to ensure that unintended interactive features are not\nenabled. \"Secure\" mode for the pager may be enabled automatically as describe above.\nSetting SYSTEMDPAGERSECURE=0 or not removing it from the inherited environment allows\nthe user to invoke arbitrary commands. Note that if the $SYSTEMDPAGER or $PAGER\nvariables are to be honoured, $SYSTEMDPAGERSECURE must be set too. It might be\nreasonable to completely disable the pager using --no-pager instead.\n\n$SYSTEMDCOLORS\nTakes a boolean argument. When true, systemd and related utilities will use colors in\ntheir output, otherwise the output will be monochrome. Additionally, the variable can\ntake one of the following special values: \"16\", \"256\" to restrict the use of colors to\nthe base 16 or 256 ANSI colors, respectively. This can be specified to override the\nautomatic decision based on $TERM and what the console is connected to.\n\n$SYSTEMDURLIFY\nThe value must be a boolean. Controls whether clickable links should be generated in the\noutput for terminal emulators supporting this. This can be specified to override the\ndecision that systemd makes based on $TERM and other conditions.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd(1), systemctl(1)\n\n\n\nsystemd 249                                                                       SYSTEMD-ANALYZE(1)",
                "subsections": []
            }
        }
    }
}