{"id":3937,"date":"2022-12-20T17:28:27","date_gmt":"2022-12-20T20:28:27","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/systemd-syntax-man7\/"},"modified":"2022-12-20T17:28:27","modified_gmt":"2022-12-20T20:28:27","slug":"systemd-syntax-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/systemd-syntax-man7\/","title":{"rendered":"SYSTEMD.SYNTAX (man7)"},"content":{"rendered":"<h1 align=\"center\">SYSTEMD.SYNTAX<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#INTRODUCTION\">INTRODUCTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd.syntax \u2212 General syntax of systemd configuration files<\/p>\n<h2>INTRODUCTION <a name=\"INTRODUCTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page describes the basic principles of configuration files used by <b>systemd<\/b>(1) and related programs for:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 systemd unit files, see <b>systemd.unit<\/b>(5), <b>systemd.service<\/b>(5), <b>systemd.socket<\/b>(5), <b>systemd.device<\/b>(5), <b>systemd.mount<\/b>(5), <b>systemd.automount<\/b>(5), <b>systemd.swap<\/b>(5), <b>systemd.target<\/b>(5), <b>systemd.path<\/b>(5), <b>systemd.timer<\/b>(5), <b>systemd.slice<\/b>(5), <b>systemd.scope<\/b>(5), <b>systemd.nspawn<\/b>(5)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 link files, see <b>systemd.link<\/b>(5)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 netdev and network files, see <b>systemd.netdev<\/b>(5), <b>systemd.network<\/b>(5)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 daemon config files, see <b>systemd-system.conf<\/b>(5), <b>systemd-user.conf<\/b>(5), <b>logind.conf<\/b>(5), <b>journald.conf<\/b>(5), <b>journal-remote.conf<\/b>(5), <b>journal-upload.conf<\/b>(5), <b>systemd-sleep.conf<\/b>(5), <b>timesyncd.conf<\/b>(5)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The syntax is inspired by <b><font color=\"#0000FF\">XDG Desktop Entry Specification<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">.desktop files, which are in turn inspired by Microsoft Windows .ini files.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Each file is a plain text file divided into sections, with configuration entries in the style <i>key<\/i>=<i>value<\/i>. Whitespace immediately before or after the &#8220;=&#8221; is ignored. Empty lines and lines starting with &#8220;#&#8221; or &#8220;;&#8221; are ignored, which may be used for commenting.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Lines ending in a backslash are concatenated with the following line while reading and the backslash is replaced by a space character. This may be used to wrap long lines. The limit on line length is very large (currently 1 MB), but it is recommended to avoid such long lines and use multiple directives, variable substitution, or other mechanism as appropriate for the given file type. When a comment line or lines follow a line ending with a backslash, the comment block is ignored, so the continued line is concatenated with whatever follows the comment block.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>Example\u00a01.\u00a0<\/b><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">[Section A] <br \/> KeyOne=value 1 <br \/> KeyTwo=value 2<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># a comment<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">[Section B] <br \/> Setting=&#8221;something&#8221; &#8220;some thing&#8221; &#8220;&#8230;&#8221; <br \/> KeyTwo=value 2  <br \/> value 2 continued<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">[Section C] <br \/> KeyThree=value 3 <br \/> # this line is ignored <br \/> ; this line is ignored too <br \/> value 3 continued<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Boolean arguments used in configuration files can be written in various formats. For positive settings the strings <b>1<\/b>, <b>yes<\/b>, <b>true<\/b> and <b>on<\/b> are equivalent. For negative settings, the strings <b>0<\/b>, <b>no<\/b>, <b>false<\/b> and <b>off<\/b> are equivalent.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Time span values encoded in configuration files can be written in various formats. A stand\u2212alone number specifies a time in seconds. If suffixed with a time unit, the unit is honored. A concatenation of multiple values with units is supported, in which case the values are added up. Example: &#8220;50&#8221; refers to 50 seconds; &#8220;2min\u00a0200ms&#8221; refers to 2 minutes and 200 milliseconds, i.e. 120200\u00a0ms. The following time units are understood: &#8220;s&#8221;, &#8220;min&#8221;, &#8220;h&#8221;, &#8220;d&#8221;, &#8220;w&#8221;, &#8220;ms&#8221;, &#8220;us&#8221;. For details see <b>systemd.time<\/b>(7).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Various settings are allowed to be specified more than once, in which case the interpretation depends on the setting. Often, multiple settings form a list, and setting to an empty value &#8220;resets&#8221;, which means that previous assignments are ignored. When this is allowed, it is mentioned in the description of the setting. Note that using multiple assignments to the same value makes the file incompatible with parsers for the XDG .desktop file format.<\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>systemd.time<\/b>(7)<\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">1.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"48%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">XDG Desktop Entry Specification<\/font><\/p>\n<\/td>\n<td width=\"35%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">http:\/\/standards.freedesktop.org\/desktop-entry-spec\/latest\/<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  systemd.syntax \u2212 General syntax of systemd configuration files <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,972,978],"class_list":["post-3937","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-systemd"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3937"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3937\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}