1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
|
'\" t
.TH "SYSTEMD" "1" "" "systemd 241" "systemd"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd, init \- systemd system and service manager
.SH "SYNOPSIS"
.HP \w'\fB/usr/lib/systemd/systemd\fR\ 'u
\fB/usr/lib/systemd/systemd\fR [OPTIONS...]
.HP \w'\fBinit\fR\ 'u
\fBinit\fR [OPTIONS...] {COMMAND}
.SH "DESCRIPTION"
.PP
systemd is a system and service manager for Linux operating systems\&. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services\&.
.PP
For compatibility with SysV, if systemd is called as
\fBinit\fR
and a PID that is not 1, it will execute
\fBtelinit\fR
and pass all command line arguments unmodified\&. That means
\fBinit\fR
and
\fBtelinit\fR
are mostly equivalent when invoked from normal login sessions\&. See
\fBtelinit\fR(8)
for more information\&.
.PP
When run as a system instance, systemd interprets the configuration file
system\&.conf
and the files in
system\&.conf\&.d
directories; when run as a user instance, systemd interprets the configuration file
user\&.conf
and the files in
user\&.conf\&.d
directories\&. See
\fBsystemd-system.conf\fR(5)
for more information\&.
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-\-test\fR
.RS 4
Determine startup sequence, dump it and exit\&. This is an option useful for debugging only\&.
.RE
.PP
\fB\-\-dump\-configuration\-items\fR
.RS 4
Dump understood unit configuration items\&. This outputs a terse but complete list of configuration items understood in unit definition files\&.
.RE
.PP
\fB\-\-dump\-bus\-properties\fR
.RS 4
Dump exposed bus properties\&. This outputs a terse but complete list of properties exposed to dbus\&.
.RE
.PP
\fB\-\-unit=\fR
.RS 4
Set default unit to activate on startup\&. If not specified, defaults to
default\&.target\&.
.RE
.PP
\fB\-\-system\fR, \fB\-\-user\fR
.RS 4
For
\fB\-\-system\fR, tell systemd to run a system instance, even if the process ID is not 1, i\&.e\&. systemd is not run as init process\&.
\fB\-\-user\fR
does the opposite, running a user instance even if the process ID is 1\&. Normally, it should not be necessary to pass these options, as systemd automatically detects the mode it is started in\&. These options are hence of little use except for debugging\&. Note that it is not supported booting and maintaining a full system with systemd running in
\fB\-\-system\fR
mode, but PID not 1\&. In practice, passing
\fB\-\-system\fR
explicitly is only useful in conjunction with
\fB\-\-test\fR\&.
.RE
.PP
\fB\-\-dump\-core\fR
.RS 4
Enable core dumping on crash\&. This switch has no effect when running as user instance\&. This setting may also be enabled during boot on the kernel command line via the
\fIsystemd\&.dump_core=\fR
option, see below\&.
.RE
.PP
\fB\-\-crash\-vt=\fR\fIVT\fR
.RS 4
Switch to a specific virtual console (VT) on crash\&. Takes a positive integer in the range 1\(en63, or a boolean argument\&. If an integer is passed, selects which VT to switch to\&. If
\fByes\fR, the VT kernel messages are written to is selected\&. If
\fBno\fR, no VT switch is attempted\&. This switch has no effect when running as user instance\&. This setting may also be enabled during boot, on the kernel command line via the
\fIsystemd\&.crash_vt=\fR
option, see
below\&.
.RE
.PP
\fB\-\-crash\-shell\fR
.RS 4
Run a shell on crash\&. This switch has no effect when running as user instance\&. This setting may also be enabled during boot, on the kernel command line via the
\fIsystemd\&.crash_shell=\fR
option, see below\&.
.RE
.PP
\fB\-\-crash\-reboot\fR
.RS 4
Automatically reboot the system on crash\&. This switch has no effect when running as user instance\&. This setting may also be enabled during boot, on the kernel command line via the
\fIsystemd\&.crash_reboot=\fR
option, see below\&.
.RE
.PP
\fB\-\-confirm\-spawn\fR
.RS 4
Ask for confirmation when spawning processes\&. This switch has no effect when run as user instance\&.
.RE
.PP
\fB\-\-show\-status=\fR
.RS 4
Takes a boolean argument or the special value
\fBauto\fR\&. If on, terse unit status information is shown on the console during boot\-up and shutdown\&. If off, no such status information is shown\&. If set to
\fBauto\fR
behavior is similar to off, except that it is automatically switched to on, as soon as the first unit failure or significant boot delay is encountered\&. This switch has no effect when invoked as user instance\&. If specified, overrides both the kernel command line setting
\fIsystemd\&.show_status=\fR
(see below) and the configuration file option
\fBShowStatus=\fR, see
\fBsystemd-system.conf\fR(5)\&.
.RE
.PP
\fB\-\-log\-target=\fR
.RS 4
Set log target\&. Argument must be one of
\fBconsole\fR,
\fBjournal\fR,
\fBkmsg\fR,
\fBjournal\-or\-kmsg\fR,
\fBnull\fR\&.
.RE
.PP
\fB\-\-log\-level=\fR
.RS 4
Set log level\&. As argument this accepts a numerical log level or the well\-known
\fBsyslog\fR(3)
symbolic names (lowercase):
\fBemerg\fR,
\fBalert\fR,
\fBcrit\fR,
\fBerr\fR,
\fBwarning\fR,
\fBnotice\fR,
\fBinfo\fR,
\fBdebug\fR\&.
.RE
.PP
\fB\-\-log\-color=\fR
.RS 4
Highlight important log messages\&. Argument is a boolean value\&. If the argument is omitted, it defaults to
\fBtrue\fR\&.
.RE
.PP
\fB\-\-log\-location=\fR
.RS 4
Include code location in log messages\&. This is mostly relevant for debugging purposes\&. Argument is a boolean value\&. If the argument is omitted it defaults to
\fBtrue\fR\&.
.RE
.PP
\fB\-\-default\-standard\-output=\fR, \fB\-\-default\-standard\-error=\fR
.RS 4
Sets the default output or error output for all services and sockets, respectively\&. That is, controls the default for
\fBStandardOutput=\fR
and
\fBStandardError=\fR
(see
\fBsystemd.exec\fR(5)
for details)\&. Takes one of
\fBinherit\fR,
\fBnull\fR,
\fBtty\fR,
\fBjournal\fR,
\fBjournal+console\fR,
\fBsyslog\fR,
\fBsyslog+console\fR,
\fBkmsg\fR,
\fBkmsg+console\fR\&. If the argument is omitted
\fB\-\-default\-standard\-output=\fR
defaults to
\fBjournal\fR
and
\fB\-\-default\-standard\-error=\fR
to
\fBinherit\fR\&.
.RE
.PP
\fB\-\-machine\-id=\fR
.RS 4
Override the machine\-id set on the hard drive, useful for network booting or for containers\&. May not be set to all zeros\&.
.RE
.PP
\fB\-\-service\-watchdogs=\fR
.RS 4
Globally enable/disable all service watchdog timeouts and emergency actions\&. This setting may also be specified during boot, on the kernel command line via the
\fIsystemd\&.service_watchdogs=\fR
option, see below\&. Defaults to enabled\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "CONCEPTS"
.PP
systemd provides a dependency system between various entities called "units" of 11 different types\&. Units encapsulate various objects that are relevant for system boot\-up and maintenance\&. The majority of units are configured in unit configuration files, whose syntax and basic set of options is described in
\fBsystemd.unit\fR(5), however some are created automatically from other configuration, dynamically from system state or programmatically at runtime\&. Units may be "active" (meaning started, bound, plugged in, \&..., depending on the unit type, see below), or "inactive" (meaning stopped, unbound, unplugged, \&...), as well as in the process of being activated or deactivated, i\&.e\&. between the two states (these states are called "activating", "deactivating")\&. A special "failed" state is available as well, which is very similar to "inactive" and is entered when the service failed in some way (process returned error code on exit, or crashed, an operation timed out, or after too many restarts)\&. If this state is entered, the cause will be logged, for later reference\&. Note that the various unit types may have a number of additional substates, which are mapped to the five generalized unit states described here\&.
.PP
The following unit types are available:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
Service units, which start and control daemons and the processes they consist of\&. For details, see
\fBsystemd.service\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
Socket units, which encapsulate local IPC or network sockets in the system, useful for socket\-based activation\&. For details about socket units, see
\fBsystemd.socket\fR(5), for details on socket\-based activation and other forms of activation, see
\fBdaemon\fR(7)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
Target units are useful to group units, or provide well\-known synchronization points during boot\-up, see
\fBsystemd.target\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
Device units expose kernel devices in systemd and may be used to implement device\-based activation\&. For details, see
\fBsystemd.device\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 5.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 5." 4.2
.\}
Mount units control mount points in the file system, for details see
\fBsystemd.mount\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 6.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 6." 4.2
.\}
Automount units provide automount capabilities, for on\-demand mounting of file systems as well as parallelized boot\-up\&. See
\fBsystemd.automount\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 7.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 7." 4.2
.\}
Timer units are useful for triggering activation of other units based on timers\&. You may find details in
\fBsystemd.timer\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 8.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 8." 4.2
.\}
Swap units are very similar to mount units and encapsulate memory swap partitions or files of the operating system\&. They are described in
\fBsystemd.swap\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 9.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 9." 4.2
.\}
Path units may be used to activate other services when file system objects change or are modified\&. See
\fBsystemd.path\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'10.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "10." 4.2
.\}
Slice units may be used to group units which manage system processes (such as service and scope units) in a hierarchical tree for resource management purposes\&. See
\fBsystemd.slice\fR(5)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'11.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "11." 4.2
.\}
Scope units are similar to service units, but manage foreign processes instead of starting them as well\&. See
\fBsystemd.scope\fR(5)\&.
.RE
.PP
Units are named as their configuration files\&. Some units have special semantics\&. A detailed list is available in
\fBsystemd.special\fR(7)\&.
.PP
systemd knows various kinds of dependencies, including positive and negative requirement dependencies (i\&.e\&.
\fIRequires=\fR
and
\fIConflicts=\fR) as well as ordering dependencies (\fIAfter=\fR
and
\fIBefore=\fR)\&. NB: ordering and requirement dependencies are orthogonal\&. If only a requirement dependency exists between two units (e\&.g\&.
foo\&.service
requires
bar\&.service), but no ordering dependency (e\&.g\&.
foo\&.service
after
bar\&.service) and both are requested to start, they will be started in parallel\&. It is a common pattern that both requirement and ordering dependencies are placed between two units\&. Also note that the majority of dependencies are implicitly created and maintained by systemd\&. In most cases, it should be unnecessary to declare additional dependencies manually, however it is possible to do this\&.
.PP
Application programs and units (via dependencies) may request state changes of units\&. In systemd, these requests are encapsulated as \*(Aqjobs\*(Aq and maintained in a job queue\&. Jobs may succeed or can fail, their execution is ordered based on the ordering dependencies of the units they have been scheduled for\&.
.PP
On boot systemd activates the target unit
default\&.target
whose job is to activate on\-boot services and other on\-boot units by pulling them in via dependencies\&. Usually, the unit name is just an alias (symlink) for either
graphical\&.target
(for fully\-featured boots into the UI) or
multi\-user\&.target
(for limited console\-only boots for use in embedded or server environments, or similar; a subset of graphical\&.target)\&. However, it is at the discretion of the administrator to configure it as an alias to any other target unit\&. See
\fBsystemd.special\fR(7)
for details about these target units\&.
.PP
systemd only keeps a minimal set of units loaded into memory\&. Specifically, the only units that are kept loaded into memory are those for which at least one of the following conditions is true:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
It is in an active, activating, deactivating or failed state (i\&.e\&. in any unit state except for
"inactive")
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
It has a job queued for it
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
It is a dependency of some sort of at least one other unit that is loaded into memory
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
It has some form of resource still allocated (e\&.g\&. a service unit that is inactive but for which a process is still lingering that ignored the request to be terminated)
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 5.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 5." 4.2
.\}
It has been pinned into memory programmatically by a D\-Bus call
.RE
.PP
systemd will automatically and implicitly load units from disk \(em if they are not loaded yet \(em as soon as operations are requested for them\&. Thus, in many respects, the fact whether a unit is loaded or not is invisible to clients\&. Use
\fBsystemctl list\-units \-\-all\fR
to comprehensively list all units currently loaded\&. Any unit for which none of the conditions above applies is promptly unloaded\&. Note that when a unit is unloaded from memory its accounting data is flushed out too\&. However, this data is generally not lost, as a journal log record is generated declaring the consumed resources whenever a unit shuts down\&.
.PP
Processes systemd spawns are placed in individual Linux control groups named after the unit which they belong to in the private systemd hierarchy\&. (see
\m[blue]\fBcgroups\&.txt\fR\m[]\&\s-2\u[1]\d\s+2
for more information about control groups, or short "cgroups")\&. systemd uses this to effectively keep track of processes\&. Control group information is maintained in the kernel, and is accessible via the file system hierarchy (beneath
/sys/fs/cgroup/systemd/), or in tools such as
\fBsystemd-cgls\fR(1)
or
\fBps\fR(1)
(\fBps xawf \-eo pid,user,cgroup,args\fR
is particularly useful to list all processes and the systemd units they belong to\&.)\&.
.PP
systemd is compatible with the SysV init system to a large degree: SysV init scripts are supported and simply read as an alternative (though limited) configuration file format\&. The SysV
/dev/initctl
interface is provided, and compatibility implementations of the various SysV client tools are available\&. In addition to that, various established Unix functionality such as
/etc/fstab
or the
utmp
database are supported\&.
.PP
systemd has a minimal transaction system: if a unit is requested to start up or shut down it will add it and all its dependencies to a temporary transaction\&. Then, it will verify if the transaction is consistent (i\&.e\&. whether the ordering of all units is cycle\-free)\&. If it is not, systemd will try to fix it up, and removes non\-essential jobs from the transaction that might remove the loop\&. Also, systemd tries to suppress non\-essential jobs in the transaction that would stop a running service\&. Finally it is checked whether the jobs of the transaction contradict jobs that have already been queued, and optionally the transaction is aborted then\&. If all worked out and the transaction is consistent and minimized in its impact it is merged with all already outstanding jobs and added to the run queue\&. Effectively this means that before executing a requested operation, systemd will verify that it makes sense, fixing it if possible, and only failing if it really cannot work\&.
.PP
Note that transactions are generated independently of a unit\*(Aqs state at runtime, hence, for example, if a start job is requested on an already started unit, it will still generate a transaction and wake up any inactive dependencies (and cause propagation of other jobs as per the defined relationships)\&. This is because the enqueued job is at the time of execution compared to the target unit\*(Aqs state and is marked successful and complete when both satisfy\&. However, this job also pulls in other dependencies due to the defined relationships and thus leads to, in our our example, start jobs for any of those inactive units getting queued as well\&.
.PP
systemd contains native implementations of various tasks that need to be executed as part of the boot process\&. For example, it sets the hostname or configures the loopback network device\&. It also sets up and mounts various API file systems, such as
/sys
or
/proc\&.
.PP
For more information about the concepts and ideas behind systemd, please refer to the
\m[blue]\fBOriginal Design Document\fR\m[]\&\s-2\u[2]\d\s+2\&.
.PP
Note that some but not all interfaces provided by systemd are covered by the
\m[blue]\fBInterface Stability Promise\fR\m[]\&\s-2\u[3]\d\s+2\&.
.PP
Units may be generated dynamically at boot and system manager reload time, for example based on other configuration files or parameters passed on the kernel command line\&. For details, see
\fBsystemd.generator\fR(7)\&.
.PP
Systems which invoke systemd in a container or initrd environment should implement the
\m[blue]\fBContainer Interface\fR\m[]\&\s-2\u[4]\d\s+2
or
\m[blue]\fBinitrd Interface\fR\m[]\&\s-2\u[5]\d\s+2
specifications, respectively\&.
.SH "DIRECTORIES"
.PP
System unit directories
.RS 4
The systemd system manager reads unit configuration from various directories\&. Packages that want to install unit files shall place them in the directory returned by
\fBpkg\-config systemd \-\-variable=systemdsystemunitdir\fR\&. Other directories checked are
/usr/local/lib/systemd/system
and
/usr/lib/systemd/system\&. User configuration always takes precedence\&.
\fBpkg\-config systemd \-\-variable=systemdsystemconfdir\fR
returns the path of the system configuration directory\&. Packages should alter the content of these directories only with the
\fBenable\fR
and
\fBdisable\fR
commands of the
\fBsystemctl\fR(1)
tool\&. Full list of directories is provided in
\fBsystemd.unit\fR(5)\&.
.RE
.PP
User unit directories
.RS 4
Similar rules apply for the user unit directories\&. However, here the
\m[blue]\fBXDG Base Directory specification\fR\m[]\&\s-2\u[6]\d\s+2
is followed to find units\&. Applications should place their unit files in the directory returned by
\fBpkg\-config systemd \-\-variable=systemduserunitdir\fR\&. Global configuration is done in the directory reported by
\fBpkg\-config systemd \-\-variable=systemduserconfdir\fR\&. The
\fBenable\fR
and
\fBdisable\fR
commands of the
\fBsystemctl\fR(1)
tool can handle both global (i\&.e\&. for all users) and private (for one user) enabling/disabling of units\&. Full list of directories is provided in
\fBsystemd.unit\fR(5)\&.
.RE
.PP
SysV init scripts directory
.RS 4
The location of the SysV init script directory varies between distributions\&. If systemd cannot find a native unit file for a requested service, it will look for a SysV init script of the same name (with the
\&.service
suffix removed)\&.
.RE
.PP
SysV runlevel link farm directory
.RS 4
The location of the SysV runlevel link farm directory varies between distributions\&. systemd will take the link farm into account when figuring out whether a service shall be enabled\&. Note that a service unit with a native unit configuration file cannot be started by activating it in the SysV runlevel link farm\&.
.RE
.SH "SIGNALS"
.PP
\fBSIGTERM\fR
.RS 4
Upon receiving this signal the systemd system manager serializes its state, reexecutes itself and deserializes the saved state again\&. This is mostly equivalent to
\fBsystemctl daemon\-reexec\fR\&.
.sp
systemd user managers will start the
exit\&.target
unit when this signal is received\&. This is mostly equivalent to
\fBsystemctl \-\-user start exit\&.target \-\-job\-mode=replace\-irreversible\fR\&.
.RE
.PP
\fBSIGINT\fR
.RS 4
Upon receiving this signal the systemd system manager will start the
ctrl\-alt\-del\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start ctrl\-alt\-del\&.target \-\-job\-mode=replace\-irreversible\fR\&. If this signal is received more than 7 times per 2s, an immediate reboot is triggered\&. Note that pressing
Ctrl+Alt+Del
on the console will trigger this signal\&. Hence, if a reboot is hanging, pressing
Ctrl+Alt+Del
more than 7 times in 2 seconds is a relatively safe way to trigger an immediate reboot\&.
.sp
systemd user managers treat this signal the same way as
\fBSIGTERM\fR\&.
.RE
.PP
\fBSIGWINCH\fR
.RS 4
When this signal is received the systemd system manager will start the
kbrequest\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start kbrequest\&.target\fR\&.
.sp
This signal is ignored by systemd user managers\&.
.RE
.PP
\fBSIGPWR\fR
.RS 4
When this signal is received the systemd manager will start the
sigpwr\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start sigpwr\&.target\fR\&.
.RE
.PP
\fBSIGUSR1\fR
.RS 4
When this signal is received the systemd manager will try to reconnect to the D\-Bus bus\&.
.RE
.PP
\fBSIGUSR2\fR
.RS 4
When this signal is received the systemd manager will log its complete state in human\-readable form\&. The data logged is the same as printed by
\fBsystemd\-analyze dump\fR\&.
.RE
.PP
\fBSIGHUP\fR
.RS 4
Reloads the complete daemon configuration\&. This is mostly equivalent to
\fBsystemctl daemon\-reload\fR\&.
.RE
.PP
\fBSIGRTMIN+0\fR
.RS 4
Enters default mode, starts the
default\&.target
unit\&. This is mostly equivalent to
\fBsystemctl isolate default\&.target\fR\&.
.RE
.PP
\fBSIGRTMIN+1\fR
.RS 4
Enters rescue mode, starts the
rescue\&.target
unit\&. This is mostly equivalent to
\fBsystemctl isolate rescue\&.target\fR\&.
.RE
.PP
\fBSIGRTMIN+2\fR
.RS 4
Enters emergency mode, starts the
emergency\&.service
unit\&. This is mostly equivalent to
\fBsystemctl isolate emergency\&.service\fR\&.
.RE
.PP
\fBSIGRTMIN+3\fR
.RS 4
Halts the machine, starts the
halt\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start halt\&.target \-\-job\-mode=replace\-irreversible\fR\&.
.RE
.PP
\fBSIGRTMIN+4\fR
.RS 4
Powers off the machine, starts the
poweroff\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start poweroff\&.target \-\-job\-mode=replace\-irreversible\fR\&.
.RE
.PP
\fBSIGRTMIN+5\fR
.RS 4
Reboots the machine, starts the
reboot\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start reboot\&.target \-\-job\-mode=replace\-irreversible\fR\&.
.RE
.PP
\fBSIGRTMIN+6\fR
.RS 4
Reboots the machine via kexec, starts the
kexec\&.target
unit\&. This is mostly equivalent to
\fBsystemctl start kexec\&.target \-\-job\-mode=replace\-irreversible\fR\&.
.RE
.PP
\fBSIGRTMIN+13\fR
.RS 4
Immediately halts the machine\&.
.RE
.PP
\fBSIGRTMIN+14\fR
.RS 4
Immediately powers off the machine\&.
.RE
.PP
\fBSIGRTMIN+15\fR
.RS 4
Immediately reboots the machine\&.
.RE
.PP
\fBSIGRTMIN+16\fR
.RS 4
Immediately reboots the machine with kexec\&.
.RE
.PP
\fBSIGRTMIN+20\fR
.RS 4
Enables display of status messages on the console, as controlled via
\fIsystemd\&.show_status=1\fR
on the kernel command line\&.
.RE
.PP
\fBSIGRTMIN+21\fR
.RS 4
Disables display of status messages on the console, as controlled via
\fIsystemd\&.show_status=0\fR
on the kernel command line\&.
.RE
.PP
\fBSIGRTMIN+22\fR
.RS 4
Sets the service manager\*(Aqs log level to
"debug", in a fashion equivalent to
\fIsystemd\&.log_level=debug\fR
on the kernel command line\&.
.RE
.PP
\fBSIGRTMIN+23\fR
.RS 4
Restores the log level to its configured value\&. The configured value is derived from \(en in order of priority \(en the value specified with
\fIsystemd\&.log\-level=\fR
on the kernel command line, or the value specified with
\fBLogLevel=\fR
in the configuration file, or the built\-in default of
"info"\&.
.RE
.PP
\fBSIGRTMIN+24\fR
.RS 4
Immediately exits the manager (only available for \-\-user instances)\&.
.RE
.PP
\fBSIGRTMIN+26\fR
.RS 4
Restores the log target to its configured value\&. The configured value is derived from \(en in order of priority \(en the value specified with
\fIsystemd\&.log\-target=\fR
on the kernel command line, or the value specified with
\fBLogTarget=\fR
in the configuration file, or the built\-in default\&.
.RE
.PP
\fBSIGRTMIN+27\fR, \fBSIGRTMIN+28\fR
.RS 4
Sets the log target to
"console"
on
\fBSIGRTMIN+27\fR
(or
"kmsg"
on
\fBSIGRTMIN+28\fR), in a fashion equivalent to
\fIsystemd\&.log_target=console\fR
(or
\fIsystemd\&.log_target=kmsg\fR
on
\fBSIGRTMIN+28\fR) on the kernel command line\&.
.RE
.SH "ENVIRONMENT"
.PP
\fI$SYSTEMD_LOG_LEVEL\fR
.RS 4
systemd reads the log level from this environment variable\&. This can be overridden with
\fB\-\-log\-level=\fR\&.
.RE
.PP
\fI$SYSTEMD_LOG_TARGET\fR
.RS 4
systemd reads the log target from this environment variable\&. This can be overridden with
\fB\-\-log\-target=\fR\&.
.RE
.PP
\fI$SYSTEMD_LOG_COLOR\fR
.RS 4
Controls whether systemd highlights important log messages\&. This can be overridden with
\fB\-\-log\-color=\fR\&.
.RE
.PP
\fI$SYSTEMD_LOG_LOCATION\fR
.RS 4
Controls whether systemd prints the code location along with log messages\&. This can be overridden with
\fB\-\-log\-location=\fR\&.
.RE
.PP
\fI$XDG_CONFIG_HOME\fR, \fI$XDG_CONFIG_DIRS\fR, \fI$XDG_DATA_HOME\fR, \fI$XDG_DATA_DIRS\fR
.RS 4
The systemd user manager uses these variables in accordance to the
\m[blue]\fBXDG Base Directory specification\fR\m[]\&\s-2\u[6]\d\s+2
to find its configuration\&.
.RE
.PP
\fI$SYSTEMD_UNIT_PATH\fR
.RS 4
Controls where systemd looks for unit files\&.
.RE
.PP
\fI$SYSTEMD_SYSVINIT_PATH\fR
.RS 4
Controls where systemd looks for SysV init scripts\&.
.RE
.PP
\fI$SYSTEMD_SYSVRCND_PATH\fR
.RS 4
Controls where systemd looks for SysV init script runlevel link farms\&.
.RE
.PP
\fI$SYSTEMD_COLORS\fR
.RS 4
The value must be a boolean\&. Controls whether colorized output should be generated\&. This can be specified to override the decision that
\fBsystemd\fR
makes based on
\fI$TERM\fR
and what the console is connected to\&.
.RE
.PP
\fI$SYSTEMD_URLIFY\fR
.RS 4
The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
\fBsystemd\fR
makes based on
\fI$TERM\fR
and other conditions\&.
.RE
.PP
\fI$LISTEN_PID\fR, \fI$LISTEN_FDS\fR, \fI$LISTEN_FDNAMES\fR
.RS 4
Set by systemd for supervised processes during socket\-based activation\&. See
\fBsd_listen_fds\fR(3)
for more information\&.
.RE
.PP
\fI$NOTIFY_SOCKET\fR
.RS 4
Set by systemd for supervised processes for status and start\-up completion notification\&. See
\fBsd_notify\fR(3)
for more information\&.
.RE
.PP
For further environment variables understood by systemd and its various components, see
\m[blue]\fBKnown Environment Variables\fR\m[]\&\s-2\u[7]\d\s+2\&.
.SH "KERNEL COMMAND LINE"
.PP
When run as system instance systemd parses a number of kernel command line arguments\&\s-2\u[8]\d\s+2:
.PP
\fIsystemd\&.unit=\fR, \fIrd\&.systemd\&.unit=\fR
.RS 4
Overrides the unit to activate on boot\&. Defaults to
default\&.target\&. This may be used to temporarily boot into a different boot unit, for example
rescue\&.target
or
emergency\&.service\&. See
\fBsystemd.special\fR(7)
for details about these units\&. The option prefixed with
"rd\&."
is honored only in the initial RAM disk (initrd), while the one that is not prefixed only in the main system\&.
.RE
.PP
\fIsystemd\&.dump_core\fR
.RS 4
Takes a boolean argument or enables the option if specified without an argument\&. If enabled, the systemd manager (PID 1) dumps core when it crashes\&. Otherwise, no core dump is created\&. Defaults to enabled\&.
.RE
.PP
\fIsystemd\&.crash_chvt\fR
.RS 4
Takes a positive integer, or a boolean argument\&. Can be also specified without an argument, with the same effect as a positive boolean\&. If a positive integer (in the range 1\(en63) is specified, the system manager (PID 1) will activate the specified virtual terminal (VT) when it crashes\&. Defaults to disabled, meaning that no such switch is attempted\&. If set to enabled, the VT the kernel messages are written to is selected\&.
.RE
.PP
\fIsystemd\&.crash_shell\fR
.RS 4
Takes a boolean argument or enables the option if specified without an argument\&. If enabled, the system manager (PID 1) spawns a shell when it crashes, after a 10s delay\&. Otherwise, no shell is spawned\&. Defaults to disabled, for security reasons, as the shell is not protected by password authentication\&.
.RE
.PP
\fIsystemd\&.crash_reboot\fR
.RS 4
Takes a boolean argument or enables the option if specified without an argument\&. If enabled, the system manager (PID 1) will reboot the machine automatically when it crashes, after a 10s delay\&. Otherwise, the system will hang indefinitely\&. Defaults to disabled, in order to avoid a reboot loop\&. If combined with
\fIsystemd\&.crash_shell\fR, the system is rebooted after the shell exits\&.
.RE
.PP
\fIsystemd\&.confirm_spawn\fR
.RS 4
Takes a boolean argument or a path to the virtual console where the confirmation messages should be emitted\&. Can be also specified without an argument, with the same effect as a positive boolean\&. If enabled, the system manager (PID 1) asks for confirmation when spawning processes using
\fB/dev/console\fR\&. If a path or a console name (such as
"ttyS0") is provided, the virtual console pointed to by this path or described by the give name will be used instead\&. Defaults to disabled\&.
.RE
.PP
\fIsystemd\&.service_watchdogs=\fR
.RS 4
Takes a boolean argument\&. If disabled, all service runtime watchdogs (\fBWatchdogSec=\fR) and emergency actions (e\&.g\&.
\fBOnFailure=\fR
or
\fBStartLimitAction=\fR) are ignored by the system manager (PID 1); see
\fBsystemd.service\fR(5)\&. Defaults to enabled, i\&.e\&. watchdogs and failure actions are processed normally\&. The hardware watchdog is not affected by this option\&.
.RE
.PP
\fIsystemd\&.show_status\fR
.RS 4
Takes a boolean argument or the constant
\fBauto\fR\&. Can be also specified without an argument, with the same effect as a positive boolean\&. If enabled, the systemd manager (PID 1) shows terse service status updates on the console during bootup\&.
\fBauto\fR
behaves like
\fBfalse\fR
until a unit fails or there is a significant delay in boot\&. Defaults to enabled, unless
\fBquiet\fR
is passed as kernel command line option, in which case it defaults to
\fBauto\fR\&. If specified overrides the system manager configuration file option
\fBShowStatus=\fR, see
\fBsystemd-system.conf\fR(5)\&. However, the process command line option
\fB\-\-show\-status=\fR
takes precedence over both this kernel command line option and the configuration file option\&.
.RE
.PP
\fIsystemd\&.log_target=\fR, \fIsystemd\&.log_level=\fR, \fIsystemd\&.log_location=\fR, \fIsystemd\&.log_color\fR
.RS 4
Controls log output, with the same effect as the
\fI$SYSTEMD_LOG_TARGET\fR,
\fI$SYSTEMD_LOG_LEVEL\fR,
\fI$SYSTEMD_LOG_LOCATION\fR,
\fI$SYSTEMD_LOG_COLOR\fR
environment variables described above\&.
\fIsystemd\&.log_color\fR
can be specified without an argument, with the same effect as a positive boolean\&.
.RE
.PP
\fIsystemd\&.default_standard_output=\fR, \fIsystemd\&.default_standard_error=\fR
.RS 4
Controls default standard output and error output for services, with the same effect as the
\fB\-\-default\-standard\-output=\fR
and
\fB\-\-default\-standard\-error=\fR
command line arguments described above, respectively\&.
.RE
.PP
\fIsystemd\&.setenv=\fR
.RS 4
Takes a string argument in the form VARIABLE=VALUE\&. May be used to set default environment variables to add to forked child processes\&. May be used more than once to set multiple variables\&.
.RE
.PP
\fIsystemd\&.machine_id=\fR
.RS 4
Takes a 32 character hex value to be used for setting the machine\-id\&. Intended mostly for network booting where the same machine\-id is desired for every boot\&.
.RE
.PP
\fIsystemd\&.unified_cgroup_hierarchy\fR
.RS 4
When specified without an argument or with a true argument, enables the usage of
\m[blue]\fBunified cgroup hierarchy\fR\m[]\&\s-2\u[9]\d\s+2
(a\&.k\&.a\&.\ \&cgroups\-v2)\&. When specified with a false argument, fall back to hybrid or full legacy cgroup hierarchy\&.
.sp
If this option is not specified, the default behaviour is determined during compilation (the
\fB\-Ddefault\-hierarchy=\fR
meson option)\&. If the kernel does not support unified cgroup hierarchy, the legacy hierarchy will be used even if this option is specified\&.
.RE
.PP
\fIsystemd\&.legacy_systemd_cgroup_controller\fR
.RS 4
Takes effect if the full unified cgroup hierarchy is not used (see previous option)\&. When specified without an argument or with a true argument, disables the use of "hybrid" cgroup hierarchy (i\&.e\&. a cgroups\-v2 tree used for systemd, and
\m[blue]\fBlegacy cgroup hierarchy\fR\m[]\&\s-2\u[10]\d\s+2, a\&.k\&.a\&.\ \&cgroups\-v1, for other controllers), and forces a full "legacy" mode\&. When specified with a false argument, enables the use of "hybrid" hierarchy\&.
.sp
If this option is not specified, the default behaviour is determined during compilation (the
\fB\-Ddefault\-hierarchy=\fR
meson option)\&. If the kernel does not support unified cgroup hierarchy, the legacy hierarchy will be used even if this option is specified\&.
.RE
.PP
\fIquiet\fR
.RS 4
Turn off status output at boot, much like
\fIsystemd\&.show_status=no\fR
would\&. Note that this option is also read by the kernel itself and disables kernel log output\&. Passing this option hence turns off the usual output from both the system manager and the kernel\&.
.RE
.PP
\fIdebug\fR
.RS 4
Turn on debugging output\&. This is equivalent to
\fIsystemd\&.log_level=debug\fR\&. Note that this option is also read by the kernel itself and enables kernel debug output\&. Passing this option hence turns on the debug output from both the system manager and the kernel\&.
.RE
.PP
\fIemergency\fR, \fIrd\&.emergency\fR, \fI\-b\fR
.RS 4
Boot into emergency mode\&. This is equivalent to
\fIsystemd\&.unit=emergency\&.target\fR
or
\fIrd\&.systemd\&.unit=emergency\&.target\fR, respectively, and provided for compatibility reasons and to be easier to type\&.
.RE
.PP
\fIrescue\fR, \fIrd\&.rescue\fR, \fIsingle\fR, \fIs\fR, \fIS\fR, \fI1\fR
.RS 4
Boot into rescue mode\&. This is equivalent to
\fIsystemd\&.unit=rescue\&.target\fR
or
\fIrd\&.systemd\&.unit=rescue\&.target\fR, respectively, and provided for compatibility reasons and to be easier to type\&.
.RE
.PP
\fI2\fR, \fI3\fR, \fI4\fR, \fI5\fR
.RS 4
Boot into the specified legacy SysV runlevel\&. These are equivalent to
\fIsystemd\&.unit=runlevel2\&.target\fR,
\fIsystemd\&.unit=runlevel3\&.target\fR,
\fIsystemd\&.unit=runlevel4\&.target\fR, and
\fIsystemd\&.unit=runlevel5\&.target\fR, respectively, and provided for compatibility reasons and to be easier to type\&.
.RE
.PP
\fIlocale\&.LANG=\fR, \fIlocale\&.LANGUAGE=\fR, \fIlocale\&.LC_CTYPE=\fR, \fIlocale\&.LC_NUMERIC=\fR, \fIlocale\&.LC_TIME=\fR, \fIlocale\&.LC_COLLATE=\fR, \fIlocale\&.LC_MONETARY=\fR, \fIlocale\&.LC_MESSAGES=\fR, \fIlocale\&.LC_PAPER=\fR, \fIlocale\&.LC_NAME=\fR, \fIlocale\&.LC_ADDRESS=\fR, \fIlocale\&.LC_TELEPHONE=\fR, \fIlocale\&.LC_MEASUREMENT=\fR, \fIlocale\&.LC_IDENTIFICATION=\fR
.RS 4
Set the system locale to use\&. This overrides the settings in
/etc/locale\&.conf\&. For more information, see
\fBlocale.conf\fR(5)
and
\fBlocale\fR(7)\&.
.RE
.PP
For other kernel command line parameters understood by components of the core OS, please refer to
\fBkernel-command-line\fR(7)\&.
.SH "SOCKETS AND FIFOS"
.PP
/run/systemd/notify
.RS 4
Daemon status notification socket\&. This is an
\fBAF_UNIX\fR
datagram socket and is used to implement the daemon notification logic as implemented by
\fBsd_notify\fR(3)\&.
.RE
.PP
/run/systemd/private
.RS 4
Used internally as communication channel between
\fBsystemctl\fR(1)
and the systemd process\&. This is an
\fBAF_UNIX\fR
stream socket\&. This interface is private to systemd and should not be used in external projects\&.
.RE
.PP
/dev/initctl
.RS 4
Limited compatibility support for the SysV client interface, as implemented by the
systemd\-initctl\&.service
unit\&. This is a named pipe in the file system\&. This interface is obsolete and should not be used in new applications\&.
.RE
.SH "SEE ALSO"
.PP
The
\m[blue]\fBsystemd Homepage\fR\m[]\&\s-2\u[11]\d\s+2,
\fBsystemd-system.conf\fR(5),
\fBlocale.conf\fR(5),
\fBsystemctl\fR(1),
\fBjournalctl\fR(1),
\fBsystemd-notify\fR(1),
\fBdaemon\fR(7),
\fBsd-daemon\fR(3),
\fBsystemd.unit\fR(5),
\fBsystemd.special\fR(5),
\fBpkg-config\fR(1),
\fBkernel-command-line\fR(7),
\fBbootup\fR(7),
\fBsystemd.directives\fR(7)
.SH "NOTES"
.IP " 1." 4
cgroups.txt
.RS 4
\%https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
.RE
.IP " 2." 4
Original Design Document
.RS 4
\%http://0pointer.de/blog/projects/systemd.html
.RE
.IP " 3." 4
Interface Stability Promise
.RS 4
\%https://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise
.RE
.IP " 4." 4
Container Interface
.RS 4
\%https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface
.RE
.IP " 5." 4
initrd Interface
.RS 4
\%https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface
.RE
.IP " 6." 4
XDG Base Directory specification
.RS 4
\%http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
.RE
.IP " 7." 4
Known Environment Variables
.RS 4
\%https://systemd.io/ENVIRONMENT
.RE
.IP " 8." 4
If run inside a Linux container these arguments may be passed as command line arguments to systemd itself, next to any of the command line options listed in the Options section above. If run outside of Linux containers, these arguments are parsed from
/proc/cmdline
instead.
.IP " 9." 4
unified cgroup hierarchy
.RS 4
\%https://www.kernel.org/doc/Documentation/cgroup-v2.txt
.RE
.IP "10." 4
legacy cgroup hierarchy
.RS 4
\%https://www.kernel.org/doc/Documentation/cgroup-v1/
.RE
.IP "11." 4
systemd Homepage
.RS 4
\%https://www.freedesktop.org/wiki/Software/systemd/
.RE
|