Config-Model-Systemd-0.244.1/0000755000175000017500000000000013575500330014216 5ustar domidomiConfig-Model-Systemd-0.244.1/MANIFEST0000644000175000017500000000655613575500330015363 0ustar domidomi# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Build.PL CONTRIBUTING.md Changes LICENSE MANIFEST META.json META.yml README-build-from-git.md README.md contrib/parse-man.pl dist.ini lib/Config/Model/Backend/Systemd.pm lib/Config/Model/Backend/Systemd/Layers.pm lib/Config/Model/Backend/Systemd/Unit.pm lib/Config/Model/Systemd.pm lib/Config/Model/application.d/systemd-service lib/Config/Model/application.d/systemd-socket lib/Config/Model/application.d/systemd-timer lib/Config/Model/models/Systemd.pl lib/Config/Model/models/Systemd.pod lib/Config/Model/models/Systemd/Common/Exec.pl lib/Config/Model/models/Systemd/Common/Kill.pl lib/Config/Model/models/Systemd/Common/ResourceControl.pl lib/Config/Model/models/Systemd/Section/Install.pl lib/Config/Model/models/Systemd/Section/Install.pod lib/Config/Model/models/Systemd/Section/Service.pl lib/Config/Model/models/Systemd/Section/Service.pod lib/Config/Model/models/Systemd/Section/ServiceUnit.pl lib/Config/Model/models/Systemd/Section/ServiceUnit.pod lib/Config/Model/models/Systemd/Section/Socket.pl lib/Config/Model/models/Systemd/Section/Socket.pod lib/Config/Model/models/Systemd/Section/SocketUnit.pl lib/Config/Model/models/Systemd/Section/SocketUnit.pod lib/Config/Model/models/Systemd/Section/Timer.pl lib/Config/Model/models/Systemd/Section/Timer.pod lib/Config/Model/models/Systemd/Section/TimerUnit.pl lib/Config/Model/models/Systemd/Section/TimerUnit.pod lib/Config/Model/models/Systemd/Section/Unit.pl lib/Config/Model/models/Systemd/Service.pl lib/Config/Model/models/Systemd/Service.pod lib/Config/Model/models/Systemd/Socket.pl lib/Config/Model/models/Systemd/Socket.pod lib/Config/Model/models/Systemd/Timer.pl lib/Config/Model/models/Systemd/Timer.pod lib/Config/Model/system.d/systemd lib/Config/Model/user.d/systemd-user t/README.md t/cme-function.t t/model_tests.d/systemd-examples/condition-list/main-test t/model_tests.d/systemd-examples/disable-service/main-sshd t/model_tests.d/systemd-examples/remove-service/default-alsa-state t/model_tests.d/systemd-examples/remove-service/default-sshd t/model_tests.d/systemd-examples/remove-service/main-sshd t/model_tests.d/systemd-examples/remove-service/mpd.service t/model_tests.d/systemd-examples/remove-service/mpd.socket t/model_tests.d/systemd-examples/sshd-service/main-sshd t/model_tests.d/systemd-examples/sshd-service/ssh.service t/model_tests.d/systemd-service-examples/basic-service/gmail-imap-tunnel@.service t/model_tests.d/systemd-service-examples/delete-service/main-obex t/model_tests.d/systemd-service-examples/delete-service/user-obex t/model_tests.d/systemd-service-examples/override-service/main-obex t/model_tests.d/systemd-service-examples/override-service/user-obex t/model_tests.d/systemd-service-test-conf.pl t/model_tests.d/systemd-socket-examples/basic-socket/gmail-imap-tunnel.socket t/model_tests.d/systemd-socket-test-conf.pl t/model_tests.d/systemd-test-conf.pl t/model_tests.d/systemd-user-examples/basic-service/gmail-imap-tunnel@.service t/model_tests.d/systemd-user-examples/basic-socket/gmail-imap-tunnel.socket t/model_tests.d/systemd-user-examples/delete-service/main-obex t/model_tests.d/systemd-user-examples/delete-service/user-obex t/model_tests.d/systemd-user-examples/override-service/main-obex t/model_tests.d/systemd-user-examples/override-service/user-obex t/model_tests.d/systemd-user-test-conf.pl t/model_tests.t t/pod.t weaver.ini Config-Model-Systemd-0.244.1/dist.ini0000644000175000017500000000427513575500330015672 0ustar domidominame = Config-Model-Systemd author = Dominique Dumont license = LGPL_2_1 copyright_holder = Dominique Dumont copyright_year = 2015-2018 [MetaResources] homepage = https://github.com/dod38fr/config-model/wiki bugtracker.mailto = ddumont at cpan.org bugtracker.web = https://github.com/dod38fr/config-model-systemd/issues repository.url = git://github.com/dod38fr/config-model-systemd.git repository.web = http://github.com/dod38fr/config-model-systemd repository.type = git [Prereqs] perl = 5.010 [NextRelease] format = %v%T %{yyyy-MM-dd}d ; use 'V=2.234 dzil release' to override version number [Git::NextVersion] [Git::Check] allow_dirty = dist.ini allow_dirty = Changes [Git::Commit] [Git::Tag] [Git::Push] [MetaJSON] [AutoPrereqs] skip = ^[a-z\d]+$ skip = ExtUtils::testlib skip = Exporter configure_finder = ScriptFile [Prereqs / RuntimeRequires] [Prereqs / RuntimeRecommends] App::Cme = 0 Config::Model::TkUI = 0 [Prereqs / BuildRequires] ; not detected by dzil authordep. ; See Dist::Zilla::App::Command::authordeps man page ; authordep Pod::Weaver::Section::Support ; authordep Pod::Elemental::Transformer::List ; authordep App::Cme Config::Model = 2.118 [@Filter] -bundle = @Basic -remove = Readme -remove = MakeMaker [ModuleBuild::Custom] mb_version = 0.34 ; avoid messing with generated pod files. Otherwise pod re-generated ; at packaging time (Debian) are different (because Dist::Zilla is not ; used at that time) See ; http://blogs.perl.org/users/polettix/2011/11/distzilla-podweaver-and-bin.html ; for details on this configuration magic [FileFinder::ByName / OnlyPmFiles] dir = lib match = \.pm$ [FileFinder::ByName / ScriptFile] dir = script match = \.pl$ [FileFinder::ByName / noModelFiles] dir = lib skip = /models/ match = \.p(m|od)$ [PkgVersion] finder = OnlyPmFiles [PodWeaver] finder = :ExecFiles finder = noModelFiles [Prepender] copyright=1 [Run::BeforeBuild] ;-- Generate pod doc from model run = cme gen-class-pod [Run::BeforeRelease] run = cme gen-class-pod ; instructions below can safely be commented out [Twitter] hash_tags = #configmodel #cme tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}}, {{$DIST}} is {{$ABSTRACT}}. {{$URL}} url_shortener = GitHub Config-Model-Systemd-0.244.1/README.md0000644000175000017500000000454613575500330015506 0ustar domidomi[![](https://travis-ci.org/dod38fr/config-model-systemd.svg?branch=master)](https://travis-ci.org/dod38fr/config-model-systemd) # config-model-systemd check and edit systemd configuration files ## Description This project provides a configuration editor for the configuration file of Systemd, i.e. all files in `~/.config/systemd/user/` or all files in `/etc/systemd/system/` ## Usage ### invoke editor The following command loads **user** systemd files and launch a graphical editor: cme edit systemd-user Likewise, the following command loads **system** systemd configuration files and launch a graphical editor: sudo cme edit systemd ### Just check systemd configuration You can also use cme to run sanity checks on the configuration file: cme check systemd-user cme check systemd ### More detailed usage See [Managing Systemd configuration with cme](https://github.com/dod38fr/config-model/wiki/Managing-systemd-configuration-with-cme) wiki page. ## Versioning scheme This module is versioned with 3 fields: * major number * supported Systemd version * minor version for the usual changes. This number is reset to one each time a new version of Systemd is supported. For instance: version `0.231.1` is the first release that supports Systemd version 231 ## Installation ### Debian, Ubuntu Run: apt install cme libconfig-model-systemd-perl ### Others You can also install this project from CPAN: cpanm install App::Cme cpanm install Config::Model::Systemd ### From GitHub You may also follow these [instructions](README-build-from-git.md) to install and build from git. ## Problems ? Please report any issue on https://github.com/dod38fr/config-model-systemd/issues ## Re-generate systemd model files The files in `lib/Config/Model/models/Systemd/Section` and `lib/Config/Model/models/Systemd/Common` are generated from Systemd documentation in xml format. To regenerate the model files, you must retrieve systemd sources. For instance, you can retrieve Debian source package: apt-get source systemd Then, from `config-model-systemd` directory, run: perl contrib/parse-man.pl -from ## More information * [Managing Systemd configuration with cme](https://github.com/dod38fr/config-model/wiki/Managing-systemd-configuration-with-cme) * [Using cme](https://github.com/dod38fr/config-model/wiki/Using-cme) Config-Model-Systemd-0.244.1/LICENSE0000644000175000017500000006013213575500330015225 0ustar domidomiThis software is Copyright (c) 2015-2018 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 The GNU Lesser General Public License (LGPL) Version 2.1, February 1999 (The master copy of this license lives on the GNU website.) Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Config-Model-Systemd-0.244.1/t/0000755000175000017500000000000013575500330014461 5ustar domidomiConfig-Model-Systemd-0.244.1/t/cme-function.t0000644000175000017500000000223513575500330017237 0ustar domidomi# -*- cperl -*- use strict; use warnings; use Path::Tiny; use Test::More; use Test::File::Contents; use Config::Model qw/cme/; use Config::Model::Tester::Setup qw/init_test setup_test_dir/; my ($model, $trace) = init_test(); # pseudo root where config files are written by config-model my $wr_root = setup_test_dir; my $systemd_file = $wr_root->child('test.service'); subtest 'create file from scratch' => sub { my $instance = cme( application => 'systemd-service', config_file => $systemd_file->basename, root_dir => $wr_root->stringify ); ok($instance, "systemd-service instance created"); $instance->modify('Unit Description="test single unit"'); # test minimal modif (re-order) $instance->save(force => 1); ok(1,"data saved"); file_contents_like($systemd_file->stringify, qr/test single unit/,"saved file ok"); }; subtest 'read file' => sub { my $instance = cme( application => 'systemd-service', config_file => $systemd_file->basename, root_dir => $wr_root->stringify ); is($instance->grab_value('Unit Description'),"test single unit","read file ok"); }; done_testing(); Config-Model-Systemd-0.244.1/t/README.md0000644000175000017500000000176513575500330015751 0ustar domidomi## Running the tests All tests can be run in parrallel with prove -j8 t/ ### Test options Most tests can be run with the options provided by [Config::Model::Tester::Setup](https://metacpan.org/pod/Config::Model::Tester::Setup): * `-trace`: show more information * `-error`: show stack stace in case of error * `-log`: Enable logs (you may need to tweak `~/.log4config-model` to get more trace. See [cme/Logging](https://metacpan.org/pod/distribution/App-Cme/bin/cme#Logging) for more details. ### model_tests.t This test is set of subtests made of test cases. It accepts arguments to limit the test to one subtest and one test case: perl t/model_test.t [ --log ] [--error] [--trace] [ subtest [ test_case ] ] See [Config::Model::Tester](https://metacpan.org/pod/Config::Model::Tester) for more details. ### Running with prove You can run all tests with prove -j8 t/ To run with local files: prove -l -j8 t/ You can pass parameter to test files with: prove -l t/ :: --log Config-Model-Systemd-0.244.1/t/pod.t0000644000175000017500000000037413575500330015434 0ustar domidomiuse strict; use warnings; BEGIN { unless ( $ENV{AUTHOR_TESTING} ) { require Test::More; Test::More::plan( skip_all => 'these tests are for testing by the author' ); } } use Test::More; use Test::Pod 1.00; all_pod_files_ok( ); Config-Model-Systemd-0.244.1/t/model_tests.d/0000755000175000017500000000000013575500330017225 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-test-conf.pl0000644000175000017500000000515313575500330023156 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # systemd tests (system files) use strict; use warnings; my $conf_dir = '/etc/systemd/system/'; # list of tests. my @tests = ( { name => 'sshd-service', backend_arg => 'sshd', setup => { 'main-sshd' => $conf_dir.'sshd.service.d/override.conf', # create symlink from array elements to target file (the last of the array) # TODO: update C::M::Tester version require 'ssh.service' => [ $conf_dir.'/sshd.service', '/lib/systemd/system/ssh.service' ] }, check => { 'service:sshd Service ExecStartPre:0' => { mode => 'layered', value => '/usr/sbin/sshd -t'}, 'service:sshd Service ExecReload:0' => { mode => 'layered', value => '/usr/sbin/sshd -t'}, 'service:sshd Service ExecReload:1' => { mode => 'layered', value => '/bin/kill -HUP $MAINPID'}, 'service:sshd Unit Description' => "OpenBSD Secure Shell server - test override", } }, { name => 'disable-service', backend_arg => 'sshd', setup => { 'main-sshd' => $conf_dir.'sshd.service.d/override.conf', }, load => "service:sshd disable=1", wr_check => { 'service:sshd disable' => 1 }, file_check_sub => sub { my $list_ref = shift ; unshift @$list_ref , '/etc/systemd/system/sshd.service'; } }, { name => 'remove-service', backend_arg => 'sshd', setup => { 'main-sshd' => $conf_dir.'sshd.service.d/override.conf', 'default-sshd' => '/lib/systemd/system/sshd.service', 'mpd.service' => $conf_dir.'mpd.service.d/override.conf', 'mpd.socket' => $conf_dir.'mpd.socket.d/override.conf', 'default-alsa-state' => '/lib/systemd/system/alsa-state.service' }, load => "service:sshd Unit Description~", # file is removed because the load instruction above removes the only setting in there file_check_sub => sub { my $list_ref = shift ; @$list_ref = grep { not m!/etc/.*/sshd.service!} @$list_ref; } }, { name => 'condition-list', backend_arg => 'main-test', setup => { # Debian #850228 'main-test' => $conf_dir.'main-test.service.d/override.conf', } }, ); return { tests => \@tests, conf_dir => $conf_dir, } Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/0000755000175000017500000000000013575500330022531 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/sshd-service/0000755000175000017500000000000013575500330025130 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/sshd-service/main-sshd0000644000175000017500000000007713575500330026742 0ustar domidomi[Unit] Description=OpenBSD Secure Shell server - test override Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/sshd-service/ssh.service0000644000175000017500000000103213575500330027303 0ustar domidomi[Unit] Description=OpenBSD Secure Shell server Documentation=man:sshd(8) man:sshd_config(5) After=network.target auditd.service ConditionPathExists=!/etc/ssh/sshd_not_to_be_run [Service] EnvironmentFile=-/etc/default/ssh ExecStartPre=/usr/sbin/sshd -t ExecStart=/usr/sbin/sshd -D $SSHD_OPTS ExecReload=/usr/sbin/sshd -t ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure RestartPreventExitStatus=255 Type=notify RuntimeDirectory=sshd RuntimeDirectoryMode=0755 [Install] WantedBy=multi-user.target Alias=sshd.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/condition-list/0000755000175000017500000000000013575500330025470 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/condition-list/main-test0000644000175000017500000000062113575500330027313 0ustar domidomi[Unit] Description=Something something PartOf=whatever.target ConditionHost=|hostname1 ConditionHost=|anotherhost Requires=whatever # bogus service [Service] EnvironmentFile=-/etc/default/ssh ExecStart=/usr/sbin/sshd -D $SSHD_OPTS ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure RestartPreventExitStatus=255 Type=notify [Install] WantedBy=multi-user.target Alias=sshd.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/0000755000175000017500000000000013575500330025464 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/default-alsa-state0000644000175000017500000000070613575500330031072 0ustar domidomi# # Note that two different ALSA card state management schemes exist and they # can be switched using a file exist check - /etc/alsa/state-daemon.conf . # [Unit] Description=Manage Sound Card State (restore and store) Documentation=man:alsactl(1) ConditionPathExists=/etc/alsa/state-daemon.conf [Service] Type=simple ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -s -n 19 -c rdaemon ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -s kill save_and_quit Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/default-sshd0000644000175000017500000000060113575500330027767 0ustar domidomi[Unit] Description=OpenBSD Secure Shell server After=network.target auditd.service ConditionPathExists=!/etc/ssh/sshd_not_to_be_run [Service] EnvironmentFile=-/etc/default/ssh ExecStart=/usr/sbin/sshd -D $SSHD_OPTS ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure RestartPreventExitStatus=255 Type=notify [Install] WantedBy=multi-user.target Alias=sshd.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/main-sshd0000644000175000017500000000005513575500330027272 0ustar domidomi[Unit] Description=serveur OpenBSD securisé Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/mpd.service0000644000175000017500000000054513575500330027632 0ustar domidomi[Unit] Description=Music Player Daemon After=network.target sound.target [Service] EnvironmentFile=/etc/default/mpd ExecStart=/usr/bin/mpd --no-daemon $MPDCONF # allow MPD to use real-time priority 50 LimitRTPRIO=50 LimitRTTIME=infinity # disallow writing to /usr, /bin, /sbin, ... ProtectSystem=yes [Install] WantedBy=multi-user.target Also=mpd.socket Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/remove-service/mpd.socket0000644000175000017500000000021113575500330027450 0ustar domidomi[Socket] ListenStream=/run/mpd/socket ListenStream=6600 Backlog=5 KeepAlive=true PassCredentials=true [Install] WantedBy=sockets.target Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/disable-service/0000755000175000017500000000000013575500330025572 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-examples/disable-service/main-sshd0000644000175000017500000000060113575500330027375 0ustar domidomi[Unit] Description=OpenBSD Secure Shell server After=network.target auditd.service ConditionPathExists=!/etc/ssh/sshd_not_to_be_run [Service] EnvironmentFile=-/etc/default/ssh ExecStart=/usr/sbin/sshd -D $SSHD_OPTS ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure RestartPreventExitStatus=255 Type=notify [Install] WantedBy=multi-user.target Alias=sshd.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-test-conf.pl0000644000175000017500000000175313575500330024616 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # systemd tests for user use strict; use warnings; # list of tests. my @tests = ( { name => 'basic-service', config_file => 'gmail-imap-tunnel@.service', check => [ 'Unit Description' => 'Tunnel IMAPS connections to Gmail with corkscrew', 'Service ExecStart:0' => "-/usr/bin/socat - PROXY:127.0.0.1:imap.gmail.com:993,proxyport=8888" ], file_contents_unlike => { "gmail-imap-tunnel@.service" => qr/disable/ , }, }, { name => 'from-scratch', config_file => 'test.service', load => 'Unit Description="test from scratch"', file_contents_like => { "test.service" => qr/from scratch/ , }, } ); return { tests => \@tests } ; Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-test-conf.pl0000644000175000017500000000466313575500330024137 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # systemd tests for user use strict; use warnings; # list of tests. my @tests = ( { name => 'basic-service', backend_arg => 'gmail', file_contents_unlike => { "home/joe/.config/systemd/user/gmail-imap-tunnel@.service" => qr/disable/ , }, }, { name => 'basic-socket', backend_arg => 'gmail', file_contents_unlike => { "home/joe/.config/systemd/user/gmail-imap-tunnel.socket" => qr/disable/ , } }, { name => 'override-service', backend_arg => 'obex', setup => { 'main-obex' => '/usr/lib/systemd/user/obex.service', 'user-obex' => '~/.config/systemd/user/obex.service', }, check => [ 'service:obex Unit Description' => 'Le service Obex a la dent bleue', 'service:obex Unit Description' => { mode => 'user', value => 'Le service Obex a la dent bleue' }, 'service:obex Unit Description' => { mode => 'layered', value => 'Bluetooth OBEX service' }, ] }, { name => 'delete-service', backend_arg => 'obex.service', setup => { 'main-obex' => '/usr/lib/systemd/user/obex.service', 'user-obex' => '~/.config/systemd/user/obex.service', }, load => 'service:obex Unit Description~', check => [ 'service:obex Unit Description' => { mode => 'user', value => 'Bluetooth OBEX service' }, ], file_check_sub => sub { my $list_ref = shift ; # file added during tests @$list_ref = grep { /usr/ } @$list_ref ; } }, { name => 'from-scratch', backend_arg => 'test.service', load => 'service:test Unit Description="test from scratch"', file_contents_like => { "home/joe/.config/systemd/user/test.service" => qr/from scratch/ , }, } ); return { tests => \@tests, home_for_test=>'/home/joe', conf_dir => '~/.config/systemd/user/', config_file_name => 'systemd-user', } Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/0000755000175000017500000000000013575500330024167 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/basic-service/0000755000175000017500000000000013575500330026706 5ustar domidomi././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/basic-service/gmail-imap-tunnel@.serviceConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/basic-service/gmail-imap-tunne0000644000175000017500000000036313575500330031777 0ustar domidomi[Unit] Description=Tunnel IMAPS connections to Gmail with corkscrew [Service] #ExecStart=-/usr/bin/corkscrew 127.0.0.1 8888 imap.gmail.com 143 ExecStart=-/usr/bin/socat - PROXY:127.0.0.1:imap.gmail.com:993,proxyport=8888 StandardInput=socket Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/override-service/0000755000175000017500000000000013575500330027444 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/override-service/main-obex0000644000175000017500000000024613575500330031250 0ustar domidomi[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/override-service/user-obex0000644000175000017500000000006413575500330031300 0ustar domidomi[Unit] Description=Le service Obex a la dent bleue Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/delete-service/0000755000175000017500000000000013575500330027067 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/delete-service/main-obex0000644000175000017500000000024613575500330030673 0ustar domidomi[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-service-examples/delete-service/user-obex0000644000175000017500000000006413575500330030723 0ustar domidomi[Unit] Description=Le service Obex a la dent bleue Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/0000755000175000017500000000000013575500330023505 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-service/0000755000175000017500000000000013575500330026224 5ustar domidomi././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-service/gmail-imap-tunnel@.serviceConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-service/gmail-imap-tunnel@.0000644000175000017500000000036313575500330031647 0ustar domidomi[Unit] Description=Tunnel IMAPS connections to Gmail with corkscrew [Service] #ExecStart=-/usr/bin/corkscrew 127.0.0.1 8888 imap.gmail.com 143 ExecStart=-/usr/bin/socat - PROXY:127.0.0.1:imap.gmail.com:993,proxyport=8888 StandardInput=socket Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/override-service/0000755000175000017500000000000013575500330026762 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/override-service/main-obex0000644000175000017500000000024613575500330030566 0ustar domidomi[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/override-service/user-obex0000644000175000017500000000006413575500330030616 0ustar domidomi[Unit] Description=Le service Obex a la dent bleue Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/delete-service/0000755000175000017500000000000013575500330026405 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/delete-service/main-obex0000644000175000017500000000024613575500330030211 0ustar domidomi[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/delete-service/user-obex0000644000175000017500000000006413575500330030241 0ustar domidomi[Unit] Description=Le service Obex a la dent bleue Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-socket/0000755000175000017500000000000013575500330026054 5ustar domidomi././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-socket/gmail-imap-tunnel.socketConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-user-examples/basic-socket/gmail-imap-tunnel.so0000644000175000017500000000017013575500330031735 0ustar domidomi[Unit] Description=Socket for Gmail IMAP tunnel [Install] WantedBy=sockets.target [Socket] ListenStream=9995 Accept=1 Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-socket-examples/0000755000175000017500000000000013575500330024017 5ustar domidomiConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-socket-examples/basic-socket/0000755000175000017500000000000013575500330026366 5ustar domidomi././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-socket-examples/basic-socket/gmail-imap-tunnel.socketConfig-Model-Systemd-0.244.1/t/model_tests.d/systemd-socket-examples/basic-socket/gmail-imap-tunnel.0000644000175000017500000000017013575500330031705 0ustar domidomi[Unit] Description=Socket for Gmail IMAP tunnel [Install] WantedBy=sockets.target [Socket] ListenStream=9995 Accept=1 Config-Model-Systemd-0.244.1/t/model_tests.d/systemd-socket-test-conf.pl0000644000175000017500000000140613575500330024441 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # systemd tests for user use strict; use warnings; # list of tests. my @tests = ( { name => 'basic-socket', config_file => 'gmail-imap-tunnel.socket', check => [ 'Unit Description' => "Socket for Gmail IMAP tunnel", 'Install WantedBy:0' => 'sockets.target', 'Socket ListenStream:0' => 9995, 'Socket Accept' => "yes" ], file_contents_unlike => { "gmail-imap-tunnel.socket" => qr/disable/ , } }, ); return { tests => \@tests } ; Config-Model-Systemd-0.244.1/t/model_tests.t0000644000175000017500000000016213575500330017167 0ustar domidomi# -*- cperl -*- use warnings; use strict; use Config::Model::Tester 4.005; use ExtUtils::testlib; run_tests() ; Config-Model-Systemd-0.244.1/weaver.ini0000644000175000017500000000022513575500330016207 0ustar domidomi[@Default] [-Transformer] transformer = List [Support] perldoc = 0 bugs = metadata websites = search,anno,ratings,kwalitee,testers,testmatrix,deps Config-Model-Systemd-0.244.1/README-build-from-git.md0000644000175000017500000000332113575500330020313 0ustar domidomi# How to build Config::Model::Systemd from git repository `Config::Model::Systemd` is build with [Dist::Zilla](http://dzil.org/). This page details how to install the tools and dependencies required to build this module. ## Install tools and dependencies ### Debian, Ubuntu and derivatives Run $ sudo apt install libdist-zilla-perl libdist-zilla-app-command-authordebs-perl $ dzil authordebs --install $ sudo apt build-dep libconfig-model-systemd-perl The [libdist-zilla-app-command-authordebs-perl package](https://tracker.debian.org/pkg/libdist-zilla-app-command-authordebs-perl) is quite recent (uploaded on Dec 2016 in Debian/unstable) and may not be available yet on your favorite distribution. ### Other systems Run $ cpamn Dist::Zilla $ dzil authordeps -missing | cpanm --notest $ cpanm --quiet --notest --skip-satisfied MouseX::NativeTraits $ dzil listdeps --missing | cpanm --notest NB: The author would welcome pull requests that explains how to install these tools and dependencies using native package of other distributions. ## Build Config::Model::Systemd Run dzil build or dzil test `dzil` may complain about missing `EmailNotify` or `Twitter` plugin. You may ignore this or edit [dist.ini](dist.ini) to comment out the last 2 sections. These are useful only to the author when releasing a new version. `dzil` may also return an error like `Cannot determine local time zone`. In this case, you should specify explicitely your timezone in a `TZ` environement variable. E.g run `dzil` this way: TZ="Europe/Paris" dzil test The list of possible timezones is provided by [DateTime::TimeZone::Catalog](https://metacpan.org/pod/DateTime::TimeZone::Catalog) documentation. Config-Model-Systemd-0.244.1/Changes0000644000175000017500000001647613575500330015527 0ustar domidomi0.244.1 2019-12-15 Model update: * update parameters from systemd 244 source Model generator (parse-man.pl) changes: * parse-man: put C<> around XML filename * parse-man: store systemd version Other Changes: * use new style of model test * log at warn level when reading a sub layer file * don't mention migration in deprecation warnings * improve message when no info is found for a unit * use warn log to show user which resource is read * Fix to find service like Foo.service * Build requires Config::Model::Tester 4.005 0.240.1 2019-01-17 Model update: * update parameters from systemd 240 source * use auto-delete to cleanup empty config files (which requires Config::Model 2.133) Model generator (parse-man.pl) changes: * parse-man: set auto-delete for systemd backend * parse-man: infer choice from other enum Other changes: * add a message when creating a unit file * remove mentions of sourceforge mailing list in doc 0.239.1 2018-07-10 Systemd model update: * update from systemd 239 documentation 0.238.2 2018-05-07 Bug fix: * Fix file_path usage in Systemd* backends (Debian #897963) This requires Config::Model 2.123 * Show user message with User logger * added t/README.md 0.238.1 2018-03-29 Model update: * The script generating Systemd model from systemd documentation was modified to generate Systemd model from scratch. * Old systemd parameters are migrated to the new ones: * OnFailureIsolate in unit * RebootArgument * StartLimitInterval to StartLimitIntervalSec * SuccesAction and StartLimitBurst * FailureAction * updated from systemd 238 doc Other changes: * Systemd comments are now preserved * Build require Config::Model 2.118 0.236.1 2018-01-03 Systemd model update: * update from systemd 236 documentation * parse-man: cope with new structure of systemd.exec documentation 0.235.1 2017-10-14 Systemd model update: * update from systemd 235 documentation 0.234.2 2017-10-05 Update following deprecations done in Config::Model 2.111: * all models use rw_config (requires Config::Model 2.111) * parse_man: require Config::Model::Itself 2.012 0.234.1 2017-08-27 Systemd model update: * update from systemd 234 documentation 0.232.7 2017-06-24 This release brings quite a big change to the way cme is invoked for systemd. "cme systemd" and "cme systemd-user" commands now expect an argument. Either: - a pattern to select service names to edit - a unit name with or without service type I.e: cme check systemd '*' # check all units cme check systemd foo # check unit matching foo This release also let a developer edit a systemd file in some directory: cme edit systemd-service cme edit systemd-socket cme edit systemd-timer This new interfaces requires Config::Model >= 2.104 Fix parse-man.pl code that infer element type from documentation: * elements where doc mentions 'may be used more than once' are list element * more systemd parameters are type list (e.g Conflicts DeviceAllow, all parameters beginning with Listen, and others) 0.232.6 2017-01-15 Documentation improvement: * Respect paragraph format of original documentation. This improves a lot the readability of the documentation displayed in cme and on cpan website. 0.232.5 2017-01-13 Bug fix: * fix Unit Condition* parameters which are list type, not uniline (Debian #849490) 0.232.4 2016-12-30 Bug fix: * fix systemd-user load when config dir is missing (Debian #849490) 0.232.3 2016-12-12 Bug fix: * fix load of bad systemd files with -force option (require App::Cme 1.016 and Config::Model 2.096) * issue an error when a systemd parameter is specified twice (can be overriden with -force option) * issue a warning when an unknown parameter is found in a systemd file * avoid writing systemd default values in systemd file 0.232.2 2016-11-22 Add missing dependency on Config::Model 2.094 0.232.1 2016-11-20 Release again with correct version number. 0.231.3 2016-11-20 Systemd model update: * update with systemd 232 * specify default value of some integer parameters * can migrate deprecated resource-control parameters (for instance, cme replaces deprecated CPUWeight with CPUShares) Systemd parser update: * parser: enable 2 styles of comments (gh #1) Improved model generation from systemd doc (parse-man.pl): * model extraction: * fix enum values extraction * fix integer min max extraction * extract integer range from description * extract default value of integer param * detect and setup migration of deprecated parmaters * handle correctly integer with K|G|M suffix * description extraction: * remove obsolete utf8 cleanup in descrtipion * fix bug in description formatting * disable insertion of debian man page URL (this debian service is now down) 0.231.2 2016-11-13 Bug fix: * Fix parser bug triggered by unit name containing a dot 0.231.1 2016-10-27 This release uses a new version scheme where the 2nd field shows the version of Systemd supported by 'cme' Systemd model update: * update with systemd 231 * add support for Timer service Bug fix: * Systemd model: use new warp syntax (required Config::Model 2.087) * parse_man: use new warp syntax (Require Config::Model::Itself 2.005) * fix linkage of generated class in root class (parse-man) * remove socket service file when needed 0.007 2016-06-05 Bug fix: * Unit backend: fix read value of accepted elements Improved model generation from systemd doc: * parse-man: * Booleans are yes/no values * infer enum choice from "boolean or something else" as seen in Systemd doc. * parse-man dies when no option is used on command line * cannot extract info from IOSchedulingClass doc, this param is tweaked using specific instructions Generated model: * Booleans are yes/no values * "boolean or something else" are now enum type with choices: yes,no,somethin-else as specified in Systemd doc 0.006 2016-05-11 Bug fix: * do not write 'disable' param in systemd file Usability improvements: * dist.ini: recommends App::Cme and Config::Model::TkUI * improved abstract and description of Config::Model::Systemd 0.005 2016-05-09 * Added doc to the classes reading and writing systemd files 0.004 2016-05-07 Improved model generation from systemd doc: * parse_man: * infer enum (some? most?) from doc * handles Condition* variables.. * added -from parameter * added copyright and license info... * use debian service for man pages * preserve upstream doc formatting.. * regenerated model from systemd 228 with the changes above 0.003 2016-05-02 Fix utf-8 issues in pod documentation: * removed utf8 chars from generated model * parse_man: remove utf8 chars from systemd doc... * added test to check pod syntax 0.002 2016-04-26 Bug fixes: * Updated dependency versions: * Config::Model::Tester 2.054 * Config::Model 2.083 0.001 2016-04-23 Initial release Config-Model-Systemd-0.244.1/lib/0000755000175000017500000000000013575500330014764 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/0000755000175000017500000000000013575500330016171 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/0000755000175000017500000000000013575500330017231 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/system.d/0000755000175000017500000000000013575500330020777 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/system.d/systemd0000644000175000017500000000022513575500330022411 0ustar domidomimodel = Systemd require_backend_argument = 1 config_dir = /etc/systemd/system/ support_info = https://github.com/dod38fr/config-model-systemd/issues Config-Model-Systemd-0.244.1/lib/Config/Model/user.d/0000755000175000017500000000000013575500330020431 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/user.d/systemd-user0000644000175000017500000000031213575500330023014 0ustar domidomimodel = Systemd require_backend_argument = 1 backend_argument_info = unit name or pattern or * config_dir = ~/.config/systemd/user/ support_info = https://github.com/dod38fr/config-model-systemd/issues Config-Model-Systemd-0.244.1/lib/Config/Model/application.d/0000755000175000017500000000000013575500330021756 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/application.d/systemd-socket0000644000175000017500000000016613575500330024662 0ustar domidomimodel = Systemd::Socket require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues Config-Model-Systemd-0.244.1/lib/Config/Model/application.d/systemd-timer0000644000175000017500000000016513575500330024511 0ustar domidomimodel = Systemd::Timer require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues Config-Model-Systemd-0.244.1/lib/Config/Model/application.d/systemd-service0000644000175000017500000000016713575500330025033 0ustar domidomimodel = Systemd::Service require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues Config-Model-Systemd-0.244.1/lib/Config/Model/Systemd.pm0000644000175000017500000001612513575500330021224 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Systemd; $Config::Model::Systemd::VERSION = '0.244.1'; use strict; use warnings; use 5.10.1; use Config::Model 2.133; 1; # ABSTRACT: Editor and validator for systemd configuration files __END__ =pod =encoding UTF-8 =head1 NAME Config::Model::Systemd - Editor and validator for systemd configuration files =head1 VERSION version 0.244.1 =head1 SYNOPSIS =head2 command line Requires L: Handle all user units: $ cme edit systemd-user '*' $ cme check systemd-user '*' Handles all user units that match 'foo': $ cme edit systemd-user foo $ cme check systemd-user foo Check all root units: # cme check systemd '*' Check all root units that match 'foo': # cme check systemd foo Edit override file of C: # cme edit systemd foo.service Handle a service file: $ cme check systemd-service path/to/file.service $ cme edit systemd-service path/to/file.service Timer and socket units are also supported: $ cme check systemd-socket path/to/file.socket $ cme check systemd-timer path/to/file.timer =head2 Perl program (experimental) use Config::Model qw/cme/; cme(application => 'systemd-user' backend_arg => 'free') ->modify('socket:free-imap-tunnel Socket Accept=yes') ; cme(application => 'systemd-service', config_file => 'foo.service') ->modify('Unit Description="a service that does foo things"') =head1 DESCRIPTION This module provides a configuration editor for the configuration files of systemd, i.e. all files in C<~/.config/systemd/user/> or all files in C Ok. I simplified. In more details, this module provides the configuration models of Systemd configuration file that L, L and L use to provide a configuration editor (C) and checker (C). =head2 invoke editor The following command loads user systemd files (from C<~/.config/systemd/user/> and launch a graphical editor: cme edit systemd-user foo Likewise, the following command loads system systemd configuration files and launch a graphical editor to updated an override file (like C command): sudo cme edit systemd foo A developer can also edit a systemd file shipped with a software: cme edit systemd-service software-thing.service =head2 Just check systemd configuration You can also use L to run sanity checks on systemd configuration files: cme check systemd-user '*' cme check systemd '*' # may take time cme check systemd-service software-thing.service =head2 Use in Perl program (experimental) As of L 2.086, a L function is exported to modify configuration in a Perl program. For instance: use Config::Model qw/cme/; # also import cme function # call cme for systemd-user, modify ans save my-imap-tunnel.socket file. cme( application => 'systemd-user', backend_arg => 'my-imap-tunnel' )->modify('socket:my-imap-tunnel Socket Accept=yes') ; Similarly, system Systemd files can be modified using C application: use Config::Model qw/cme/; cme( application => 'systemd', backend_arg => 'foo' )->modify(...) ; For more details and parameters, please see L, L, L and L documentation. =begin :comment =head2 Fix warnings When run, cme may issue several warnings regarding the content of your file. You can choose to fix (most of) these warnings with the command: cme fix systemd-user =end :comment =head1 BUGS The list of supported parameters is extracted from the xml documentation provided by systemd project. This list is expected to be rather complete. The properties of these parameters are inferred from the description of the parameters and are probably less accurate. In case of errors, please L. =head1 TODO For now, only C, C and C files are supported. Please log a wishlist bug if you need other unit types to be supported. =head1 SUPPORT In case of issue, please log a bug on L. =head1 Contributors Mohammad S Anwar Thanks for your contributions =head1 SEE ALSO =over =item * L =item * L =item * L =back =head1 AUTHOR Dominique Dumont =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2015-2018 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * Search CPAN The default CPAN search engine, useful to view POD in HTML format. L =item * AnnoCPAN The AnnoCPAN is a website that allows community annotations of Perl module documentation. L =item * CPAN Ratings The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. L =item * CPANTS The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. L =item * CPAN Testers The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. L =item * CPAN Testers Matrix The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. L =item * CPAN Testers Dependencies The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. L =back =head2 Bugs / Feature Requests Please report any bugs or feature requests by email to C, or through the web interface at L. You will be automatically notified of any progress on the request by the system. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/dod38fr/config-model-systemd.git =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/0000755000175000017500000000000013575500330020514 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/0000755000175000017500000000000013575500330022144 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Socket.pl0000644000175000017500000000421413575500330023732 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'disable', { 'description' => 'When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details.', 'summary' => 'disable configuration file supplied by the vendor', 'type' => 'leaf', 'upstream_default' => '0', 'value_type' => 'boolean' }, 'Socket', { 'config_class_name' => 'Systemd::Section::Socket', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Unit', { 'config_class_name' => 'Systemd::Section::SocketUnit', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::Socket', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit', 'file' => '&index.socket' } } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Timer.pl0000644000175000017500000000420713575500330023564 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'disable', { 'description' => 'When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details.', 'summary' => 'disable configuration file supplied by the vendor', 'type' => 'leaf', 'upstream_default' => '0', 'value_type' => 'boolean' }, 'Timer', { 'config_class_name' => 'Systemd::Section::Timer', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Unit', { 'config_class_name' => 'Systemd::Section::TimerUnit', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::Timer', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit', 'file' => '&index.timer' } } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Service.pod0000644000175000017500000000245713575500330024260 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Service # ABSTRACT: Configuration class Systemd::Service =encoding utf8 =head1 NAME Config::Model::models::Systemd::Service - Configuration class Systemd::Service =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 disable - disable configuration file supplied by the vendor When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details. I< Optional. Type boolean. > =over 4 =item upstream_default value : 0 =back =head2 Service I< Optional. Type warped_node of class L . > =head2 Unit I< Optional. Type warped_node of class L . > =head2 Install I< Optional. Type warped_node of class L . > =head1 SEE ALSO =over =item * L =item * L =item * L =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Timer.pod0000644000175000017500000000243113575500330023730 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Timer # ABSTRACT: Configuration class Systemd::Timer =encoding utf8 =head1 NAME Config::Model::models::Systemd::Timer - Configuration class Systemd::Timer =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 disable - disable configuration file supplied by the vendor When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details. I< Optional. Type boolean. > =over 4 =item upstream_default value : 0 =back =head2 Timer I< Optional. Type warped_node of class L . > =head2 Unit I< Optional. Type warped_node of class L . > =head2 Install I< Optional. Type warped_node of class L . > =head1 SEE ALSO =over =item * L =item * L =item * L =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Socket.pod0000644000175000017500000000244413575500330024104 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Socket # ABSTRACT: Configuration class Systemd::Socket =encoding utf8 =head1 NAME Config::Model::models::Systemd::Socket - Configuration class Systemd::Socket =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 disable - disable configuration file supplied by the vendor When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details. I< Optional. Type boolean. > =over 4 =item upstream_default value : 0 =back =head2 Socket I< Optional. Type warped_node of class L . > =head2 Unit I< Optional. Type warped_node of class L . > =head2 Install I< Optional. Type warped_node of class L . > =head1 SEE ALSO =over =item * L =item * L =item * L =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/0000755000175000017500000000000013575500330023550 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Install.pl0000644000175000017500000001103313575500330025511 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'Alias', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'A space-separated list of additional names this unit shall be installed under. The names listed here must have the same suffix (i.e. type) as the unit filename. This option may be specified more than once, in which case all listed names are used. At installation time, systemctl enable will create symlinks from these names to the unit filename. Note that not all unit types support such alias names, and this setting is not supported for them. Specifically, mount, slice, swap, and automount units do not support aliasing.', 'type' => 'list' }, 'WantedBy', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'This option may be used more than once, or a space-separated list of unit names may be given. A symbolic link is created in the C<.wants/> or C<.requires/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect that a dependency of type C or C is added from the listed unit to the current unit. The primary result is that the current unit will be started when the listed unit is started. See the description of C and C in the [Unit] section for details. WantedBy=foo.service in a service C is mostly equivalent to Alias=foo.service.wants/bar.service in the same file. In case of template units, systemctl enable must be called with an instance name, and this instance will be added to the C<.wants/> or C<.requires/> list of the listed unit. E.g. WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. ', 'type' => 'list' }, 'RequiredBy', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'This option may be used more than once, or a space-separated list of unit names may be given. A symbolic link is created in the C<.wants/> or C<.requires/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect that a dependency of type C or C is added from the listed unit to the current unit. The primary result is that the current unit will be started when the listed unit is started. See the description of C and C in the [Unit] section for details. WantedBy=foo.service in a service C is mostly equivalent to Alias=foo.service.wants/bar.service in the same file. In case of template units, systemctl enable must be called with an instance name, and this instance will be added to the C<.wants/> or C<.requires/> list of the listed unit. E.g. WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. ', 'type' => 'list' }, 'Also', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Additional units to install/deinstall when this unit is installed/deinstalled. If the user requests installation/deinstallation of a unit with this option configured, systemctl enable and systemctl disable will automatically install/uninstall units listed in this option as well. This option may be used more than once, or a space-separated list of unit names may be given.', 'type' => 'list' }, 'DefaultInstance', { 'description' => 'In template unit files, this specifies for which instance the unit shall be enabled if the template is enabled without any explicitly set instance. This option has no effect in non-template unit files. The specified string must be usable as instance identifier.', 'type' => 'leaf', 'value_type' => 'uniline' } ], 'generated_by' => 'parseman.pl from systemd doc', 'name' => 'Systemd::Section::Install' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Socket.pl0000644000175000017500000011611413575500330025341 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'A unit configuration file whose name ends in C<.socket> encodes information about an IPC or network socket or a file system FIFO controlled and supervised by systemd, for socket-based activation. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The socket specific configuration options are configured in the C<[Socket]> section. Additional options are listed in L, which define the execution environment the C, C, C and C commands are executed in, and in L, which define the way the processes are terminated, and in L, which configure resource control settings for the processes of the socket. For each socket unit, a matching service unit must exist, describing the service to start on incoming traffic on the socket (see L for more information about .service units). The name of the .service unit is by default the same as the name of the .socket unit, but can be altered with the C option described below. Depending on the setting of the C option described below, this .service unit must either be named like the .socket unit, but with the suffix replaced, unless overridden with C; or it must be a template unit named the same way. Example: a socket file C needs a matching service C if C is set. If C is set, a service template C must exist from which services are instantiated for each incoming connection. No implicit C or C dependency from the socket to the service is added. This means that the service may be started without the socket, in which case it must be able to open sockets by itself. To prevent this, an explicit C dependency may be added. Socket units may be used to implement on-demand starting of services, as well as parallelized starting of services. See the blog stories linked at the end for an introduction. Note that the daemon software configured for socket activation with socket units needs to be able to accept sockets from systemd, either via systemd\'s native socket passing interface (see L for details) or via the traditional L-style socket passing (i.e. sockets passed in via standard input and output, using C in the service file). All network sockets allocated through C<.socket> units are allocated in the host\'s network namespace (see L). This does not mean however that the service activated by a configured socket unit has to be part of the host\'s network namespace as well. It is supported and even good practice to run services in their own network namespace (for example through C, see L), receiving only the sockets configured through socket-activation from the host\'s namespace. In such a set-up communication within the host\'s network namespace is only permitted through the activation sockets passed in while all sockets allocated from the service code itself will be associated with the service\'s own namespace, and thus possibly subject to a a much more restrictive configuration. This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'ListenStream', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below.', 'type' => 'list' }, 'ListenDatagram', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below.', 'type' => 'list' }, 'ListenSequentialPacket', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below.', 'type' => 'list' }, 'ListenFIFO', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies a file system FIFO to listen on. This expects an absolute file system path as argument. Behavior otherwise is very similar to the C directive above.', 'type' => 'list' }, 'ListenSpecial', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies a special file in the file system to listen on. This expects an absolute file system path as argument. Behavior otherwise is very similar to the C directive above. Use this to open character device nodes as well as special files in C and C.', 'type' => 'list' }, 'ListenNetlink', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies a Netlink family to create a socket for to listen on. This expects a short string referring to the C family name (such as C or C) as argument, optionally suffixed by a whitespace followed by a multicast group integer. Behavior otherwise is very similar to the C directive above.', 'type' => 'list' }, 'ListenMessageQueue', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies a POSIX message queue name to listen on. This expects a valid message queue name (i.e. beginning with /). Behavior otherwise is very similar to the C directive above. On Linux message queue descriptors are actually file descriptors and can be inherited between processes.', 'type' => 'list' }, 'ListenUSBFunction', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Specifies a USB FunctionFS endpoints location to listen on, for implementation of USB gadget functions. This expects an absolute file system path of functionfs mount point as the argument. Behavior otherwise is very similar to the C directive above. Use this to open the FunctionFS endpoint C. When using this option, the activated service has to have the C and C options set. ', 'type' => 'list' }, 'SocketProtocol', { 'choice' => [ 'udplite', 'sctp' ], 'description' => 'Takes one of C or C. Specifies a socket protocol (C) UDP-Lite (C) SCTP socket respectively.', 'type' => 'leaf', 'value_type' => 'enum' }, 'BindIPv6Only', { 'choice' => [ 'default', 'both', 'ipv6-only' ], 'description' => 'Takes one of C, C or C. Controls the IPV6_V6ONLY socket option (see L for details). If C, IPv6 sockets bound will be accessible via both IPv4 and IPv6. If C, they will be accessible via IPv6 only. If C (which is the default, surprise!), the system wide default setting is used, as controlled by C, which in turn defaults to the equivalent of C.', 'type' => 'leaf', 'value_type' => 'enum' }, 'Backlog', { 'description' => 'Takes an unsigned integer argument. Specifies the number of connections to queue that have not been accepted yet. This setting matters only for stream and sequential packet sockets. See L for details. Defaults to SOMAXCONN (128).', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BindToDevice', { 'description' => 'Specifies a network interface name to bind this socket to. If set, traffic will only be accepted from the specified network interfaces. This controls the SO_BINDTODEVICE socket option (see L for details). If this option is used, an implicit dependency from this socket unit on the network interface device unit (L is created. Note that setting this parameter might result in additional dependencies to be added to the unit (see above).', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SocketUser', { 'description' => 'Takes a UNIX user/group name. When specified, all AF_UNIX sockets and FIFO nodes in the file system are owned by the specified user and group. If unset (the default), the nodes are owned by the root user/group (if run in system context) or the invoking user/group (if run in user context). If only a user is specified but no group, then the group is derived from the user\'s default group.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SocketGroup', { 'description' => 'Takes a UNIX user/group name. When specified, all AF_UNIX sockets and FIFO nodes in the file system are owned by the specified user and group. If unset (the default), the nodes are owned by the root user/group (if run in system context) or the invoking user/group (if run in user context). If only a user is specified but no group, then the group is derived from the user\'s default group.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SocketMode', { 'description' => 'If listening on a file system socket or FIFO, this option specifies the file system access mode used when creating the file node. Takes an access mode in octal notation. Defaults to 0666.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'DirectoryMode', { 'description' => 'If listening on a file system socket or FIFO, the parent directories are automatically created if needed. This option specifies the file system access mode used when creating these directories. Takes an access mode in octal notation. Defaults to 0755.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Accept', { 'description' => 'Takes a boolean argument. If true, a service instance is spawned for each incoming connection and only the connection socket is passed to it. If false, all listening sockets themselves are passed to the started service unit, and only one service unit is spawned for all connections (also see above). This value is ignored for datagram sockets and FIFOs where a single service unit unconditionally handles all incoming traffic. Defaults to C. For performance reasons, it is recommended to write new daemons only in a way that is suitable for C. A daemon listening on an C socket may, but does not need to, call L on the received socket before exiting. However, it must not unlink the socket from a file system. It should not invoke L on sockets it got with C, but it may do so for sockets it got with C set. Setting C is mostly useful to allow daemons designed for usage with L to work unmodified with systemd socket activation. For IPv4 and IPv6 connections, the C environment variable will contain the remote IP address, and C will contain the remote port. This is the same as the format used by CGI. For SOCK_RAW, the port is the IP protocol.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Writable', { 'description' => 'Takes a boolean argument. May only be used in conjunction with C. If true, the specified special file is opened in read-write mode, if false, in read-only mode. Defaults to false.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'MaxConnections', { 'description' => 'The maximum number of connections to simultaneously run services instances for, when C is set. If more concurrent connections are coming in, they will be refused until at least one existing connection is terminated. This setting has no effect on sockets configured with C or datagram sockets. Defaults to 64.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MaxConnectionsPerSource', { 'description' => 'The maximum number of connections for a service per source IP address. This is very similar to the C directive above. Disabled by default.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'KeepAlive', { 'description' => 'Takes a boolean argument. If true, the TCP/IP stack will send a keep alive message after 2h (depending on the configuration of C) for all TCP streams accepted on this socket. This controls the SO_KEEPALIVE socket option (see L and the TCP Keepalive HOWTO for details.) Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'KeepAliveTimeSec', { 'description' => 'Takes time (in seconds) as argument. The connection needs to remain idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 7200 seconds (2 hours).', 'type' => 'leaf', 'value_type' => 'integer' }, 'KeepAliveIntervalSec', { 'description' => 'Takes time (in seconds) as argument between individual keepalive probes, if the socket option SO_KEEPALIVE has been set on this socket. This controls the TCP_KEEPINTVL socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 75 seconds.', 'type' => 'leaf', 'value_type' => 'integer' }, 'KeepAliveProbes', { 'description' => 'Takes an integer as argument. It is the number of unacknowledged probes to send before considering the connection dead and notifying the application layer. This controls the TCP_KEEPCNT socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 9.', 'type' => 'leaf', 'value_type' => 'integer' }, 'NoDelay', { 'description' => 'Takes a boolean argument. TCP Nagle\'s algorithm works by combining a number of small outgoing messages, and sending them all at once. This controls the TCP_NODELAY socket option (see L Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Priority', { 'description' => 'Takes an integer argument controlling the priority for all traffic sent from this socket. This controls the SO_PRIORITY socket option (see L for details.).', 'type' => 'leaf', 'value_type' => 'integer' }, 'DeferAcceptSec', { 'description' => 'Takes time (in seconds) as argument. If set, the listening process will be awakened only when data arrives on the socket, and not immediately when connection is established. When this option is set, the C socket option will be used (see L), and the kernel will ignore initial ACK packets without any data. The argument specifies the approximate amount of time the kernel should wait for incoming data before falling back to the normal behavior of honoring empty ACK packets. This option is beneficial for protocols where the client sends the data first (e.g. HTTP, in contrast to SMTP), because the server process will not be woken up unnecessarily before it can take any action. If the client also uses the C option, the latency of the initial connection may be reduced, because the kernel will send data in the final packet establishing the connection (the third packet in the "three-way handshake"). Disabled by default.', 'type' => 'leaf', 'value_type' => 'integer' }, 'ReceiveBuffer', { 'description' => 'Takes an integer argument controlling the receive or send buffer sizes of this socket, respectively. This controls the SO_RCVBUF and SO_SNDBUF socket options (see L for details.). The usual suffixes K, M, G are supported and are understood to the base of 1024.', 'match' => '^\\d+(?i)[KMG]$', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SendBuffer', { 'description' => 'Takes an integer argument controlling the receive or send buffer sizes of this socket, respectively. This controls the SO_RCVBUF and SO_SNDBUF socket options (see L for details.). The usual suffixes K, M, G are supported and are understood to the base of 1024.', 'match' => '^\\d+(?i)[KMG]$', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IPTOS', { 'description' => 'Takes an integer argument controlling the IP Type-Of-Service field for packets generated from this socket. This controls the IP_TOS socket option (see L for details.). Either a numeric string or one of C, C, C or C may be specified.', 'type' => 'leaf', 'value_type' => 'integer' }, 'IPTTL', { 'description' => 'Takes an integer argument controlling the IPv4 Time-To-Live/IPv6 Hop-Count field for packets generated from this socket. This sets the IP_TTL/IPV6_UNICAST_HOPS socket options (see L and L for details.)', 'type' => 'leaf', 'value_type' => 'integer' }, 'Mark', { 'description' => 'Takes an integer value. Controls the firewall mark of packets generated by this socket. This can be used in the firewall logic to filter packets from this socket. This sets the SO_MARK socket option. See L for details.', 'type' => 'leaf', 'value_type' => 'integer' }, 'ReusePort', { 'description' => 'Takes a boolean value. If true, allows multiple Ls to this TCP or UDP port. This controls the SO_REUSEPORT socket option. See L for details.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'SmackLabel', { 'description' => 'Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SmackLabelIPIn', { 'description' => 'Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SmackLabelIPOut', { 'description' => 'Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SELinuxContextFromNet', { 'description' => 'Takes a boolean argument. When true, systemd will attempt to figure out the SELinux label used for the instantiated service from the information handed by the peer over the network. Note that only the security level is used from the information provided by the peer. Other parts of the resulting SELinux context originate from either the target binary that is effectively triggered by socket unit or from the value of the C option. This configuration option only affects sockets with C mode set to C. Also note that this option is useful only when MLS/MCS SELinux policy is deployed. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PipeSize', { 'description' => 'Takes a size in bytes. Controls the pipe buffer size of FIFOs configured in this socket unit. See L for details. The usual suffixes K, M, G are supported and are understood to the base of 1024.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MessageQueueMaxMessages', { 'description' => 'These two settings take integer values and control the mq_maxmsg field or the mq_msgsize field, respectively, when creating the message queue. Note that either none or both of these variables need to be set. See L for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FreeBind', { 'description' => 'Takes a boolean value. Controls whether the socket can be bound to non-local IP addresses. This is useful to configure sockets listening on specific IP addresses before those IP addresses are successfully configured on a network interface. This sets the IP_FREEBIND socket option. For robustness reasons it is recommended to use this option whenever you bind a socket to a specific IP address. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Transparent', { 'description' => 'Takes a boolean value. Controls the IP_TRANSPARENT socket option. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Broadcast', { 'description' => 'Takes a boolean value. This controls the SO_BROADCAST socket option, which allows broadcast datagrams to be sent from this socket. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PassCredentials', { 'description' => 'Takes a boolean value. This controls the SO_PASSCRED socket option, which allows C sockets to receive the credentials of the sending process in an ancillary message. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PassSecurity', { 'description' => 'Takes a boolean value. This controls the SO_PASSSEC socket option, which allows C sockets to receive the security context of the sending process in an ancillary message. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'TCPCongestion', { 'description' => 'Takes a string value. Controls the TCP congestion algorithm used by this socket. Should be one of "westwood", "veno", "cubic", "lp" or any other available algorithm supported by the IP stack. This setting applies only to stream sockets.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ExecStartPre', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Takes one or more command lines, which are executed before or after the listening sockets/FIFOs are created and bound, respectively. The first token of the command line must be an absolute filename, then followed by arguments for the process. Multiple command lines may be specified following the same scheme as used for C of service unit files.', 'type' => 'list' }, 'ExecStartPost', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Takes one or more command lines, which are executed before or after the listening sockets/FIFOs are created and bound, respectively. The first token of the command line must be an absolute filename, then followed by arguments for the process. Multiple command lines may be specified following the same scheme as used for C of service unit files.', 'type' => 'list' }, 'ExecStopPre', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Additional commands that are executed before or after the listening sockets/FIFOs are closed and removed, respectively. Multiple command lines may be specified following the same scheme as used for C of service unit files.', 'type' => 'list' }, 'ExecStopPost', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Additional commands that are executed before or after the listening sockets/FIFOs are closed and removed, respectively. Multiple command lines may be specified following the same scheme as used for C of service unit files.', 'type' => 'list' }, 'TimeoutSec', { 'description' => 'Configures the time to wait for the commands specified in C, C, C and C to finish. If a command does not exit within the configured time, the socket will be considered failed and be shut down again. All commands still running will be terminated forcibly via C, and after another delay of this time with C. (See C in L.) Takes a unit-less value in seconds, or a time span value such as "5min 20s". Pass C<0> to disable the timeout logic. Defaults to C from the manager configuration file (see L). ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Service', { 'description' => 'Specifies the service unit name to activate on incoming traffic. This setting is only allowed for sockets with C. It defaults to the service that bears the same name as the socket (with the suffix replaced). In most cases, it should not be necessary to use this option. Note that setting this parameter might result in additional dependencies to be added to the unit (see above).', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RemoveOnStop', { 'description' => 'Takes a boolean argument. If enabled, any file nodes created by this socket unit are removed when it is stopped. This applies to AF_UNIX sockets in the file system, POSIX message queues, FIFOs, as well as any symlinks to them configured with C. Normally, it should not be necessary to use this option, and is not recommended as services might continue to run after the socket unit has been terminated and it should still be possible to communicate with them via their file system node. Defaults to off.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Symlinks', { 'description' => 'Takes a list of file system paths. The specified paths will be created as symlinks to the C socket path or FIFO path of this socket unit. If this setting is used, only one C socket in the file system or one FIFO may be configured for the socket unit. Use this option to manage one or more symlinked alias names for a socket, binding their lifecycle together. Note that if creation of a symlink fails this is not considered fatal for the socket unit, and the socket unit may still start. If an empty string is assigned, the list of paths is reset. Defaults to an empty list.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FileDescriptorName', { 'description' => 'Assigns a name to all file descriptors this socket unit encapsulates. This is useful to help activated services identify specific file descriptors, if multiple fds are passed. Services may use the L call to acquire the names configured for the received file descriptors. Names may contain any ASCII character, but must exclude control characters and C<:>, and must be at most 255 characters in length. If this setting is not used, the file descriptor name defaults to the name of the socket unit, including its C<.socket> suffix.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TriggerLimitIntervalSec', { 'description' => "Configures a limit on how often this socket unit my be activated within a specific time interval. The C may be used to configure the length of the time interval in the usual time units C, C, C, C, C, \x{2026} and defaults to 2s (See L for details on the various time units understood). The C setting takes a positive integer value and specifies the number of permitted activations per time interval, and defaults to 200 for C sockets (thus by default permitting 200 activations per 2s), and 20 otherwise (20 activations per 2s). Set either to 0 to disable any form of trigger rate limiting. If the limit is hit, the socket unit is placed into a failure mode, and will not be connectible anymore until restarted. Note that this limit is enforced before the service activation is enqueued.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'TriggerLimitBurst', { 'description' => "Configures a limit on how often this socket unit my be activated within a specific time interval. The C may be used to configure the length of the time interval in the usual time units C, C, C, C, C, \x{2026} and defaults to 2s (See L for details on the various time units understood). The C setting takes a positive integer value and specifies the number of permitted activations per time interval, and defaults to 200 for C sockets (thus by default permitting 200 activations per 2s), and 20 otherwise (20 activations per 2s). Set either to 0 to disable any form of trigger rate limiting. If the limit is hit, the socket unit is placed into a failure mode, and will not be connectible anymore until restarted. Note that this limit is enforced before the service activation is enqueued.", 'type' => 'leaf', 'value_type' => 'uniline' } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Socket' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Timer.pl0000644000175000017500000004317413575500330025176 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'A unit configuration file whose name ends in C<.timer> encodes information about a timer controlled and supervised by systemd, for timer-based activation. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The timer specific configuration options are configured in the C<[Timer]> section. For each timer file, a matching unit file must exist, describing the unit to activate when the timer elapses. By default, a service by the same name as the timer (except for the suffix) is activated. Example: a timer file C activates a matching service C. The unit to activate may be controlled by C (see below). Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running. There is no concept of spawning new service instances in this case. Due to this, services with C set (which stay around continuously even after the service\'s main process exited) are usually not suitable for activation via repetitive timers, as they will only be activated once, and then stay around forever. This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'OnActiveSec', { 'description' => 'Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnBootSec', { 'description' => 'Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnStartupSec', { 'description' => 'Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnUnitActiveSec', { 'description' => 'Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnUnitInactiveSec', { 'description' => 'Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnCalendar', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Defines realtime (i.e. wallclock) timers with calendar event expressions. See L for more information on the syntax of calendar event expressions. Otherwise, the semantics are similar to C and related settings. Note that timers do not necessarily expire at the precise time configured with this setting, as it is subject to the C setting below. May be specified more than once, in which case the timer unit will trigger whenever any of the specified expressions elapse. Moreover calendar timers and monotonic timers (see above) may be combined within the same timer unit. If the empty string is assigned to any of these options, the list of timers is reset (both C timers and monotonic timers, see above), and all prior assignments will have no effect.', 'type' => 'list' }, 'AccuracySec', { 'description' => 'Specify the accuracy the timer shall elapse with. Defaults to 1min. The timer is scheduled to elapse within a time window starting with the time specified in C, C, C, C, C or C and ending the time configured with C later. Within this time window, the expiry time will be placed at a host-specific, randomized, but stable position that is synchronized between all local timer units. This is done in order to optimize power consumption to suppress unnecessary CPU wake-ups. To get best accuracy, set this option to 1us. Note that the timer is still subject to the timer slack configured via L\'s C setting. See L for details. To optimize power consumption, make sure to set this value as high as possible and as low as necessary.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RandomizedDelaySec', { 'description' => 'Delay the timer by a randomly selected, evenly distributed amount of time between 0 and the specified time value. Defaults to 0, indicating that no randomized delay shall be applied. Each timer unit will determine this delay randomly before each iteration, and the delay will simply be added on top of the next determined elapsing time. This is useful to stretch dispatching of similarly configured timer events over a certain amount time, to avoid that they all fire at the same time, possibly resulting in resource congestion. Note the relation to C above: the latter allows the service manager to coalesce timer events within a specified time range in order to minimize wakeups, the former does the opposite: it stretches timer events over a time range, to make it unlikely that they fire simultaneously. If C and C are used in conjunction, first the randomized delay is added, and then the result is possibly further shifted to coalesce it with other timer events happening on the system. As mentioned above C defaults to 1min and C to 0, thus encouraging coalescing of timer events. In order to optimally stretch timer events over a certain range of time, make sure to set C to a higher value, and C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnClockChange', { 'description' => 'These options take boolean arguments. When true, the service unit will be triggered when the system clock (C) jumps relative to the monotonic clock (C), or when the local system timezone is modified. These options can be used alone or in combination with other timer expressions (see above) within the same timer unit. These options default to false.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnTimezoneChange', { 'description' => 'These options take boolean arguments. When true, the service unit will be triggered when the system clock (C) jumps relative to the monotonic clock (C), or when the local system timezone is modified. These options can be used alone or in combination with other timer expressions (see above) within the same timer unit. These options default to false.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Unit', { 'description' => 'The unit to activate when this timer elapses. The argument is a unit name, whose suffix is not C<.timer>. If not specified, this value defaults to a service that has the same name as the timer unit, except for the suffix. (See above.) It is recommended that the unit name that is activated and the unit name of the timer unit are named identically, except for the suffix.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Persistent', { 'description' => "Takes a boolean argument. If true, the time when the service unit was last triggered is stored on disk. When the timer is activated, the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. This is useful to catch up on missed runs of the service when the system was powered down. Note that this setting only has an effect on timers configured with C. Defaults to C. Use systemctl clean --what=state \x{2026} on the timer unit to remove the timestamp file maintained by this option from disk. In particular, use this command before uninstalling a timer unit. See L for details.", 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'WakeSystem', { 'description' => 'Takes a boolean argument. If true, an elapsing timer will cause the system to resume from suspend, should it be suspended and if the system supports this. Note that this option will only make sure the system resumes on the appropriate times, it will not take care of suspending it again after any work that is to be done is finished. Defaults to C. Note that this functionality requires privileges and is thus generally only available in the system service manager.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RemainAfterElapse', { 'description' => 'Takes a boolean argument. If true, an elapsed timer will stay loaded, and its state remains queryable. If false, an elapsed timer unit that cannot elapse anymore is unloaded. Turning this off is particularly useful for transient timer units that shall disappear after they first elapse. Note that this setting has an effect on repeatedly starting a timer unit that only elapses once: if C is on, it will not be started again, and is guaranteed to elapse only once. However, if C is off, it might be started again if it is already elapsed, and thus be triggered multiple times. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Timer' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Service.pod0000644000175000017500000077101513575500330025667 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::Service # ABSTRACT: Configuration class Systemd::Section::Service =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::Service - Configuration class Systemd::Section::Service =head1 DESCRIPTION Configuration classes used by L A unit configuration file whose name ends in C<.service> encodes information about a process controlled and supervised by systemd. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The service specific configuration options are configured in the C<[Service]> section. Additional options are listed in L, which define the execution environment the commands are executed in, and in L, which define the way the processes of the service are terminated, and in L, which configure resource control settings for the processes of the service. If a service is requested under a certain name but no unit configuration file is found, systemd looks for a SysV init script by the same name (with the C<.service> suffix removed) and dynamically creates a service unit from that script. This is useful for compatibility with SysV. Note that this compatibility is quite comprehensive but not 100%. For details about the incompatibilities, see the Incompatibilities with SysV document. The L command allows creating C<.service> and C<.scope> units dynamically and transiently from the command line. This configuration class was generated from systemd documentation. by L =head1 Elements =head2 CPUAccounting Turn on CPU usage accounting for this unit. Takes a boolean argument. Note that turning on CPU accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. I< Optional. Type boolean. > =head2 CPUWeight Assign the specified CPU time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the C control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see cgroup-v2.txt and sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. These settings replace C and C. I< Optional. Type integer. > =over 4 =item upstream_default value : 100 =back =head2 StartupCPUWeight Assign the specified CPU time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the C control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see cgroup-v2.txt and sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. These settings replace C and C. I< Optional. Type integer. > =over 4 =item upstream_default value : 100 =back =head2 CPUQuota Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the C attribute on the unified control group hierarchy and C on legacy. For details about these control group attributes, see cgroup-v2.txt and sched-bwc.txt. Example: C ensures that the executed processes will never get more than 20% CPU time on one CPU. I< Optional. Type uniline. > =head2 CPUQuotaPeriodSec Assign the duration over which the CPU time quota specified by C is measured. Takes a time duration value in seconds, with an optional suffix such as "ms" for milliseconds (or "s" for seconds.) The default setting is 100ms. The period is clamped to the range supported by the kernel, which is [1ms, 1000ms]. Additionally, the period is adjusted up so that the quota interval is also at least 1ms. Setting C to an empty value resets it to the default. This controls the second field of C attribute on the unified control group hierarchy and C on legacy. For details about these control group attributes, see cgroup-v2.txt and sched-design-CFS.txt. Example: C to request that the CPU quota is measured in periods of 10ms. I< Optional. Type uniline. > =head2 AllowedCPUs Restrict processes to be executed on specific CPUs. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. Setting C doesn't guarantee that all of the CPUs will be used by the processes as it may be limited by parent units. The effective configuration is reported as C. This setting is supported only with the unified control group hierarchy. I< Optional. Type uniline. > =head2 AllowedMemoryNodes Restrict processes to be executed on specific memory NUMA nodes. Takes a list of memory NUMA nodes indices or ranges separated by either whitespace or commas. Memory NUMA nodes ranges are specified by the lower and upper CPU indices separated by a dash. Setting C doesn't guarantee that all of the memory NUMA nodes will be used by the processes as it may be limited by parent units. The effective configuration is reported as C. This setting is supported only with the unified control group hierarchy. I< Optional. Type uniline. > =head2 MemoryAccounting Turn on process and kernel memory accounting for this unit. Takes a boolean argument. Note that turning on memory accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. I< Optional. Type boolean. > =head2 MemoryMin Specify the memory usage protection of the executed processes in this unit. If the memory usages of this unit and all its ancestors are below their minimum boundaries, this unit's memory won't be reclaimed. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, all available memory is protected, which may be useful in order to always inherit all of the protection afforded by ancestors. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. Units may have their children use a default C value by specifying C, which has the same semantics as C. This setting does not affect C in the unit itself. I< Optional. Type uniline. > =head2 MemoryLow Specify the best-effort memory usage protection of the executed processes in this unit. If the memory usages of this unit and all its ancestors are below their low boundaries, this unit's memory won't be reclaimed as long as memory can be reclaimed from unprotected units. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, all available memory is protected, which may be useful in order to always inherit all of the protection afforded by ancestors. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. Units may have their children use a default C value by specifying C, which has the same semantics as C. This setting does not affect C in the unit itself. I< Optional. Type uniline. > =head2 MemoryHigh Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away aggressively in such cases. This is the main mechanism to control memory usage of a unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory throttling is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. I< Optional. Type uniline. > =head2 MemoryMax Specify the absolute limit on memory usage of the executed processes in this unit. If memory usage cannot be contained under the limit, out-of-memory killer is invoked inside the unit. It is recommended to use C as the main control mechanism and use C as the last line of defense. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory limit is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting replaces C. I< Optional. Type uniline. > =head2 MemorySwapMax Specify the absolute limit on swap usage of the executed processes in this unit. Takes a swap size in bytes. If the value is suffixed with K, M, G or T, the specified swap size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value C, no swap limit is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. I< Optional. Type uniline. > =head2 TasksAccounting Turn on task accounting for this unit. Takes a boolean argument. If enabled, the system manager will keep track of the number of tasks in the unit. The number of tasks accounted this way includes both kernel threads and userspace processes, with each thread counting individually. Note that turning on tasks accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. I< Optional. Type boolean. > =head2 TasksMax Specify the maximum number of tasks that may be created in the unit. This ensures that the number of tasks accounted for the unit (see above) stays below a specific limit. This either takes an absolute number of tasks or a percentage value that is taken relative to the configured maximum number of tasks on the system. If assigned the special value C, no tasks limit is applied. This controls the C control group attribute. For details about this control group attribute, see pids.txt. The system default for this setting may be controlled with C in L. I< Optional. Type uniline. > =head2 IOAccounting Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. This setting replaces C and disables settings prefixed with C or C. I< Optional. Type boolean. > =head2 IOWeight Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 100. For details about this control group attribute, see cgroup-v2.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. These settings replace C and C and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 StartupIOWeight Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 100. For details about this control group attribute, see cgroup-v2.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. These settings replace C and C and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 IODeviceWeight Set the per-device overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 1 and 10000. (Example: C). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see cgroup-v2.txt. This setting replaces C and disables settings prefixed with C or C. I< Optional. Type uniline. > =head2 IOReadBandwidthMax Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings replace C and C and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 IOWriteBandwidthMax Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings replace C and C and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 IOReadIOPSMax Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the C control group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 IOWriteIOPSMax Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the C control group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with C or C. I< Optional. Type uniline. > =head2 IODeviceLatencyTargetSec Set the per-device average target I/O latency for the executed processes, if the unified control group hierarchy is used on the system. Takes a file path and a timespan separated by a space to specify the device specific latency target. (Example: "/dev/sda 25ms"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute. Use this option multiple times to set latency target for multiple devices. For details about this control group attribute, see cgroup-v2.txt. Implies C. These settings are supported only if the unified control group hierarchy is used. I< Optional. Type uniline. > =head2 IPAccounting Takes a boolean argument. If true, turns on IPv4 and IPv6 network traffic accounting for packets sent or received by the unit. When this option is turned on, all IPv4 and IPv6 sockets created by any process of the unit are accounted for. When this option is used in socket units, it applies to all IPv4 and IPv6 sockets associated with it (including both listening and connection sockets where this applies). Note that for socket-activated services, this configuration setting and the accounting data of the service unit and the socket unit are kept separate, and displayed separately. No propagation of the setting and the collected statistics is done, in either direction. Moreover, any traffic sent or received on any of the socket unit's sockets is accounted to the socket unit — and never to the service unit it might have activated, even if the socket is used by it. The system default for this setting may be controlled with C in L. I< Optional. Type boolean. > =head2 IPAddressAllow Turn on address range network traffic filtering for IP packets sent and received over C and C sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits (separated by a C character). If the latter is omitted, the address is considered a host address, i.e. the prefix covers the whole address (32 for IPv4, 128 for IPv6). The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default all access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source IP address is checked against these access lists, in case of egress traffic the destination IP address is checked. When configured the lists are enforced as follows: In order to implement a whitelisting IP firewall, it is recommended to use a CC setting on an upper-level slice unit (such as the root slice C<-.slice> or the slice containing all system services C – see L for details on these slice units), plus individual per-service C lines permitting network access to relevant services, and only them. Note that for socket-activated services, the IP access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP access lists on both the socket and the service unit, however it often makes sense to maintain one list more open and the other one more restricted, depending on the usecase. If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for IP security. I< Optional. Type uniline. > =head2 IPAddressDeny Turn on address range network traffic filtering for IP packets sent and received over C and C sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits (separated by a C character). If the latter is omitted, the address is considered a host address, i.e. the prefix covers the whole address (32 for IPv4, 128 for IPv6). The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default all access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source IP address is checked against these access lists, in case of egress traffic the destination IP address is checked. When configured the lists are enforced as follows: In order to implement a whitelisting IP firewall, it is recommended to use a CC setting on an upper-level slice unit (such as the root slice C<-.slice> or the slice containing all system services C – see L for details on these slice units), plus individual per-service C lines permitting network access to relevant services, and only them. Note that for socket-activated services, the IP access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP access lists on both the socket and the service unit, however it often makes sense to maintain one list more open and the other one more restricted, depending on the usecase. If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for IP security. I< Optional. Type uniline. > =head2 IPIngressFilterPath Add custom network traffic filters implemented as BPF programs, applying to all IP packets sent and received over C and C sockets. Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (C). The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any C and C filters in any of these units. By default there are no filters specified. If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. Note that for socket-activated services, the IP filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires CC) instead of using this setting. I< Optional. Type uniline. > =head2 IPEgressFilterPath Add custom network traffic filters implemented as BPF programs, applying to all IP packets sent and received over C and C sockets. Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (C). The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any C and C filters in any of these units. By default there are no filters specified. If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. Note that for socket-activated services, the IP filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires CC) instead of using this setting. I< Optional. Type uniline. > =head2 DeviceAllow Control access to specific device nodes by the executed processes. Takes two space-separated strings: a device node specifier followed by a combination of C, C, C to control reading, writing, or creation of the specific device node(s) by the unit (mknod), respectively. On cgroup-v1 this controls the C control group attribute. For details about this control group attribute, see devices.txt. On cgroup-v2 this functionality is implemented using eBPF filtering. The device node specifier is either a path to a device node in the file system, starting with C, or a string starting with either C or C followed by a device group name, as listed in C. The latter is useful to whitelist all current and future devices belonging to a specific device group at once. The device group is matched according to filename globbing rules, you may hence use the C<*> and C wildcards. (Note that such globbing wildcards are not available for device node path specifications!) In order to match device nodes by numeric major/minor, use device node paths in the C and C directories. However, matching devices by major/minor is generally not recommended as assignments are neither stable nor portable between systems or different kernel versions. Examples: C is a path to a device node, referring to an ATA or SCSI block device. C and C are specifiers for all pseudo TTYs and all ALSA sound devices, respectively. C is a specifier matching all CPU related device groups. Note that whitelists defined this way should only reference device groups which are resolvable at the time the unit is started. Any device groups not resolvable then are not added to the device whitelist. In order to work around this limitation, consider extending service units with an ExecStartPre=/sbin/modprobe… line that loads the necessary kernel module implementing the device group if missing. Example: … [Service] ExecStartPre=-/sbin/modprobe -abq loop DeviceAllow=block-loop DeviceAllow=/dev/loop-control … I< Optional. Type list of uniline. > =head2 DevicePolicy Control the policy for allowing device access: I< Optional. Type enum. choice: 'auto', 'closed', 'strict'. > =head2 Slice The name of the slice unit to place the unit in. Defaults to C for all non-instantiated units of all unit types (except for slice units themselves see below). Instance units are by default placed in a subslice of C that is named after the template name. This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied. For units of type slice, the only accepted value for this setting is the parent slice. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units. Special care should be taken when relying on the default slice assignment in templated service units that have C set, see L, section "Default Dependencies" for details. I< Optional. Type uniline. > =head2 Delegate Turns on delegation of further resource control partitioning to processes of the unit. Units where this is enabled may create and manage their own private subhierarchy of control groups below the control group of the unit itself. For unprivileged services (i.e. those using the C setting) the unit's control group will be made accessible to the relevant user. When enabled the service manager will refrain from manipulating control groups or moving processes below the unit's control group, so that a clear concept of ownership is established: the control group tree above the unit's control group (i.e. towards the root control group) is owned and managed by the service manager of the host, while the control group tree below the unit's control group is owned and managed by the unit itself. Takes either a boolean argument or a list of control group controller names. If true, delegation is turned on, and all supported controllers are enabled for the unit, making them available to the unit's processes for management. If false, delegation is turned off entirely (and no additional controllers are enabled). If set to a list of controllers, delegation is turned on, and the specified controllers are enabled for the unit. Note that additional controllers than the ones specified might be made available as well, depending on configuration of the containing slice unit or other units contained in it. Note that assigning the empty string will enable delegation, but reset the list of controllers, all assignments prior to this will have no effect. Defaults to false. Note that controller delegation to less privileged code is only safe on the unified control group hierarchy. Accordingly, access to the specified controllers will not be granted to unprivileged services on the legacy hierarchy, even when requested. The following controller names may be specified: C, C, C, C, C, C, C. Not all of these controllers are available on all kernels however, and some are specific to the unified hierarchy while others are specific to the legacy hierarchy. Also note that the kernel might support further controllers, which aren't covered here yet as delegation is either not supported at all for them or not defined cleanly. For further details on the delegation model consult Control Group APIs and Delegation. I< Optional. Type uniline. > =head2 DisableControllers Disables controllers from being enabled for a unit's children. If a controller listed is already in use in its subtree, the controller will be removed from the subtree. This can be used to avoid child units being able to implicitly or explicitly enable a controller. Defaults to not disabling any controllers. It may not be possible to successfully disable a controller if the unit or any child of the unit in question delegates controllers to its children, as any delegated subtree of the cgroup hierarchy is unmanaged by systemd. Multiple controllers may be specified, separated by spaces. You may also pass C multiple times, in which case each new instance adds another controller to disable. Passing C by itself with no controller name present resets the disabled controller list. Valid controllers are C, C, C, C, C, C, and C. I< Optional. Type uniline. > =head2 CPUShares Assign the specified CPU time share weight to the processes executed. These options take an integer value and control the C control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time share weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type integer. > =over 4 =item upstream_default value : 1024 =back =head2 StartupCPUShares Assign the specified CPU time share weight to the processes executed. These options take an integer value and control the C control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time share weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type integer. > =over 4 =item upstream_default value : 1024 =back =head2 MemoryLimit Specify the limit on maximum memory usage of the executed processes. The limit specifies how much process and kernel memory can be used by tasks in this unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory limit is applied. This controls the C control group attribute. For details about this control group attribute, see memory.txt. Implies C. This setting is deprecated. Use C instead. I< Optional. Type uniline. > =head2 BlockIOAccounting Turn on Block I/O accounting for this unit, if the legacy control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. This setting is deprecated. Use C instead. I< Optional. Type boolean. > =head2 BlockIOWeight Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 500. For details about this control group attribute, see blkio-controller.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type uniline. > =head2 StartupBlockIOWeight Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 500. For details about this control group attribute, see blkio-controller.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type uniline. > =head2 BlockIODeviceWeight Set the per-device overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 10 and 1000. (Example: "/dev/sda 500"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute, which defaults to 1000. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see blkio-controller.txt. Implies C. This setting is deprecated. Use C instead. I< Optional. Type uniline. > =head2 BlockIOReadBandwidth Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C and C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see blkio-controller.txt. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type uniline. > =head2 BlockIOWriteBandwidth Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C and C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see blkio-controller.txt. Implies C. These settings are deprecated. Use C and C instead. I< Optional. Type uniline. > =head2 WorkingDirectory Takes a directory path relative to the service's root directory specified by C, or the special value C<~>. Sets the working directory for executed processes. If set to C<~>, the home directory of the user specified in C is used. If not set, defaults to the root directory when systemd is running as a system instance and the respective user's home directory if run as user. If the setting is prefixed with the C<-> character, a missing working directory is not considered fatal. If C/C is not set, then C is relative to the root of the system running the service manager. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). I< Optional. Type uniline. > =head2 RootDirectory Takes a directory path relative to the host's root directory (i.e. the root of the system running the service manager). Sets the root directory for executed processes, with the L system call. If this is used, it must be ensured that the process binary and all its auxiliary files are available in the chroot() jail. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). The C and C settings are particularly useful in conjunction with C. For details, see below. I< Optional. Type uniline. > =head2 RootImage Takes a path to a block device node or regular file as argument. This call is similar to C however mounts a file system hierarchy from a block device node or loopback file instead of a directory. The device node or file system image file needs to contain a file system without a partition table, or a file system within an MBR/MS-DOS or GPT partition table with only a single Linux-compatible partition, or a set of file systems within a GPT partition table that follows the Discoverable Partitions Specification. When C is set to C or C, or set to C and C is set, then this setting adds C with C mode, C and C with C mode to C. See L for the details about C or C. Also, see C below, as it may change the setting of C. I< Optional. Type uniline. > =head2 MountAPIVFS Takes a boolean argument. If on, a private mount namespace for the unit's processes is created and the API file systems C, C, and C are mounted inside of it, unless they are already mounted. Note that this option has no effect unless used in conjunction with C/C as these three mounts are generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace will be a 1:1 copy of the host's, and include these three mounts. Note that the C file system of the host is bind mounted if this option is used without C. To run the service with a private, minimal version of C, combine this option with C. I< Optional. Type boolean. > =head2 BindPaths Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit's view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host's mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either C or C for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. C creates regular writable bind mounts (unless the source file system mount is already marked read-only), while C creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit's list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. This option is particularly useful when C/C is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in C, or under C and other protected directories if C is specified. C with C<:ro> or C should be used instead. I< Optional. Type list of uniline. > =head2 BindReadOnlyPaths Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit's view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host's mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either C or C for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. C creates regular writable bind mounts (unless the source file system mount is already marked read-only), while C creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit's list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. This option is particularly useful when C/C is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in C, or under C and other protected directories if C is specified. C with C<:ro> or C should be used instead. I< Optional. Type list of uniline. > =head2 User Set the UNIX user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric ID as argument. For system services (services run by the system service manager, i.e. managed by PID 1) and for user services of the root user (services managed by root's instance of systemd --user), the default is C, but C may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with C<+>. Note that restrictions on the user/group name syntax are enforced: the specified name must consist only of the characters a-z, A-Z, 0-9, C<_> and C<->, except for the first character which must be one of a-z, A-Z or C<_> (i.e. numbers and C<-> are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. When used in conjunction with C the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped — unless it is already allocated statically (see below). If C is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the L facility, which is applied at boot or package install time. If the C setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the C setting (see below). I< Optional. Type uniline. > =head2 Group Set the UNIX user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric ID as argument. For system services (services run by the system service manager, i.e. managed by PID 1) and for user services of the root user (services managed by root's instance of systemd --user), the default is C, but C may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with C<+>. Note that restrictions on the user/group name syntax are enforced: the specified name must consist only of the characters a-z, A-Z, 0-9, C<_> and C<->, except for the first character which must be one of a-z, A-Z or C<_> (i.e. numbers and C<-> are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. When used in conjunction with C the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped — unless it is already allocated statically (see below). If C is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the L facility, which is applied at boot or package install time. If the C setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the C setting (see below). I< Optional. Type uniline. > =head2 DynamicUser Takes a boolean parameter. If set, a UNIX user and group pair is allocated dynamically when the unit is started, and released as soon as it is stopped. The user and group will not be added to C or C, but are managed transiently during runtime. The L glibc NSS module provides integration of these dynamic users/groups into the system's user and group databases. The user and group name to use may be configured via C and C (see above). If these options are not used and dynamic user/group allocation is enabled for a unit, the name of the dynamic user/group is implicitly derived from the unit name. If the unit name without the type suffix qualifies as valid user name it is used directly, otherwise a name incorporating a hash of it is used. If a statically allocated user or group of the configured name already exists, it is used and no dynamic user/group is allocated. Note that if C is specified and the static group with the name exists, then it is required that the static user with the name already exists. Similarly, if C is specified and the static user with the name exists, then it is required that the static group with the name already exists. Dynamic users/groups are allocated from the UID/GID range 61184…65519. It is recommended to avoid this range for regular system or login users. At any point in time each UID/GID from this range is only assigned to zero or one dynamically allocated users/groups in use. However, UID/GIDs are recycled after a unit is terminated. Care should be taken that any processes running as part of a unit for which dynamic users/groups are enabled do not leave files or directories owned by these users/groups around, as a different unit might get the same UID/GID assigned later on, and thus gain access to these files or directories. If C is enabled, C and C are implied (and cannot be turned off). This ensures that the lifetime of IPC objects and temporary files created by the executed processes is bound to the runtime of the service, and hence the lifetime of the dynamic user/group. Since C and C are usually the only world-writable directories on a system this ensures that a unit making use of dynamic user/group allocation cannot leave files around after unit termination. Furthermore C and C are implicitly enabled (and cannot be disabled), to ensure that processes invoked cannot take benefit or create SUID/SGID files or directories. Moreover C and C are implied, thus prohibiting the service to write to arbitrary file system locations. In order to allow the service to write to certain directories, they have to be whitelisted using C, but care must be taken so that UID/GID recycling doesn't create security issues involving files created by the service. Use C (see below) in order to assign a writable runtime directory to a service, owned by the dynamic user/group and removed automatically when the unit is terminated. Use C, C and C in order to assign a set of writable directories for specific purposes to the service in a way that they are protected from vulnerabilities due to UID reuse (see below). If this option is enabled, care should be taken that the unit's processes do not get access to directories outside of these explicitly configured and managed ones. Specifically, do not use C and be careful with C file descriptor passing for directory file descriptors, as this would permit processes to create files or directories owned by the dynamic user/group that are not subject to the lifecycle and access guarantees of the service. Defaults to off. I< Optional. Type boolean. > =head2 SupplementaryGroups Sets the supplementary Unix groups the processes are executed as. This takes a space-separated list of group names or IDs. This option may be specified more than once, in which case all listed groups are set as supplementary groups. When the empty string is assigned, the list of supplementary groups is reset, and all assignments prior to this one will have no effect. In any way, this option does not override, but extends the list of supplementary groups configured in the system group database for the user. This does not affect commands prefixed with C<+>. I< Optional. Type list of uniline. > =head2 PAMName Sets the PAM service name to set up a session as. If set, the executed process will be registered as a PAM session under the specified service name. This is only useful in conjunction with the C setting, and is otherwise ignored. If not set, no PAM session will be opened for the executed processes. See L for details. Note that for each unit making use of this option a PAM session handler process will be maintained as part of the unit and stays around as long as the unit is active, to ensure that appropriate actions can be taken when the unit and hence the PAM session terminates. This process is named C<(sd-pam)> and is an immediate child process of the unit's main process. Note that when this option is used for a unit it is very likely (depending on PAM configuration) that the main unit process will be migrated to its own session scope unit when it is activated. This process will hence be associated with two units: the unit it was originally started from (and for which C was configured), and the session scope unit. Any child processes of that process will however be associated with the session scope unit only. This has implications when used in combination with CC, as these child processes will not be able to affect changes in the original unit through notification messages. These messages will be considered belonging to the session scope unit and not the original unit. It is hence not recommended to use C in combination with CC. I< Optional. Type uniline. > =head2 CapabilityBoundingSet Controls which capabilities to include in the capability bounding set for the executed process. See L for details. Takes a whitespace-separated list of capability names, e.g. C, C, C. Capabilities listed will be included in the bounding set, all others are removed. If the list of capabilities is prefixed with C<~>, all but the listed capabilities will be included, the effect of the assignment inverted. Note that this option also affects the respective capabilities in the effective, permitted and inheritable capability sets. If this option is not used, the capability bounding set is not modified on process execution, hence no limits on the capabilities of the process are enforced. This option may appear more than once, in which case the bounding sets are merged by C, or by C if the lines are prefixed with C<~> (see below). If the empty string is assigned to this option, the bounding set is reset to the empty capability set, and all prior settings have no effect. If set to C<~> (without any further argument), the bounding set is reset to the full set of available capabilities, also undoing any previous settings. This does not affect commands prefixed with C<+>. Example: if a unit has the following, CapabilityBoundingSet=CAP_A CAP_B CapabilityBoundingSet=CAP_B CAP_C then C, C, and C are set. If the second line is prefixed with C<~>, e.g., CapabilityBoundingSet=CAP_A CAP_B CapabilityBoundingSet=~CAP_B CAP_C then, only C is set. I< Optional. Type uniline. > =head2 AmbientCapabilities Controls which capabilities to include in the ambient capability set for the executed process. Takes a whitespace-separated list of capability names, e.g. C, C, C. This option may appear more than once in which case the ambient capability sets are merged (see the above examples in C). If the list of capabilities is prefixed with C<~>, all but the listed capabilities will be included, the effect of the assignment inverted. If the empty string is assigned to this option, the ambient capability set is reset to the empty capability set, and all prior settings have no effect. If set to C<~> (without any further argument), the ambient capability set is reset to the full set of available capabilities, also undoing any previous settings. Note that adding capabilities to ambient capability set adds them to the process's inherited capability set. Ambient capability sets are useful if you want to execute a process as a non-privileged user but still want to give it some capabilities. Note that in this case option C is automatically added to C to retain the capabilities over the user change. C does not affect commands prefixed with C<+>. I< Optional. Type uniline. > =head2 NoNewPrivileges Takes a boolean argument. If true, ensures that the service process and all its children can never gain new privileges through execve() (e.g. via setuid or setgid bits, or filesystem capabilities). This is the simplest and most effective way to ensure that a process and its children can never elevate privileges again. Defaults to false, but certain settings override this and ignore the value of this setting. This is the case when C, C, C, C, C, C, C, C, C, C, C, C or C are specified. Note that even if this setting is overridden by them, systemctl show shows the original value of this setting. Also see No New Privileges Flag. I< Optional. Type boolean. > =head2 SecureBits Controls the secure bits set for the executed process. Takes a space-separated combination of options from the following list: C, C, C, C, C, and C. This option may appear more than once, in which case the secure bits are ORed. If the empty string is assigned to this option, the bits are reset to 0. This does not affect commands prefixed with C<+>. See L for details. I< Optional. Type uniline. > =head2 SELinuxContext Set the SELinux security context of the executed process. If set, this will override the automated domain transition. However, the policy still needs to authorize the transition. This directive is ignored if SELinux is disabled. If prefixed by C<->, all errors will be ignored. This does not affect commands prefixed with C<+>. See L for details. I< Optional. Type uniline. > =head2 AppArmorProfile Takes a profile name as argument. The process executed by the unit will switch to this profile when started. Profiles must already be loaded in the kernel, or the unit will fail. This result in a non operation if AppArmor is not enabled. If prefixed by C<->, all errors will be ignored. This does not affect commands prefixed with C<+>. I< Optional. Type uniline. > =head2 SmackProcessLabel Takes a C security label as argument. The process executed by the unit will be started under this label and SMACK will decide whether the process is allowed to run or not, based on it. The process will continue to run under the label specified here unless the executable has its own C label, in which case the process will transition to run under that label. When not specified, the label that systemd is running under is used. This directive is ignored if SMACK is disabled. The value may be prefixed by C<->, in which case all errors will be ignored. An empty value may be specified to unset previous assignments. This does not affect commands prefixed with C<+>. I< Optional. Type uniline. > =head2 LimitCPU Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitFSIZE Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitDATA Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitSTACK Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitCORE Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitRSS Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitNOFILE Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitAS Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitNPROC Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitMEMLOCK Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitLOCKS Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitSIGPENDING Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitMSGQUEUE Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitNICE Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitRTPRIO Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 LimitRTTIME Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, … options available in L, and – if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above). I< Optional. Type uniline. > =head2 UMask Controls the file mode creation mask. Takes an access mode in octal notation. See L for details. Defaults to 0022. I< Optional. Type uniline. > =head2 KeyringMode Controls how the kernel session keyring is set up for the service (see L for details on the session keyring). Takes one of C, C, C. If set to C no special keyring setup is done, and the kernel's default behaviour is applied. If C is used a new session keyring is allocated when a service process is invoked, and it is not linked up with any user keyring. This is the recommended setting for system services, as this ensures that multiple services running under the same system user ID (in particular the root user) do not share their key material among each other. If C is used a new session keyring is allocated as for C, but the user keyring of the user configured with C is linked into it, so that keys assigned to the user may be requested by the unit's processes. In this modes multiple units running processes under the same user ID may share key material. Unless C is selected the unique invocation ID for the unit (see below) is added as a protected key by the name C to the newly created session keyring. Defaults to C for services of the system service manager and to C for non-service units and for services of the user service manager. I< Optional. Type enum. choice: 'inherit', 'private', 'shared'. > =head2 OOMScoreAdjust Sets the adjustment value for the Linux kernel's Out-Of-Memory (OOM) killer score for executed processes. Takes an integer between -1000 (to disable OOM killing of processes of this unit) and 1000 (to make killing of processes of this unit under memory pressure very likely). See proc.txt for details. If not specified defaults to the OOM score adjustment level of the service manager itself, which is normally at 0. Use the C setting of service units to configure how the service manager shall react to the kernel OOM killer terminating a process of the service. See L for details. I< Optional. Type integer. > =head2 TimerSlackNSec Sets the timer slack in nanoseconds for the executed processes. The timer slack controls the accuracy of wake-ups triggered by timers. See L for more information. Note that in contrast to most other time span definitions this parameter takes an integer value in nano-seconds if no unit is specified. The usual time units are understood too. I< Optional. Type uniline. > =head2 Personality Controls which kernel architecture L shall report, when invoked by unit processes. Takes one of the architecture identifiers C, C, C, C, C, C, C or C. Which personality architectures are supported depends on the system architecture. Usually the 64bit versions of the various system architectures support their immediate 32bit personality architecture counterpart, but no others. For example, C systems support the C and C personalities but no others. The personality feature is useful when running 32-bit services on a 64-bit host system. If not specified, the personality is left unmodified and thus reflects the personality of the host system's kernel. I< Optional. Type enum. choice: 'x86', 'x86-64', 'ppc', 'ppc-le', 'ppc64', 'ppc64-le', 's390', 's390x'. > =head2 IgnoreSIGPIPE Takes a boolean argument. If true, causes C to be ignored in the executed process. Defaults to true because C generally is useful only in shell pipelines. I< Optional. Type boolean. > =head2 Nice Sets the default nice level (scheduling priority) for executed processes. Takes an integer between -20 (highest priority) and 19 (lowest priority). See L for details. I< Optional. Type integer. > =head2 CPUSchedulingPolicy Sets the CPU scheduling policy for executed processes. Takes one of C, C, C, C or C. See L for details. I< Optional. Type enum. choice: 'other', 'batch', 'idle', 'fifo', 'rr'. > =head2 CPUSchedulingPriority Sets the CPU scheduling priority for executed processes. The available priority range depends on the selected CPU scheduling policy (see above). For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority) can be used. See L for details. I< Optional. Type uniline. > =head2 CPUSchedulingResetOnFork Takes a boolean argument. If true, elevated CPU scheduling priorities and policies will be reset when the executed processes fork, and can hence not leak into child processes. See L for details. Defaults to false. I< Optional. Type boolean. > =head2 CPUAffinity Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than once, in which case the specified CPU affinity masks are merged. If the empty string is assigned, the mask is reset, all assignments prior to this will have no effect. See L for details. I< Optional. Type list of uniline. > =head2 NUMAPolicy Controls the NUMA memory policy of the executed processes. Takes a policy type, one of: C, C, C, C and C. A list of NUMA nodes that should be associated with the policy must be specified in C. For more details on each policy please see, L. For overall overview of NUMA support in Linux see, L I< Optional. Type uniline. > =head2 NUMAMask Controls the NUMA node list which will be applied alongside with selected NUMA policy. Takes a list of NUMA nodes and has the same syntax as a list of CPUs for C option. Note that the list of NUMA nodes is not required for C and C policies and for C policy we expect a single NUMA node. I< Optional. Type uniline. > =head2 IOSchedulingClass Sets the I/O scheduling class for executed processes. Takes an integer between 0 and 3 or one of the strings C, C, C or C. If the empty string is assigned to this option, all prior assignments to both C and C have no effect. See L for details. I< Optional. Type enum. choice: '0', '1', '2', '3', 'none', 'realtime', 'best-effort', 'idle'. > =head2 IOSchedulingPriority Sets the I/O scheduling priority for executed processes. Takes an integer between 0 (highest priority) and 7 (lowest priority). The available priorities depend on the selected I/O scheduling class (see above). If the empty string is assigned to this option, all prior assignments to both C and C have no effect. See L for details. I< Optional. Type integer. > =head2 ProtectSystem Takes a boolean argument or the special values C or C. If true, mounts the C and C directories read-only for processes invoked by this unit. If set to C, the C directory is mounted read-only, too. If set to C the entire file system hierarchy is mounted read-only, except for the API file system subtrees C, C and C (protect these directories using C, C, C). This setting ensures that any modification of the vendor-supplied operating system (and optionally its configuration, and local mounts) is prohibited for the service. It is recommended to enable this setting for all long-running services, unless they are involved with system updates or need to modify the operating system in other ways. If this option is used, C may be used to exclude specific directories from being made read-only. This setting is implied if C is set. This setting cannot ensure protection in all cases. In general it has the same limitations as C, see below. Defaults to off. I< Optional. Type enum. choice: 'no', 'yes', 'full', 'strict'. > =head2 ProtectHome Takes a boolean argument or the special values C or C. If true, the directories C, C, and C are made inaccessible and empty for processes invoked by this unit. If set to C, the three directories are made read-only instead. If set to C, temporary file systems are mounted on the three directories in read-only mode. The value C is useful to hide home directories not relevant to the processes invoked by the unit, while still allowing necessary directories to be made visible when listed in C or C. Setting this to C is mostly equivalent to set the three directories in C. Similarly, C is mostly equivalent to C, and C is mostly equivalent to C with C<:ro>. It is recommended to enable this setting for all long-running services (in particular network-facing ones), to ensure they cannot get access to private user data, unless the services actually require access to the user's private data. This setting is implied if C is set. This setting cannot ensure protection in all cases. In general it has the same limitations as C, see below. I< Optional. Type enum. choice: 'no', 'yes', 'read-only', 'tmpfs'. > =head2 RuntimeDirectory These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, …). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean … command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C. I< Optional. Type uniline. > =head2 StateDirectory These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, …). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean … command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C. I< Optional. Type uniline. > =head2 CacheDirectory These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, …). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean … command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C. I< Optional. Type uniline. > =head2 LogsDirectory These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, …). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean … command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C. I< Optional. Type uniline. > =head2 ConfigurationDirectory These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, …). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean … command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C. I< Optional. Type uniline. > =head2 RuntimeDirectoryMode Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits. I< Optional. Type uniline. > =head2 StateDirectoryMode Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits. I< Optional. Type uniline. > =head2 CacheDirectoryMode Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits. I< Optional. Type uniline. > =head2 LogsDirectoryMode Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits. I< Optional. Type uniline. > =head2 ConfigurationDirectoryMode Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits. I< Optional. Type uniline. > =head2 RuntimeDirectoryPreserve Takes a boolean argument or C. If set to C (the default), the directories specified in C are always removed when the service stops. If set to C the directories are preserved when the service is both automatically and manually restarted. Here, the automatic restart means the operation specified in C, and manual restart means the one triggered by systemctl restart foo.service. If set to C, then the directories are not removed when the service is stopped. Note that since the runtime directory C is a mount point of C, then for system services the directories specified in C are removed when the system is rebooted. I< Optional. Type enum. choice: 'no', 'yes', 'restart'. > =head2 TimeoutCleanSec Configures a timeout on the clean-up operation requested through systemctl clean …, see L for details. Takes the usual time values and defaults to C, i.e. by default no time-out is applied. If a time-out is configured the clean operation will be aborted forcibly when the time-out is reached, potentially leaving resources on disk. I< Optional. Type uniline. > =head2 ReadWritePaths Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C. I< Optional. Type list of uniline. > =head2 ReadOnlyPaths Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C. I< Optional. Type list of uniline. > =head2 InaccessiblePaths Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C. I< Optional. Type list of uniline. > =head2 TemporaryFileSystem Takes a space-separated list of mount points for temporary file systems (tmpfs). If set, a new file system namespace is set up for executed processes, and a temporary file system is mounted on each mount point. This option may be specified more than once, in which case temporary file systems are mounted on all listed mount points. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. Each mount point may optionally be suffixed with a colon (C<:>) and mount options such as C or C. By default, each temporary file system is mounted with C. These can be disabled by explicitly specifying the corresponding mount options, e.g., C or C. This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary files or directories can be still accessed by combining with C or C: Example: if a unit has the following, TemporaryFileSystem=/var:ro BindReadOnlyPaths=/var/lib/systemd then the invoked processes by the unit cannot see any files or directories under C except for C or its contents. I< Optional. Type list of uniline. > =head2 PrivateTmp Takes a boolean argument. If true, sets up a new file system namespace for the executed processes and mounts private C and C directories inside it that is not shared by processes outside of the namespace. This is useful to secure access to temporary files of the process, but makes sharing between processes via C or C impossible. If this is enabled, all temporary files created by a service in these directories will be removed after the service is stopped. Defaults to false. It is possible to run two or more units within the same private C and C namespace by using the C directive, see L for details. This setting is implied if C is set. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Enabling this setting has the side effect of adding C and C dependencies on all mount units necessary to access C and C. Moreover an implicitly C ordering on L is added. Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. I< Optional. Type boolean. > =head2 PrivateDevices Takes a boolean argument. If true, sets up a new C mount for the executed processes and only adds API pseudo devices such as C, C or C (as well as the pseudo TTY subsystem) to it, but no physical devices such as C, system memory C, system ports C and others. This is useful to securely turn off physical device access by the executed process. Defaults to false. Enabling this option will install a system call filter to block low-level I/O system calls that are grouped in the C<@raw-io> set, will also remove C and C from the capability bounding set for the unit (see above), and set C (see L for details). Note that using this setting will disconnect propagation of mounts from the service to the host (propagation in the opposite direction continues to work). This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. The new C will be mounted read-only and 'noexec'. The latter may break old programs which try to set up executable memory by using L of C instead of using C. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. I< Optional. Type boolean. > =head2 PrivateNetwork Takes a boolean argument. If true, sets up a new network namespace for the executed processes and configures only the loopback network device C inside it. No other network devices will be available to the executed process. This is useful to turn off network access by the executed process. Defaults to false. It is possible to run two or more units within the same private network namespace by using the C directive, see L for details. Note that this option will disconnect all socket families from the host, including C and C. Effectively, for C this means that device configuration events received from L are not delivered to the unit's processes. And for C this has the effect that C sockets in the abstract socket namespace of the host will become unavailable to the unit's processes (however, those located in the file system will continue to be accessible). Note that the implementation of this setting might be impossible (for example if network namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within a private network namespace. This may be combined with C to listen on sockets inside of network namespaces of other services. I< Optional. Type boolean. > =head2 NetworkNamespacePath Takes an absolute file system path refererring to a Linux network namespace pseudo-file (i.e. a file like C or a bind mount or symlink to one). When set the invoked processes are added to the network namespace referenced by that path. The path has to point to a valid namespace file at the moment the processes are forked off. If this option is used C has no effect. If this option is used together with C then it only has an effect if this unit is started before any of the listed units that have C or C configured, as otherwise the network namespace of those units is reused. When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within the specified network namespace. I< Optional. Type uniline. > =head2 PrivateUsers Takes a boolean argument. If true, sets up a new user namespace for the executed processes and configures a minimal user and group mapping, that maps the C user and group as well as the unit's own user and group to themselves and everything else to the C user and group. This is useful to securely detach the user and group databases used by the unit from the rest of the system, and thus to create an effective sandbox environment. All files, directories, processes, IPC objects and other resources owned by users/groups not equaling C or the unit's own will stay visible from within the unit but appear owned by the C user and group. If this mode is enabled, all unit processes are run without privileges in the host user namespace (regardless if the unit's own user/group is C or not). Specifically this means that the process will have zero process capabilities on the host's user namespace, but full capabilities within the service's user namespace. Settings such as C will affect only the latter, and there's no way to acquire additional capabilities in the host's user namespace. Defaults to off. This setting is particularly useful in conjunction with C/C, as the need to synchronize the user and group databases in the root directory and on the host is reduced, as the only users and groups who need to be matched are C, C and the unit's own user and group. Note that the implementation of this setting might be impossible (for example if user namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. I< Optional. Type boolean. > =head2 ProtectHostname Takes a boolean argument. When set, sets up a new UTS namespace for the executed processes. In addition, changing hostname or domainname is prevented. Defaults to off. Note that the implementation of this setting might be impossible (for example if UTS namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. Note that when this option is enabled for a service hostname changes no longer propagate from the system into the service, it is hence not suitable for services that need to take notice of system hostname changes dynamically. I< Optional. Type boolean. > =head2 ProtectKernelTunables Takes a boolean argument. If true, kernel variables accessible through C, C, C, C, C, C, C and C will be made read-only to all processes of the unit. Usually, tunable kernel variables should be initialized only at boot-time, for example with the L mechanism. Few services need to write to these at runtime; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Defaults to off. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. services for which C is set), C is implied. Note that this option does not prevent indirect changes to kernel tunables effected by IPC calls to other processes. However, C may be used to make relevant IPC file system objects inaccessible. If C is set, C is implied. I< Optional. Type boolean. > =head2 ProtectKernelModules Takes a boolean argument. If true, explicit module loading will be denied. This allows module load and unload operations to be turned off on modular kernels. It is recommended to turn this on for most services that do not need special file systems or extra kernel modules to work. Defaults to off. Enabling this option removes C from the capability bounding set for the unit, and installs a system call filter to block module system calls, also C is made inaccessible. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Note that limited automatic module loading due to user configuration or kernel mapping tables might still happen as side effect of requested user operations, both privileged and unprivileged. To disable module auto-load feature please see LC mechanism and C documentation. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. I< Optional. Type boolean. > =head2 ProtectKernelLogs Takes a boolean argument. If true, access to the kernel log ring buffer will be denied. It is recommended to turn this on for most services that do not need to read from or write to the kernel log ring buffer. Enabling this option removes C from the capability bounding set for this unit, and installs a system call filter to block the L system call (not to be confused with the libc API L for userspace logging). The kernel exposes its log buffer to userspace via C and C. If enabled, these are made inaccessible to all the processes in the unit. I< Optional. Type boolean. > =head2 ProtectControlGroups Takes a boolean argument. If true, the Linux Control Groups (L) hierarchies accessible through C will be made read-only to all processes of the unit. Except for container managers no services should require write access to the control groups hierarchies; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Defaults to off. If C is set, C is implied. I< Optional. Type boolean. > =head2 RestrictAddressFamilies Restricts the set of socket address families accessible to the processes of this unit. Takes a space-separated list of address family names to whitelist, such as C, C or C. When prefixed with C<~> the listed address families will be applied as blacklist, otherwise as whitelist. Note that this restricts access to the L system call only. Sockets passed into the process by other means (for example, by using socket activation with socket units, see L) are unaffected. Also, sockets created with socketpair() (which creates connected AF_UNIX sockets only) are unaffected. Note that this option has no effect on 32-bit x86, s390, s390x, mips, mips-le, ppc, ppc-le, pcc64, ppc64-le and is ignored (but works correctly on other ABIs, including x86-64). Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. By default, no restrictions apply, all address families are accessible to processes. If assigned the empty string, any previous address family restriction changes are undone. This setting does not affect commands prefixed with C<+>. Use this option to limit exposure of processes to remote access, in particular via exotic and sensitive network protocols, such as C. Note that in most cases, the local C address family should be included in the configured whitelist as it is frequently used for local communication, including for L logging. I< Optional. Type uniline. > =head2 RestrictNamespaces Restricts access to Linux namespace functionality for the processes of this unit. For details about Linux namespaces, see L. Either takes a boolean argument, or a space-separated list of namespace type identifiers. If false (the default), no restrictions on namespace creation and switching are made. If true, access to any kind of namespacing is prohibited. Otherwise, a space-separated list of namespace type identifiers must be specified, consisting of any combination of: C, C, C, C, C, C and C. Any namespace type listed is made accessible to the unit's processes, access to namespace types not listed is prohibited (whitelisting). By prepending the list with a single tilde character (C<~>) the effect may be inverted: only the listed namespace types will be made inaccessible, all unlisted ones are permitted (blacklisting). If the empty string is assigned, the default namespace restrictions are applied, which is equivalent to false. This option may appear more than once, in which case the namespace types are merged by C, or by C if the lines are prefixed with C<~> (see examples below). Internally, this setting limits access to the L, L and L system calls, taking the specified flags parameters into account. Note that — if this option is used — in addition to restricting creation and switching of the specified types of namespaces (or all of them, if true) access to the setns() system call with a zero flags parameter is prohibited. This setting is only supported on x86, x86-64, mips, mips-le, mips64, mips64-le, mips64-n32, mips64-le-n32, ppc64, ppc64-le, s390 and s390x, and enforces no restrictions on other architectures. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Example: if a unit has the following, RestrictNamespaces=cgroup ipc RestrictNamespaces=cgroup net then C, C, and C are set. If the second line is prefixed with C<~>, e.g., RestrictNamespaces=cgroup ipc RestrictNamespaces=~cgroup net then, only C is set. I< Optional. Type uniline. > =head2 LockPersonality Takes a boolean argument. If set, locks down the L system call so that the kernel execution domain may not be changed from the default or the personality selected with C directive. This may be useful to improve security, because odd personality emulations may be poorly tested and source of vulnerabilities. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. I< Optional. Type boolean. > =head2 MemoryDenyWriteExecute Takes a boolean argument. If set, attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable are prohibited. Specifically, a system call filter is added that rejects L system calls with both C and C set, L or L system calls with C set and L system calls with C set. Note that this option is incompatible with programs and libraries that generate program code dynamically at runtime, including JIT execution engines, executable stacks, and code "trampoline" feature of various C compilers. This option improves service security, as it makes harder for software exploits to change running code dynamically. However, the protection can be circumvented, if the service can write to a filesystem, which is not mounted with C (such as C), or it can use memfd_create(). This can be prevented by making such file systems inaccessible to the service (e.g. C) and installing further system call filters (C). Note that this feature is fully available on x86-64, and partially on x86. Specifically, the shmat() protection is not available on x86. Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. I< Optional. Type boolean. > =head2 RestrictRealtime Takes a boolean argument. If set, any attempts to enable realtime scheduling in a process of the unit are refused. This restricts access to realtime task scheduling policies such as C, C or C. See L for details about these scheduling policies. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Realtime scheduling policies may be used to monopolize CPU time for longer periods of time, and may hence be used to lock up or otherwise trigger Denial-of-Service situations on the system. It is hence recommended to restrict access to realtime scheduling to the few programs that actually require them. Defaults to off. I< Optional. Type boolean. > =head2 RestrictSUIDSGID Takes a boolean argument. If set, any attempts to set the set-user-ID (SUID) or set-group-ID (SGID) bits on files or directories will be denied (for details on these bits see L). If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. As the SUID/SGID bits are mechanisms to elevate privileges, and allows users to acquire the identity of other users, it is recommended to restrict creation of SUID/SGID files to the few programs that actually require them. Note that this restricts marking of any type of file system object with these bits, including both regular files and directories (where the SGID is a different meaning than for files, see documentation). This option is implied if C is enabled. Defaults to off. I< Optional. Type boolean. > =head2 RemoveIPC Takes a boolean parameter. If set, all System V and POSIX IPC objects owned by the user and group the processes of this unit are run as are removed when the unit is stopped. This setting only has an effect if at least one of C, C and C are used. It has no effect on IPC objects owned by the root user. Specifically, this removes System V semaphores, as well as System V and POSIX shared memory segments and message queues. If multiple units use the same user or group the IPC objects are removed when the last of these units is stopped. This setting is implied if C is set. I< Optional. Type boolean. > =head2 PrivateMounts Takes a boolean parameter. If set, the processes of this unit will be run in their own private file system (mount) namespace with all mount propagation from the processes towards the host's main file system namespace turned off. This means any file system mount points established or removed by the unit's processes will be private to them and not be visible to the host. However, file system mount points established or removed on the host will be propagated to the unit's processes. See L for details on file system namespaces. Defaults to off. When turned on, this executes three operations for each invoked process: a new C namespace is created, after which all existing mounts are remounted to C to disable propagation from the unit's processes to the host (but leaving propagation in the opposite direction in effect). Finally, the mounts are remounted again to the propagation mode configured with C, see below. File system namespaces are set up individually for each process forked off by the service manager. Mounts established in the namespace of the process created by C will hence be cleaned up automatically as soon as that process exits and will not be available to subsequent processes forked off for C (and similar applies to the various other commands configured for units). Similarly, C does not permit sharing kernel mount namespaces between units, it only enables sharing of the C and C directories. Other file system namespace unit settings — C, C, C, C, C, C, C, C, … — also enable file system namespacing in a fashion equivalent to this option. Hence it is primarily useful to explicitly request this behaviour if none of the other settings are used. I< Optional. Type boolean. > =head2 MountFlags Takes a mount propagation setting: C, C or C, which controls whether file system mount points in the file system namespaces set up for this unit's processes will receive or propagate mounts and unmounts from other file system namespaces. See L for details on mount propagation, and the three propagation flags in particular. This setting only controls the final propagation setting in effect on all mount points of the file system namespace created for each process of this unit. Other file system namespacing unit settings (see the discussion in C above) will implicitly disable mount and unmount propagation from the unit's processes towards the host by changing the propagation setting of all mount points in the unit's file system namepace to C first. Setting this option to C does not reestablish propagation in that case. If not set – but file system namespaces are enabled through another file system namespace unit setting – C mount propagation is used, but — as mentioned — as C is applied first, propagation from the unit's processes to the host is still turned off. It is not recommended to to use C mount propagation for units, as this means temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked off processes, as unmount propagation events won't be received by the file system namespace of the unit. Usually, it is best to leave this setting unmodified, and use higher level file system namespacing options instead, in particular C, see above. I< Optional. Type uniline. > =head2 SystemCallFilter Takes a space-separated list of system call names. If this setting is used, all system calls executed by the unit processes except for the listed ones will result in immediate process termination with the C signal (whitelisting). (See C below for changing the default action). If the first character of the list is C<~>, the effect is inverted: only the listed system calls will result in immediate process termination (blacklisting). Blacklisted system calls and system call groups may optionally be suffixed with a colon (C<:>) and C error number (between 0 and 4095) or errno name such as C, C or C (see L for a full list). This value will be returned when a blacklisted system call is triggered, instead of terminating the processes immediately. This value takes precedence over the one given in C, see below. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel ('seccomp filtering') and is useful for enforcing a minimal sandboxing environment. Note that the execve, exit, exit_group, getrlimit, rt_sigreturn, sigreturn system calls and the system calls for querying time and sleeping are implicitly whitelisted and do not need to be listed explicitly. This option may be specified more than once, in which case the filter masks are merged. If the empty string is assigned, the filter is reset, all prior assignments will have no effect. This does not affect commands prefixed with C<+>. Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. Note that strict system call filters may impact execution and error handling code paths of the service invocation. Specifically, access to the execve system call is required for the execution of the service binary — if it is blocked service invocation will necessarily fail. Also, if execution of the service binary fails for some reason (for example: missing service executable), the error handling logic might require access to an additional set of system calls in order to process and log this failure correctly. It might be necessary to temporarily disable system call filters in order to simplify debugging of such failures. If you specify both types of this option (i.e. whitelisting and blacklisting), the first encountered will take precedence and will dictate the default action (termination or approval of a system call). Then the next occurrences of this option will add or delete the listed system calls from the set of the filtered system calls, depending of its type and the default action. (For example, if you have started with a whitelisting of read and write, and right after it add a blacklisting of write, then write will be removed from the set.) As the number of possible system calls is large, predefined sets of system calls are provided. A set starts with C<@> character, followed by name of the set. Currently predefined system call setsSetDescription@aioAsynchronous I/O (L, L, and related calls)@basic-ioSystem calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing (L, L, and related calls)@chownChanging file ownership (L, L, and related calls)@clockSystem calls for changing the system clock (L, L, and related calls)@cpu-emulationSystem calls for CPU emulation functionality (L and related calls)@debugDebugging, performance monitoring and tracing functionality (L, L and related calls)@file-systemFile system operations: opening, creating files and directories for read and write, renaming and removing them, reading file properties, or creating hard and symbolic links.@io-eventEvent loop system calls (L, L, L, L and related calls)@ipcPipes, SysV IPC, POSIX Message Queues and other IPC (L, L)@keyringKernel keyring access (L and related calls)@memlockLocking of memory into RAM (L, L and related calls)@moduleLoading and unloading of kernel modules (L, L and related calls)@mountMounting and unmounting of file systems (L, L, and related calls)@network-ioSocket I/O (including local AF_UNIX): L, L@obsoleteUnusual, obsolete or unimplemented (L, L, …)@privilegedAll system calls which need super-user capabilities (L)@processProcess control, execution, namespaceing operations (L, L, L, …@raw-ioRaw I/O port access (L, L, pciconfig_read(), …)@rebootSystem calls for rebooting and reboot preparation (L, kexec(), …)@resourcesSystem calls for changing resource limits, memory and scheduling parameters (L, L, …)@setuidSystem calls for changing user ID and group ID credentials, (L, L, L, …)@signalSystem calls for manipulating and handling process signals (L, L, …)@swapSystem calls for enabling/disabling swap devices (L, L)@syncSynchronizing files and memory to disk: (L, L, and related calls)@system-serviceA reasonable set of system calls used by common system services, excluding any special purpose calls. This is the recommended starting point for whitelisting system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: C<@clock>, C<@mount>, C<@swap>, C<@reboot>.@timerSystem calls for scheduling operations by time (L, L, …) Note, that as new system calls are added to the kernel, additional system calls might be added to the groups above. Contents of the sets may also change between systemd versions. In addition, the list of system calls depends on the kernel version and architecture for which systemd was compiled. Use systemd-analyze syscall-filter to list the actual list of system calls in each filter. Generally, whitelisting system calls (rather than blacklisting) is the safer mode of operation. It is recommended to enforce system call whitelists for all long-running system services. Specifically, the following lines are a relatively safe basic choice for the majority of system services: Note that various kernel system calls are defined redundantly: there are multiple system calls for executing the same operation. For example, the pidfd_send_signal() system call may be used to execute operations similar to what can be done with the older kill() system call, hence blocking the latter without the former only provides weak protection. Since new system calls are added regularly to the kernel as development progresses, keeping system call blacklists comprehensive requires constant work. It is thus recommended to use whitelisting instead, which offers the benefit that new system calls are by default implicitly blocked until the whitelist is updated. Also note that a number of system calls are required to be accessible for the dynamic linker to work. The dynamic linker is required for running most regular programs (specifically: all dynamic ELF binaries, which is how most distributions build packaged programs). This means that blocking these system calls (which include open(), openat() or mmap()) will make most programs typically shipped with generic distributions unusable. It is recommended to combine the file system namespacing related options with C, in order to prohibit the unit's processes to undo the mappings. Specifically these are the options C, C, C, C, C, C, C, C, C and C. I< Optional. Type list of uniline. > =head2 SystemCallErrorNumber Takes an C error number (between 1 and 4095) or errno name such as C, C or C, to return when the system call filter configured with C is triggered, instead of terminating the process immediately. See L for a full list of error codes. When this setting is not used, or when the empty string is assigned, the process will be terminated immediately when the filter is triggered. I< Optional. Type uniline. > =head2 SystemCallArchitectures Takes a space-separated list of architecture identifiers to include in the system call filter. The known architecture identifiers are the same as for C described in L, as well as C, C, C, and the special identifier C. The special identifier C implicitly maps to the native architecture of the system (or more precisely: to the architecture the system manager is compiled for). If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. By default, this option is set to the empty list, i.e. no system call architecture filtering is applied. If this setting is used, processes of this unit will only be permitted to call native system calls, and system calls of the specified architectures. For the purposes of this option, the x32 architecture is treated as including x86-64 system calls. However, this setting still fulfills its purpose, as explained below, on x32. System call filtering is not equally effective on all architectures. For example, on x86 filtering of network socket-related calls is not possible, due to ABI limitations — a limitation that x86-64 does not have, however. On systems supporting multiple ABIs at the same time — such as x86/x86-64 — it is hence recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to circumvent the restrictions applied to the native ABI of the system. In particular, setting C is a good choice for disabling non-native ABIs. System call architectures may also be restricted system-wide via the C option in the global configuration. See L for details. I< Optional. Type uniline. > =head2 Environment Sets environment variables for executed processes. Takes a space-separated list of variable assignments. This option may be specified more than once, in which case all listed variables will be set. If the same variable is set twice, the later setting will override the earlier setting. If the empty string is assigned to this option, the list of environment variables is reset, all prior assignments have no effect. Variable expansion is not performed inside the strings, however, specifier expansion is possible. The $ character has no special meaning. If you need to assign a value containing spaces or the equals sign to a variable, use double quotes (") for the assignment. Example: Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" gives three variables C, C, C with the values C, C, C<$word 5 6>. See L for details about environment variables. Note that environment variables are not suitable for passing secrets (such as passwords, key material, …) to service processes. Environment variables set for a unit are exposed to unprivileged clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data. I< Optional. Type list of uniline. > =head2 EnvironmentFile Similar to C but reads the environment variables from a text file. The text file should contain new-line-separated variable assignments. Empty lines, lines without an C<=> separator, or lines starting with ; or # will be ignored, which may be used for commenting. A line ending with a backslash will be concatenated with the following one, allowing multiline variable definitions. The parser strips leading and trailing whitespace from the values of assignments, unless you use double quotes ("). C escapes are supported, but not most control characters. C<\t> and C<\n> can be used to insert tabs and newlines within C. The argument passed should be an absolute filename or wildcard expression, optionally prefixed with C<->, which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect. The files listed with this directive will be read shortly before the process is executed (more specifically, after all processes from a previous unit state terminated. This means you can generate these files in one unit state, and read it with this option in the next). Settings from these files override settings made with C. If the same variable is set twice from these files, the files will be read in the order they are specified and the later setting will override the earlier setting. I< Optional. Type list of uniline. > =head2 PassEnvironment Pass environment variables set for the system service manager to executed processes. Takes a space-separated list of variable names. This option may be specified more than once, in which case all listed variables will be passed. If the empty string is assigned to this option, the list of environment variables to pass is reset, all prior assignments have no effect. Variables specified that are not set for the system manager will not be passed and will be silently ignored. Note that this option is only relevant for the system service manager, as system services by default do not automatically inherit any environment variables set for the service manager itself. However, in case of the user service manager all environment variables are passed to the executed processes anyway, hence this option is without effect for the user service manager. Variables set for invoked processes due to this setting are subject to being overridden by those configured with C or C. C escapes are supported, but not most control characters. C<\t> and C<\n> can be used to insert tabs and newlines within C. Example: PassEnvironment=VAR1 VAR2 VAR3 passes three variables C, C, C with the values set for those variables in PID1. See L for details about environment variables. I< Optional. Type list of uniline. > =head2 UnsetEnvironment Explicitly unset environment variable assignments that would normally be passed from the service manager to invoked processes of this unit. Takes a space-separated list of variable names or variable assignments. This option may be specified more than once, in which case all listed variables/assignments will be unset. If the empty string is assigned to this option, the list of environment variables/assignments to unset is reset. If a variable assignment is specified (that is: a variable name, followed by C<=>, followed by its value), then any environment variable matching this precise assignment is removed. If a variable name is specified (that is a variable name without any following C<=> or value), then any assignment matching the variable name, regardless of its value is removed. Note that the effect of C is applied as final step when the environment list passed to executed processes is compiled. That means it may undo assignments from any configuration source, including assignments made through C or C, inherited from the system manager's global set of environment variables, inherited via C, set by the service manager itself (such as C<$NOTIFY_SOCKET> and such), or set by a PAM module (in case C is used). See L for details about environment variables. I< Optional. Type list of uniline. > =head2 StandardInput Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one of C, C, C, C, C, C, C or C. If C is selected, standard input will be connected to C, i.e. all read attempts by the process will result in immediate EOF. If C is selected, standard input is connected to a TTY (as configured by C, see below) and the executed process becomes the controlling process of the terminal. If the terminal is already being controlled by another process, the executed process waits until the current controlling process releases the terminal. C is similar to C, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal. C is similar to C, but if the terminal already has a controlling process start-up of the executed process fails. The C option may be used to configure arbitrary textual or binary data to pass via standard input to the executed process. The data to pass is configured via C/C (see below). Note that the actual file descriptor type passed (memory file, regular file, UNIX pipe, …) might depend on the kernel and available privileges. In any case, the file descriptor is read-only, and when read returns the specified data followed by EOF. The C option may be used to connect a specific file system object to standard input. An absolute path following the C<:> character is expected, which may refer to a regular file, a FIFO or special file. If an C socket in the file system is specified, a stream socket is connected to it. The latter is useful for connecting standard input of processes to arbitrary system services. The C option is valid in socket-activated services only, and requires the relevant socket unit file (see L for details) to have C set, or to specify a single socket only. If this option is set, standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional L socket activation daemon. The C option connects standard input to a specific, named file descriptor provided by a socket unit. The name may be specified as part of this option, following a C<:> character (e.g. C). If no name is specified, the name C is implied (i.e. C is equivalent to C). At least one socket unit defining the specified name must be provided via the C option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See C in L for more details about named file descriptors and their ordering. This setting defaults to C. Note that services which specify C and use C or C with C/C/C, should specify C, to make sure that the tty initialization is finished before they start. I< Optional. Type enum. choice: 'null', 'tty', 'tty-force', 'tty-fail', 'data', 'socket'. > =head2 StandardOutput Controls where file descriptor 1 (stdout) of the executed processes is connected to. Takes one of C, C, C, C, C, C, C, C, C, C or C. C duplicates the file descriptor of standard input for standard output. C connects standard output to C, i.e. everything written to it will be lost. C connects standard output to a tty (as configured via C, see below). If the TTY is used for output only, the executed process will not become the controlling process of the terminal, and will not fail or wait for other processes to release the terminal. C connects standard output with the journal, which is accessible via L. Note that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the specific option listed below is hence a superset of this one. (Also note that any external, additional syslog daemons receive their log data from the journal, too, hence this is the option to use when logging shall be processed with such a daemon.) C connects standard output with the kernel log buffer which is accessible via L, in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which case this option is no different from C. C and C work in a similar way as the two options above but copy the output to the system console as well. The C option may be used to connect a specific file system object to standard output. The semantics are similar to the same option of C, see above. If path refers to a regular file on the filesystem, it is opened (created if it doesn't exist yet) for writing at the beginning of the file, but without truncating it. If standard input and output are directed to the same file path, it is opened only once, for reading as well as writing and duplicated. This is particularly useful when the specified path refers to an C socket in the file system, as in that case only a single stream connection is created for both input and output. C is similar to C above, but it opens the file in append mode. C connects standard output to a socket acquired via socket activation. The semantics are similar to the same option of C, see above. The C option connects standard output to a specific, named file descriptor provided by a socket unit. A name may be specified as part of this option, following a C<:> character (e.g. C). If no name is specified, the name C is implied (i.e. C is equivalent to C). At least one socket unit defining the specified name must be provided via the C option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See C in L for more details about named descriptors and their ordering. If the standard output (or error output, see below) of a unit is connected to the journal or the kernel log buffer, the unit will implicitly gain a dependency of type C on C (also see the "Implicit Dependencies" section above). Also note that in this case stdout (or stderr, see below) will be an C stream socket, and not a pipe or FIFO that can be re-opened. This means when executing shell scripts the construct echo "hello" > /dev/stderr for writing text to stderr will not work. To mitigate this use the construct echo "hello" >&2 instead, which is mostly equivalent and avoids this pitfall. This setting defaults to the value set with C in L, which defaults to C. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). I< Optional. Type enum. choice: 'inherit', 'null', 'tty', 'journal', 'kmsg', 'journal+console', 'kmsg+console', 'socket'. > =head2 StandardError Controls where file descriptor 2 (stderr) of the executed processes is connected to. The available options are identical to those of C, with some exceptions: if set to C the file descriptor used for standard output is duplicated for standard error, while C will use a default file descriptor name of C. This setting defaults to the value set with C in L, which defaults to C. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). I< Optional. Type uniline. > =head2 StandardInputText Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to the executed processes. These settings have no effect unless C is set to C. Use this option to embed process input data directly in the unit file. C accepts arbitrary textual data. C-style escapes for special characters as well as the usual C<%>-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional C<\n> to the end or beginning of a line). C accepts arbitrary binary data, encoded in Base64. No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. Note that C and C operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a C<\> character (see L for details). This is particularly useful for large data configured with these two options. Example: I< Optional. Type uniline. > =head2 StandardInputData Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to the executed processes. These settings have no effect unless C is set to C. Use this option to embed process input data directly in the unit file. C accepts arbitrary textual data. C-style escapes for special characters as well as the usual C<%>-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional C<\n> to the end or beginning of a line). C accepts arbitrary binary data, encoded in Base64. No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. Note that C and C operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a C<\> character (see L for details). This is particularly useful for large data configured with these two options. Example: I< Optional. Type uniline. > =head2 LogLevelMax Configures filtering by log level of log messages generated by this unit. Takes a syslog log level, one of C (lowest log level, only highest priority messages), C, C, C, C, C, C, C (highest log level, also lowest priority messages). See L for details. By default no filtering is applied (i.e. the default maximum log level is C). Use this option to configure the logging system to drop log messages of a specific service above the specified level. For example, set CC in order to turn off debug logging of a particularly chatty unit. Note that the configured level is applied to any log messages written by any of the processes belonging to this unit, sent via any supported logging protocol. The filtering is applied early in the logging pipeline, before any kind of further processing is done. Moreover, messages which pass through this filter successfully might still be dropped by filters applied at a later stage in the logging subsystem. For example, C configured in L might prohibit messages of higher log levels to be stored on disk, even though the per-unit C permitted it to be processed. I< Optional. Type uniline. > =head2 LogExtraFields Configures additional log metadata fields to include in all log records generated by processes associated with this unit. This setting takes one or more journal field assignments in the format C separated by whitespace. See L for details on the journal field concept. Even though the underlying journal implementation permits binary field values, this setting accepts only valid UTF-8 values. To include space characters in a journal field value, enclose the assignment in double quotes ("). The usual specifiers are expanded in all assignments (see below). Note that this setting is not only useful for attaching additional metadata to log records of a unit, but given that all fields and values are indexed may also be used to implement cross-unit log record matching. Assign an empty string to reset the list. I< Optional. Type uniline. > =head2 LogRateLimitIntervalSec Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by C, more messages than specified in C are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for C may be specified in the following units: "s", "min", "h", "ms", "us" (see L for details). The default settings are set by C and C configured in L. I< Optional. Type uniline. > =head2 LogRateLimitBurst Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by C, more messages than specified in C are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for C may be specified in the following units: "s", "min", "h", "ms", "us" (see L for details). The default settings are set by C and C configured in L. I< Optional. Type uniline. > =head2 SyslogIdentifier Sets the process name ("syslog tag") to prefix log lines sent to the logging system or the kernel log buffer with. If not set, defaults to the process name of the executed process. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>) and only applies to log messages written to stdout or stderr. I< Optional. Type uniline. > =head2 SyslogFacility Sets the syslog facility identifier to use when logging. One of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C or C. See L for details. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>), and only applies to log messages written to stdout or stderr. Defaults to C. I< Optional. Type uniline. > =head2 SyslogLevel The default syslog log level to use when logging to the logging system or the kernel log buffer. One of C, C, C, C, C, C, C, C. See L for details. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>), and only applies to log messages written to stdout or stderr. Note that individual lines output by executed processes may be prefixed with a different log level which can be used to override the default log level specified here. The interpretation of these prefixes may be disabled with C, see below. For details, see L. Defaults to C. I< Optional. Type uniline. > =head2 SyslogLevelPrefix Takes a boolean argument. If true and C or C are set to C or C (or to the same settings in combination with C<+console>), log lines written by the executed process that are prefixed with a log level will be processed with this log level set but the prefix removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as-is. This only applies to log messages written to stdout or stderr. For details about this prefixing see L. Defaults to true. I< Optional. Type boolean. > =head2 TTYPath Sets the terminal device node to use if standard input, output, or error are connected to a TTY (see above). Defaults to C. I< Optional. Type uniline. > =head2 TTYReset Reset the terminal device specified with C before and after execution. Defaults to C. I< Optional. Type uniline. > =head2 TTYVHangup Disconnect all clients which have opened the terminal device specified with C before and after execution. Defaults to C. I< Optional. Type uniline. > =head2 TTYVTDisallocate If the terminal device specified with C is a virtual console terminal, try to deallocate the TTY before and after execution. This ensures that the screen and scrollback buffer is cleared. Defaults to C. I< Optional. Type uniline. > =head2 UtmpIdentifier Takes a four character identifier string for an L and wtmp entry for this service. This should only be set for services such as getty implementations (such as L) where utmp/wtmp entries must be created and cleared before and after execution, or for services that shall be executed as if they were run by a getty process (see below). If the configured string is longer than four characters, it is truncated and the terminal four characters are used. This setting interprets %I style string replacements. This setting is unset by default, i.e. no utmp/wtmp entries are created or cleaned up for this service. I< Optional. Type uniline. > =head2 UtmpMode Takes one of C, C or C. If C is set, controls which type of L/wtmp entries for this service are generated. This setting has no effect unless C is set too. If C is set, only an C entry is generated and the invoked process must implement a getty-compatible utmp/wtmp logic. If C is set, first an C entry, followed by a C entry is generated. In this case, the invoked process must implement a L-compatible utmp/wtmp logic. If C is set, first an C entry, then a C entry and finally a C entry is generated. In this case, the invoked process may be any process that is suitable to be run as session leader. Defaults to C. I< Optional. Type enum. choice: 'init', 'login', 'user'. > =head2 KillMode Specifies how processes of this unit shall be killed. One of C, C, C, C. If set to C, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with C). If set to C, only the main process itself is killed. If set to C, the C signal (see below) is sent to the main process while the subsequent C signal (see below) is sent to all remaining processes of the unit's control group. If set to C, no process is killed. In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless it is empty. Processes will first be terminated via C (unless the signal to send is changed via C or C). Optionally, this is immediately followed by a C (if enabled with C). If processes still remain after the main process of a unit has exited or the delay configured via the C has passed, the termination request is repeated with the C signal or the signal specified via C (unless this is disabled via the C option). See L for more information. Defaults to C. I< Optional. Type uniline. > =head2 KillSignal Specifies which signal to use when stopping a service. This controls the signal that is sent as first step of shutting down a unit (see above), and is usually followed by C (see above and below). For a list of valid signals, see L. Defaults to C. Note that, right after sending the signal specified in this setting, systemd will always send C, to ensure that even suspended tasks can be terminated cleanly. I< Optional. Type uniline. > =head2 RestartKillSignal Specifies which signal to use when restarting a service. The same as C described above, with the exception that this setting is used in a restart job. Not set by default, and the value of C is used. I< Optional. Type uniline. > =head2 SendSIGHUP Specifies whether to send C to remaining processes immediately after sending the signal configured with C. This is useful to indicate to shells and shell-like programs that their connection has been severed. Takes a boolean value. Defaults to "no". I< Optional. Type boolean. > =head2 SendSIGKILL Specifies whether to send C (or the signal specified by C) to remaining processes after a timeout, if the normal shutdown procedure left processes of the service around. When disabled, a C of C or C service will not restart if processes from prior services exist within the control group. Takes a boolean value. Defaults to "yes". I< Optional. Type boolean. > =head2 FinalKillSignal Specifies which signal to send to remaining processes after a timeout if C is enabled. The signal configured here should be one that is not typically caught and processed by services (C is not suitable). Developers can find it useful to use this to generate a coredump to troubleshoot why a service did not terminate upon receiving the initial C signal. This can be achieved by configuring C and setting C to either C or C Defaults to C. I< Optional. Type uniline. > =head2 WatchdogSignal Specifies which signal to use to terminate the service when the watchdog timeout expires (enabled through C). Defaults to C. I< Optional. Type uniline. > =head2 Type Configures the process start-up type for this service unit. One of C, C, C, C, C, C or C: It is generally recommended to use CC for long-running services whenever possible, as it is the simplest and fastest option. However, as this service type won't propagate service start-up failures and doesn't allow ordering of other units against completion of initialization of the service (which for example is useful if clients need to connect to the service through some form of IPC, and the IPC channel is only established by the service itself — in contrast to doing this ahead of time through socket or bus activation or similar), it might not be sufficient for many cases. If so, C or C (the latter only in case the service provides a D-Bus interface) are the preferred options as they allow service program code to precisely schedule when to consider the service started up successfully and when to proceed with follow-up units. The C service type requires explicit support in the service codebase (as sd_notify() or an equivalent API needs to be invoked by the service at the appropriate time) — if it's not supported, then C is an alternative: it supports the traditional UNIX service start-up protocol. Finally, C might be an option for cases where it is enough to ensure the service binary is invoked, and where the service binary itself executes no or little initialization on its own (and its initialization is unlikely to fail). Note that using any type other than C possibly delays the boot process, as the service manager needs to wait for service initialization to complete. It is hence recommended not to needlessly use any types other than C. (Also note it is generally not recommended to use C or C for long-running services.) I< Optional. Type uniline. > =head2 RemainAfterExit Takes a boolean value that specifies whether the service shall be considered active even when all its processes exited. Defaults to C. I< Optional. Type boolean. > =head2 GuessMainPID Takes a boolean value that specifies whether systemd should try to guess the main PID of a service if it cannot be determined reliably. This option is ignored unless C is set and C is unset because for the other types or with an explicitly configured PID file, the main PID is always known. The guessing algorithm might come to incorrect conclusions if a daemon consists of more than one process. If the main PID cannot be determined, failure detection and automatic restarting of a service will not work reliably. Defaults to C. I< Optional. Type boolean. > =head2 PIDFile Takes a path referring to the PID file of the service. Usage of this option is recommended for services where C is set to C. The path specified typically points to a file below C. If a relative path is specified it is hence prefixed with C. The service manager will read the PID of the main process of the service from this file after start-up of the service. The service manager will not write to the file configured here, although it will remove the file after the service has shut down if it still exists. The PID file does not need to be owned by a privileged user, but if it is owned by an unprivileged user additional safety restrictions are enforced: the file may not be a symlink to a file owned by a different user (neither directly nor indirectly), and the PID file must refer to a process already belonging to the service. I< Optional. Type uniline. > =head2 BusName Takes a D-Bus bus name that this service is reachable as. This option is mandatory for services where C is set to C. I< Optional. Type uniline. > =head2 ExecStart Commands with their arguments that are executed when this service is started. The value is split into zero or more command lines according to the rules described below (see section "Command Lines" below). Unless C is C, exactly one command must be given. When C is used, zero or more commands may be specified. Commands may be specified by providing multiple command lines in the same directive, or alternatively, this directive may be specified more than once with the same effect. If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect. If no C is specified, then the service must have C and at least one C line set. (Services lacking both C and C are not valid.) For each of the specified commands, the first argument must be either an absolute path to an executable or a simple file name without any slashes. Optionally, this filename may be prefixed with a number of special characters: C<@>, C<->, C<:>, and one of C<+>/C/C may be used together and they can appear in any order. However, only one of C<+>, C, C may be used at a time. Note that these prefixes are also supported for the other command line settings, i.e. C, C, C, C and C. If more than one command is specified, the commands are invoked sequentially in the order they appear in the unit file. If one of the commands fails (and is not prefixed with C<->), other lines are not executed, and the unit is considered failed. Unless C is set, the process started via this command line will be considered the main process of the daemon. I< Optional. Type list of uniline. > =head2 ExecStartPre Additional commands that are executed before or after the command in C, respectively. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. If any of those commands (not prefixed with C<->) fail, the rest are not executed and the unit is considered failed. C commands are only run after all C commands that were not prefixed with a C<-> exit successfully. C commands are only run after the commands specified in C have been invoked successfully, as determined by C (i.e. the process has been started for C or C, the last C process exited successfully for C, the initial process exited successfully for C, C is sent for C, or the C has been taken for C). Note that C may not be used to start long-running processes. All processes forked off by processes invoked via C will be killed before the next service process is run. Note that if any of the commands specified in C, C, or C fail (and are not prefixed with C<->, see above) or time out before the service is fully up, execution continues with commands specified in C, the commands in C are skipped. I< Optional. Type list of uniline. > =head2 ExecStartPost Additional commands that are executed before or after the command in C, respectively. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. If any of those commands (not prefixed with C<->) fail, the rest are not executed and the unit is considered failed. C commands are only run after all C commands that were not prefixed with a C<-> exit successfully. C commands are only run after the commands specified in C have been invoked successfully, as determined by C (i.e. the process has been started for C or C, the last C process exited successfully for C, the initial process exited successfully for C, C is sent for C, or the C has been taken for C). Note that C may not be used to start long-running processes. All processes forked off by processes invoked via C will be killed before the next service process is run. Note that if any of the commands specified in C, C, or C fail (and are not prefixed with C<->, see above) or time out before the service is fully up, execution continues with commands specified in C, the commands in C are skipped. I< Optional. Type list of uniline. > =head2 ExecCondition Optional commands that are executed before the command(s) in C. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. The behavior is like an C and condition check hybrid: when an C command exits with exit code 1 through 254 (inclusive), the remaining commands are skipped and the unit is not marked as failed. However, if an C command exits with 255 or abnormally (e.g. timeout, killed by a signal, etc.), the unit will be considered failed (and remaining commands will be skipped). Exit code of 0 or those matching C will continue execution to the next command(s). The same recommendations about not running long-running processes in C also applies to C. C will also run the commands in C, as part of stopping the service, in the case of any non-zero or abnormal exits, like the ones described above. I< Optional. Type list of uniline. > =head2 ExecReload Commands to execute to trigger a configuration reload in the service. This argument takes multiple command lines, following the same scheme as described for C above. Use of this setting is optional. Specifier and environment variable substitution is supported here following the same scheme as for C. One additional, special environment variable is set: if known, C<$MAINPID> is set to the main process of the daemon, and may be used for command lines like the following: Note however that reloading a daemon by sending a signal (as with the example line above) is usually not a good choice, because this is an asynchronous operation and hence not suitable to order reloads of multiple services against each other. It is strongly recommended to set C to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete. I< Optional. Type list of uniline. > =head2 ExecStop Commands to execute to stop the service started via C. This argument takes multiple command lines, following the same scheme as described for C above. Use of this setting is optional. After the commands configured in this option are run, it is implied that the service is stopped, and any processes remaining for it are terminated according to the C setting (see L). If this option is not specified, the process is terminated by sending the signal specified in C or C when service stop is requested. Specifier and environment variable substitution is supported (including C<$MAINPID>, see above). Note that it is usually not sufficient to specify a command for this setting that only asks the service to terminate (for example, by sending some form of termination signal to it), but does not wait for it to do so. Since the remaining processes of the services are killed according to C and C or C as described above immediately after the command exited, this may not result in a clean stop. The specified command should hence be a synchronous operation, not an asynchronous one. Note that the commands specified in C are only executed when the service started successfully first. They are not invoked if the service was never started at all, or in case its start-up failed, for example because any of the commands specified in C, C or C failed (and weren't prefixed with C<->, see above) or timed out. Use C to invoke commands when a service failed to start up correctly and is shut down again. Also note that the stop operation is always performed if the service started successfully, even if the processes in the service terminated on their own or were killed. The stop commands must be prepared to deal with that case. C<$MAINPID> will be unset if systemd knows that the main process exited by the time the stop commands are called. Service restart requests are implemented as stop operations followed by start operations. This means that C and C are executed during a service restart operation. It is recommended to use this setting for commands that communicate with the service requesting clean termination. For post-mortem clean-up steps use C instead. I< Optional. Type list of uniline. > =head2 ExecStopPost Additional commands that are executed after the service is stopped. This includes cases where the commands configured in C were used, where the service does not have any C defined, or where the service exited unexpectedly. This argument takes multiple command lines, following the same scheme as described for C. Use of these settings is optional. Specifier and environment variable substitution is supported. Note that – unlike C – commands specified with this setting are invoked when a service failed to start up correctly and is shut down again. It is recommended to use this setting for clean-up operations that shall be executed even when the service failed to start up correctly. Commands configured with this setting need to be able to operate even if the service failed starting up half-way and left incompletely initialized data around. As the service's processes have been terminated already when the commands specified with this setting are executed they should not attempt to communicate with them. Note that all commands that are configured with this setting are invoked with the result code of the service, as well as the main process' exit code and status, set in the C<$SERVICE_RESULT>, C<$EXIT_CODE> and C<$EXIT_STATUS> environment variables, see L for details. I< Optional. Type list of uniline. > =head2 RestartSec Configures the time to sleep before restarting a service (as configured with C). Takes a unit-less value in seconds, or a time span value such as "5min 20s". Defaults to 100ms. I< Optional. Type uniline. > =head2 TimeoutStartSec Configures the time to wait for start-up. If a daemon service does not signal start-up completion within the configured time, the service will be considered failed and will be shut down again. Takes a unit-less value in seconds, or a time span value such as "5min 20s". Pass C to disable the timeout logic. Defaults to C from the manager configuration file, except when C is used, in which case the timeout is disabled by default (see L). If a service of C sends C, this may cause the start time to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the start time has exended beyond C, the service manager will allow the service to continue to start, provided the service repeats C within the interval specified until the service startup status is finished by C. (see L). I< Optional. Type uniline. > =head2 TimeoutStopSec This option serves two purposes. First, it configures the time to wait for each C command. If any of them times out, subsequent C commands are skipped and the service will be terminated by C. If no C commands are specified, the service gets the C immediately. Second, it configures the time to wait for the service itself to stop. If it doesn't terminate in the specified time, it will be forcibly terminated by C (see C in L). Takes a unit-less value in seconds, or a time span value such as "5min 20s". Pass C to disable the timeout logic. Defaults to C from the manager configuration file (see L). If a service of C sends C, this may cause the stop time to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the stop time has exended beyond C, the service manager will allow the service to continue to stop, provided the service repeats C within the interval specified, or terminates itself (see L). I< Optional. Type uniline. > =head2 TimeoutAbortSec This option configures the time to wait for the service to terminate when it was aborted due to a watchdog timeout (see C). If the service has a short C this option can be used to give the system more time to write a core dump of the service. Upon expiration the service will be forcibly terminated by C (see C in L). The core file will be truncated in this case. Use C to set a sensible timeout for the core dumping per service that is large enough to write all expected data while also being short enough to handle the service failure in due time. Takes a unit-less value in seconds, or a time span value such as "5min 20s". Pass an empty value to skip the dedicated watchdog abort timeout handling and fall back C. Pass C to disable the timeout logic. Defaults to C from the manager configuration file (see L). If a service of C handles C itself (instead of relying on the kernel to write a core dump) it can send C to extended the abort time beyond C. The first receipt of this message must occur before C is exceeded, and once the abort time has exended beyond C, the service manager will allow the service to continue to abort, provided the service repeats C within the interval specified, or terminates itself (see L). I< Optional. Type uniline. > =head2 TimeoutSec A shorthand for configuring both C and C to the specified value. I< Optional. Type uniline. > =head2 RuntimeMaxSec Configures a maximum time for the service to run. If this is used and the service has been active for longer than the specified time it is terminated and put into a failure state. Note that this setting does not have any effect on C services, as they terminate immediately after activation completed. Pass C (the default) to configure no runtime limit. If a service of C sends C, this may cause the runtime to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the runtime has exended beyond C, the service manager will allow the service to continue to run, provided the service repeats C within the interval specified until the service shutdown is achieved by C (or termination). (see L). I< Optional. Type uniline. > =head2 WatchdogSec Configures the watchdog timeout for a service. The watchdog is activated when the start-up is completed. The service must call L regularly with C (i.e. the "keep-alive ping"). If the time between two such calls is larger than the configured time, then the service is placed in a failed state and it will be terminated with C (or the signal specified by C). By setting C to C, C, C or C, the service will be automatically restarted. The time configured here will be passed to the executed service process in the C environment variable. This allows daemons to automatically enable the keep-alive pinging logic if watchdog support is enabled for the service. If this option is used, C (see below) should be set to open access to the notification socket provided by systemd. If C is not set, it will be implicitly set to C
. Defaults to 0, which disables this feature. The service can check whether the service manager expects watchdog keep-alive notifications. See L for details. L may be used to enable automatic watchdog notification support. I< Optional. Type uniline. > =head2 Restart Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached. The service process may be the main service process, but it may also be one of the processes specified with C, C, C, C, or C. When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted. Timeouts include missing the watchdog "keep-alive ping" deadline and a service start, reload, and stop operation timeouts. Takes one of C, C, C, C, C, C, or C. If set to C (the default), the service will not be restarted. If set to C, it will be restarted only when the service process exits cleanly. In this context, a clean exit means an exit code of 0, or one of the signals C, C, C or C, and additionally, exit statuses and signals specified in C. If set to C, the service will be restarted when the process exits with a non-zero exit code, is terminated by a signal (including on core dump, but excluding the aforementioned four signals), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered. If set to C, the service will be restarted when the process is terminated by a signal (including on core dump, excluding the aforementioned four signals), when an operation times out, or when the watchdog timeout is triggered. If set to C, the service will be restarted only if the service process exits due to an uncaught signal not specified as a clean exit status. If set to C, the service will be restarted only if the watchdog timeout for the service expires. If set to C, the service will be restarted regardless of whether it exited cleanly or not, got terminated abnormally by a signal, or hit a timeout. As exceptions to the setting above, the service will not be restarted if the exit code or signal is specified in C (see below) or the service is stopped with systemctl stop or an equivalent operation. Also, the services will always be restarted if the exit code or signal is specified in C (see below). Note that service restart is subject to unit start rate limiting configured with C and C, see L for details. A restarted service enters the failed state only after the start limits are reached. Setting this to C is the recommended choice for long-running services, in order to increase reliability by attempting automatic recovery from errors. For services that shall be able to terminate on their own choice (and avoid immediate restarting), C is an alternative choice. I< Optional. Type enum. choice: 'no', 'on-success', 'on-failure', 'on-abnormal', 'on-watchdog', 'on-abort', 'always'. > =head2 SuccessExitStatus Takes a list of exit status definitions that, when returned by the main service process, will be considered successful termination, in addition to the normal successful exit code 0 and the signals C, C, C, and C. Exit status definitions can be numeric exit codes, termination code names, or termination signal names, separated by spaces. See the Process Exit Codes section in L for a list of termination codes names (for this setting only the part without the C or C prefix should be used). See L for a list of signal names. This option may appear more than once, in which case the list of successful exit statuses is merged. If the empty string is assigned to this option, the list is reset, all prior assignments of this option will have no effect. Note: systemd-analyze exit-codes may be used to list exit codes and translate between numerical code values and names. I< Optional. Type uniline. > =head2 RestartPreventExitStatus Takes a list of exit status definitions that, when returned by the main service process, will prevent automatic service restarts, regardless of the restart setting configured with C. Exit status definitions can either be numeric exit codes or termination signal names, and are separated by spaces. Defaults to the empty list, so that, by default, no exit status is excluded from the configured restart logic. For example: RestartPreventExitStatus=1 6 SIGABRT ensures that exit codes 1 and 6 and the termination signal C will not result in automatic service restarting. This option may appear more than once, in which case the list of restart-preventing statuses is merged. If the empty string is assigned to this option, the list is reset and all prior assignments of this option will have no effect. Note that this setting has no effect on processes configured via C, C, C, C or C, but only on the main service process, i.e. either the one invoked by C or (depending on C, C, …) the otherwise configured main process. I< Optional. Type uniline. > =head2 RestartForceExitStatus Takes a list of exit status definitions that, when returned by the main service process, will force automatic service restarts, regardless of the restart setting configured with C. The argument format is similar to C. I< Optional. Type uniline. > =head2 RootDirectoryStartOnly Takes a boolean argument. If true, the root directory, as configured with the C option (see L for more information), is only applied to the process started with C, and not to the various other C, C, C, C, and C commands. If false, the setting is applied to all configured commands the same way. Defaults to false. I< Optional. Type boolean. > =head2 NonBlocking Set the C flag for all file descriptors passed via socket-based activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), excluding those passed in via the file descriptor storage logic (see C for details), will have the C flag set and hence are in non-blocking mode. This option is only useful in conjunction with a socket unit, as described in L and has no effect on file descriptors which were previously saved in the file-descriptor store for example. Defaults to false. I< Optional. Type uniline. > =head2 NotifyAccess Controls access to the service status notification socket, as accessible via the L call. Takes one of C (the default), C
, C or C. If C, no daemon status updates are accepted from the service processes, all status update messages are ignored. If C
, only service updates sent from the main process of the service are accepted. If C, only service updates sent from any of the main or control processes originating from one of the C commands are accepted. If C, all services updates from all members of the service's control group are accepted. This option should be set to open access to the notification socket when using C or C (see above). If those options are used but C is not configured, it will be implicitly set to C
. Note that sd_notify() notifications may be attributed to units correctly only if either the sending process is still around at the time PID 1 processes the message, or if the sending process is explicitly runtime-tracked by the service manager. The latter is the case if the service manager originally forked off the process, i.e. on all processes that match C
or C. Conversely, if an auxiliary process of the unit sends an sd_notify() message and immediately exits, the service manager might not be able to properly attribute the message to the unit, and thus will ignore it, even if CC is set for it. I< Optional. Type enum. choice: 'none', 'main', 'exec', 'all'. > =head2 Sockets Specifies the name of the socket units this service shall inherit socket file descriptors from when the service is started. Normally, it should not be necessary to use this setting, as all socket file descriptors whose unit shares the same name as the service (subject to the different unit name suffix of course) are passed to the spawned process. Note that the same socket file descriptors may be passed to multiple processes simultaneously. Also note that a different service may be activated on incoming socket traffic than the one which is ultimately configured to inherit the socket file descriptors. Or, in other words: the C setting of C<.socket> units does not have to match the inverse of the C setting of the C<.service> it refers to. This option may appear more than once, in which case the list of socket units is merged. Note that once set, clearing the list of sockets again (for example, by assigning the empty string to this option) is not supported. I< Optional. Type uniline. > =head2 FileDescriptorStoreMax Configure how many file descriptors may be stored in the service manager for the service using L's C messages. This is useful for implementing services that can restart after an explicit request or a crash without losing state. Any open sockets and other file descriptors which should not be closed during the restart may be stored this way. Application state can either be serialized to a file in C, or better, stored in a L memory file descriptor. Defaults to 0, i.e. no file descriptors may be stored in the service manager. All file descriptors passed to the service manager from a specific service are passed back to the service's main process on the next service restart. Any file descriptors passed to the service manager are automatically closed when C or C is seen on them, or when the service is fully stopped and no job is queued or being executed for it. If this option is used, C (see above) should be set to open access to the notification socket provided by systemd. If C is not set, it will be implicitly set to C
. I< Optional. Type uniline. > =head2 USBFunctionDescriptors Configure the location of a file containing USB FunctionFS descriptors, for implementation of USB gadget functions. This is used only in conjunction with a socket unit with C configured. The contents of this file are written to the C file after it is opened. I< Optional. Type uniline. > =head2 USBFunctionStrings Configure the location of a file containing USB FunctionFS strings. Behavior is similar to C above. I< Optional. Type uniline. > =head2 OOMPolicy Configure the Out-Of-Memory (OOM) killer policy. On Linux, when memory becomes scarce the kernel might decide to kill a running process in order to free up memory and reduce memory pressure. This setting takes one of C, C or C. If set to C and a process of the service is killed by the kernel's OOM killer this is logged but the service continues running. If set to C the event is logged but the service is terminated cleanly by the service manager. If set to C and one of the service's processes is killed by the OOM killer the kernel is instructed to kill all remaining processes of the service, too. Defaults to the setting C in L is set to, except for services where C is turned on, where it defaults to C. Use the C setting to configure whether processes of the unit shall be considered preferred or less preferred candidates for process termination by the Linux OOM killer logic. See L for details. I< Optional. Type uniline. > =head2 FailureAction B I< Optional. Type uniline. > =head2 SuccessAction B I< Optional. Type uniline. > =head2 StartLimitBurst B I< Optional. Type uniline. > =head2 StartLimitInterval B I< Optional. Type uniline. > =head2 RebootArgument B I< Optional. Type uniline. > =head1 SEE ALSO =over =item * L =back =head1 COPYRIGHT =over =item 2010-2016 Lennart Poettering and others =item 2016 Dominique Dumont =back =head1 LICENSE =over =item LGPLv2.1+ =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Timer.pod0000644000175000017500000004026213575500330025340 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::Timer # ABSTRACT: Configuration class Systemd::Section::Timer =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::Timer - Configuration class Systemd::Section::Timer =head1 DESCRIPTION Configuration classes used by L A unit configuration file whose name ends in C<.timer> encodes information about a timer controlled and supervised by systemd, for timer-based activation. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The timer specific configuration options are configured in the C<[Timer]> section. For each timer file, a matching unit file must exist, describing the unit to activate when the timer elapses. By default, a service by the same name as the timer (except for the suffix) is activated. Example: a timer file C activates a matching service C. The unit to activate may be controlled by C (see below). Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running. There is no concept of spawning new service instances in this case. Due to this, services with C set (which stay around continuously even after the service's main process exited) are usually not suitable for activation via repetitive timers, as they will only be activated once, and then stay around forever. This configuration class was generated from systemd documentation. by L =head1 Elements =head2 OnActiveSec Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below. I< Optional. Type uniline. > =head2 OnBootSec Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below. I< Optional. Type uniline. > =head2 OnStartupSec Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below. I< Optional. Type uniline. > =head2 OnUnitActiveSec Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below. I< Optional. Type uniline. > =head2 OnUnitInactiveSec Defines monotonic timers relative to different starting points: Multiple directives may be combined of the same and of different types, in which case the timer unit will trigger whenever any of the specified timer expressions elapse. For example, by combining C and C, it is possible to define a timer that elapses in regular intervals and activates a specific service each time. Moreover, both monotonic time expressions and C calendar expressions may be combined in the same timer unit. The arguments to the directives are time spans configured in seconds. Example: "OnBootSec=50" means 50s after boot-up. The argument may also include time units. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot-up. For details about the syntax of time spans, see L. If a timer configured with C or C is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started. This is not the case for timers defined in the other directives. These are monotonic timers, independent of wall-clock time and timezones. If the computer is temporarily suspended, the monotonic clock pauses, too. If the empty string is assigned to any of these options, the list of timers is reset (both monotonic timers and C timers, see below), and all prior assignments will have no effect. Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the C setting below. I< Optional. Type uniline. > =head2 OnCalendar Defines realtime (i.e. wallclock) timers with calendar event expressions. See L for more information on the syntax of calendar event expressions. Otherwise, the semantics are similar to C and related settings. Note that timers do not necessarily expire at the precise time configured with this setting, as it is subject to the C setting below. May be specified more than once, in which case the timer unit will trigger whenever any of the specified expressions elapse. Moreover calendar timers and monotonic timers (see above) may be combined within the same timer unit. If the empty string is assigned to any of these options, the list of timers is reset (both C timers and monotonic timers, see above), and all prior assignments will have no effect. I< Optional. Type list of uniline. > =head2 AccuracySec Specify the accuracy the timer shall elapse with. Defaults to 1min. The timer is scheduled to elapse within a time window starting with the time specified in C, C, C, C, C or C and ending the time configured with C later. Within this time window, the expiry time will be placed at a host-specific, randomized, but stable position that is synchronized between all local timer units. This is done in order to optimize power consumption to suppress unnecessary CPU wake-ups. To get best accuracy, set this option to 1us. Note that the timer is still subject to the timer slack configured via L's C setting. See L for details. To optimize power consumption, make sure to set this value as high as possible and as low as necessary. I< Optional. Type uniline. > =head2 RandomizedDelaySec Delay the timer by a randomly selected, evenly distributed amount of time between 0 and the specified time value. Defaults to 0, indicating that no randomized delay shall be applied. Each timer unit will determine this delay randomly before each iteration, and the delay will simply be added on top of the next determined elapsing time. This is useful to stretch dispatching of similarly configured timer events over a certain amount time, to avoid that they all fire at the same time, possibly resulting in resource congestion. Note the relation to C above: the latter allows the service manager to coalesce timer events within a specified time range in order to minimize wakeups, the former does the opposite: it stretches timer events over a time range, to make it unlikely that they fire simultaneously. If C and C are used in conjunction, first the randomized delay is added, and then the result is possibly further shifted to coalesce it with other timer events happening on the system. As mentioned above C defaults to 1min and C to 0, thus encouraging coalescing of timer events. In order to optimally stretch timer events over a certain range of time, make sure to set C to a higher value, and C. I< Optional. Type uniline. > =head2 OnClockChange These options take boolean arguments. When true, the service unit will be triggered when the system clock (C) jumps relative to the monotonic clock (C), or when the local system timezone is modified. These options can be used alone or in combination with other timer expressions (see above) within the same timer unit. These options default to false. I< Optional. Type uniline. > =head2 OnTimezoneChange These options take boolean arguments. When true, the service unit will be triggered when the system clock (C) jumps relative to the monotonic clock (C), or when the local system timezone is modified. These options can be used alone or in combination with other timer expressions (see above) within the same timer unit. These options default to false. I< Optional. Type uniline. > =head2 Unit The unit to activate when this timer elapses. The argument is a unit name, whose suffix is not C<.timer>. If not specified, this value defaults to a service that has the same name as the timer unit, except for the suffix. (See above.) It is recommended that the unit name that is activated and the unit name of the timer unit are named identically, except for the suffix. I< Optional. Type uniline. > =head2 Persistent Takes a boolean argument. If true, the time when the service unit was last triggered is stored on disk. When the timer is activated, the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. This is useful to catch up on missed runs of the service when the system was powered down. Note that this setting only has an effect on timers configured with C. Defaults to C. Use systemctl clean --what=state … on the timer unit to remove the timestamp file maintained by this option from disk. In particular, use this command before uninstalling a timer unit. See L for details. I< Optional. Type boolean. > =head2 WakeSystem Takes a boolean argument. If true, an elapsing timer will cause the system to resume from suspend, should it be suspended and if the system supports this. Note that this option will only make sure the system resumes on the appropriate times, it will not take care of suspending it again after any work that is to be done is finished. Defaults to C. Note that this functionality requires privileges and is thus generally only available in the system service manager. I< Optional. Type boolean. > =head2 RemainAfterElapse Takes a boolean argument. If true, an elapsed timer will stay loaded, and its state remains queryable. If false, an elapsed timer unit that cannot elapse anymore is unloaded. Turning this off is particularly useful for transient timer units that shall disappear after they first elapse. Note that this setting has an effect on repeatedly starting a timer unit that only elapses once: if C is on, it will not be started again, and is guaranteed to elapse only once. However, if C is off, it might be started again if it is already elapsed, and thus be triggered multiple times. Defaults to C. I< Optional. Type boolean. > =head1 SEE ALSO =over =item * L =back =head1 COPYRIGHT =over =item 2010-2016 Lennart Poettering and others =item 2016 Dominique Dumont =back =head1 LICENSE =over =item LGPLv2.1+ =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/ServiceUnit.pl0000644000175000017500000002204113575500330026344 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'migrate_from' => { 'formula' => '$service', 'variables' => { 'service' => '- - Service FailureAction' } }, 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'migrate_from' => { 'formula' => '$service', 'variables' => { 'service' => '- - Service SuccessAction' } }, 'type' => 'leaf', 'value_type' => 'enum' }, 'StartLimitBurst', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'migrate_from' => { 'formula' => '$service', 'variables' => { 'service' => '- - Service StartLimitBurst' } }, 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitIntervalSec', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'migrate_from' => { 'formula' => '$unit || $service', 'use_eval' => '1', 'variables' => { 'service' => '- - Service StartLimitInterval', 'unit' => '- StartLimitInterval' } }, 'type' => 'leaf', 'value_type' => 'uniline' }, 'RebootArgument', { 'description' => 'Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command.', 'migrate_from' => { 'formula' => '$service', 'variables' => { 'service' => '- - Service RebootArgument' } }, 'type' => 'leaf', 'value_type' => 'uniline' } ], 'include' => [ 'Systemd::Section::Unit' ], 'name' => 'Systemd::Section::ServiceUnit' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Install.pod0000644000175000017500000000745613575500330025676 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::Install # ABSTRACT: Configuration class Systemd::Section::Install =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::Install - Configuration class Systemd::Section::Install =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 Alias A space-separated list of additional names this unit shall be installed under. The names listed here must have the same suffix (i.e. type) as the unit filename. This option may be specified more than once, in which case all listed names are used. At installation time, systemctl enable will create symlinks from these names to the unit filename. Note that not all unit types support such alias names, and this setting is not supported for them. Specifically, mount, slice, swap, and automount units do not support aliasing. I< Optional. Type list of uniline. > =head2 WantedBy This option may be used more than once, or a space-separated list of unit names may be given. A symbolic link is created in the C<.wants/> or C<.requires/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect that a dependency of type C or C is added from the listed unit to the current unit. The primary result is that the current unit will be started when the listed unit is started. See the description of C and C in the [Unit] section for details. WantedBy=foo.service in a service C is mostly equivalent to Alias=foo.service.wants/bar.service in the same file. In case of template units, systemctl enable must be called with an instance name, and this instance will be added to the C<.wants/> or C<.requires/> list of the listed unit. E.g. WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. I< Optional. Type list of uniline. > =head2 RequiredBy This option may be used more than once, or a space-separated list of unit names may be given. A symbolic link is created in the C<.wants/> or C<.requires/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect that a dependency of type C or C is added from the listed unit to the current unit. The primary result is that the current unit will be started when the listed unit is started. See the description of C and C in the [Unit] section for details. WantedBy=foo.service in a service C is mostly equivalent to Alias=foo.service.wants/bar.service in the same file. In case of template units, systemctl enable must be called with an instance name, and this instance will be added to the C<.wants/> or C<.requires/> list of the listed unit. E.g. WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. I< Optional. Type list of uniline. > =head2 Also Additional units to install/deinstall when this unit is installed/deinstalled. If the user requests installation/deinstallation of a unit with this option configured, systemctl enable and systemctl disable will automatically install/uninstall units listed in this option as well. This option may be used more than once, or a space-separated list of unit names may be given. I< Optional. Type list of uniline. > =head2 DefaultInstance In template unit files, this specifies for which instance the unit shall be enabled if the template is enabled without any explicitly set instance. This option has no effect in non-template unit files. The specified string must be usable as instance identifier. I< Optional. Type uniline. > =head1 SEE ALSO =over =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/TimerUnit.pod0000644000175000017500000016314213575500330026203 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::TimerUnit # ABSTRACT: Configuration class Systemd::Section::TimerUnit =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::TimerUnit - Configuration class Systemd::Section::TimerUnit =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 Description A human readable name for the unit. This is used by systemd (and other UIs) as the label for the unit, so this string should identify the unit rather than describe it, despite the name. C is a good example. Bad examples are C (too generic) or C (too specific and meaningless for people who do not know Apache). systemd will use this string as a noun in status messages (C, C, C, C), so it should be capitalized, and should not be a full sentence or a phrase with a continuous verb. Bad examples include C or C. I< Optional. Type uniline. > =head2 Documentation A space-separated list of URIs referencing documentation for this unit or its configuration. Accepted are only URIs of the types C, C, C, C, C. For more information about the syntax of these URIs, see L. The URIs should be listed in order of relevance, starting with the most relevant. It is a good idea to first reference documentation that explains what the unit's purpose is, followed by how it is configured, followed by any other related documentation. This option may be specified more than once, in which case the specified list of URIs is merged. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect. I< Optional. Type list of uniline. > =head2 Wants Configures requirement dependencies on other units. This option may be specified more than once or multiple space-separated units may be specified in one option in which case dependencies for all listed names will be created. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a C<.wants/> directory accompanying the unit file. For details, see above. Units listed in this option will be started if the configuring unit is. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started. This is the recommended way to hook start-up of one unit to the start-up of another unit. Note that requirement dependencies do not influence the order in which services are started or stopped. This has to be configured independently with the C or C options. If unit C pulls in unit C as configured with C and no ordering is configured with C or C, then both units will be started simultaneously and without any delay between them if C is activated. I< Optional. Type list of uniline. > =head2 Requires Similar to C, but declares a stronger dependency. Dependencies of this type may also be configured by adding a symlink to a C<.requires/> directory accompanying the unit file. If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency C on the failing unit is set, this unit will not be started. Besides, with or without specifying C, this unit will be stopped if one of the other units is explicitly stopped. Often, it is a better choice to use C instead of C in order to achieve a system that is more robust when dealing with failing services. Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running. Specifically: failing condition checks (such as C, C, … — see below) do not cause the start job of a unit with a C dependency on it to fail. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a C dependency. Use the C dependency type together with C to ensure that a unit may never be in active state without a specific other unit also in active state (see below). I< Optional. Type list of uniline. > =head2 Requisite Similar to C. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. C does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with C, to ensure this unit is not started before the other unit. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 BindsTo Configures requirement dependencies, very similar in style to C. However, this dependency type is stronger: in addition to the effect of C it declares that if the unit bound to is stopped, this unit will be stopped too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager. When used in conjunction with C on the same unit the behaviour of C is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition check (such as C, C, … — see below) will be stopped, should it be running. Hence, in many cases it is best to combine C with C. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 PartOf Configures dependencies similar to C, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency — changes to this unit do not affect the listed units. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 Conflicts A space-separated list of unit names. Configures negative requirement dependencies. If a unit has a C setting on another unit, starting the former will stop the latter and vice versa. Note that this setting does not imply an ordering dependency, similarly to the C and C dependencies described above. This means that to ensure that the conflicting unit is stopped before the other unit is started, an C or C dependency must be declared. It doesn't matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in C/C below. If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction). In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped. I< Optional. Type list of uniline. > =head2 Before These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 After These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 OnFailure A space-separated list of one or more units that are activated when this unit enters the C state. A service unit using C enters the failed state only after the start limits are reached. I< Optional. Type uniline. > =head2 PropagatesReloadTo A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 ReloadPropagatedFrom A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 JoinsNamespaceOf For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join. This only applies to unit types which support the C, C and C directives (see L for details). If a unit that has this setting set is started, its processes will see the same C, C and network namespace as one listed unit that is started. If multiple listed units are already started, it is not defined which namespace is joined. Note that this setting only has an effect if C/C and/or C is enabled for both the unit that joins the namespace and the unit whose namespace is joined. I< Optional. Type uniline. > =head2 RequiresMountsFor Takes a space-separated list of absolute paths. Automatically adds dependencies of type C and C for all mount units required to access the specified path. Mount points marked with C are not mounted automatically through C, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit. I< Optional. Type uniline. > =head2 OnFailureJobMode Takes a value of C, C, C, C, C, C or C. Defaults to C. Specifies how the units listed in C will be enqueued. See L's C<--job-mode=> option for details on the possible values. If this is set to C, only a single unit may be listed in C.. I< Optional. Type uniline. > Note: OnFailureJobMode is migrated with 'C<$unit>' and with: =over =item * C<$unit> => C<- OnFailureIsolate> =back =head2 IgnoreOnIsolate Takes a boolean argument. If C, this unit will not be stopped when isolating another unit. Defaults to C for service, target, socket, busname, timer, and path units, and C for slice, scope, device, swap, mount, and automount units. I< Optional. Type boolean. > =head2 StopWhenUnneeded Takes a boolean argument. If C, this unit will be stopped when it is no longer used. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down. If this option is set, a unit will be automatically cleaned up if no other active unit requires it. Defaults to C. I< Optional. Type boolean. > =head2 RefuseManualStart Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 RefuseManualStop Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 AllowIsolate Takes a boolean argument. If C, this unit may be used with the systemctl isolate command. Otherwise, this will be refused. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states. This option defaults to C. I< Optional. Type boolean. > =head2 DefaultDependencies Takes a boolean argument. If C, (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to C. It is highly recommended to leave this option enabled for the majority of common units. If set to C, this option does not disable all implicit dependencies, just non-essential ones. I< Optional. Type boolean. > =head2 CollectMode Tweaks the "garbage collection" algorithm for this unit. Takes one of C or C. If set to C the unit will be unloaded if it is in the C state and is not referenced by clients, jobs or other units — however it is not unloaded if it is in the C state. In C mode, failed units are not unloaded until the user invoked systemctl reset-failed on them to reset the C state, or an equivalent command. This behaviour is altered if this option is set to C: in this case the unit is unloaded even if the unit is in a C state, and thus an explicitly resetting of the C state is not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, …) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem. Defaults to C. I< Optional. Type enum. choice: 'inactive', 'inactive-or-failed'. > =head2 FailureActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 SuccessActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 JobTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobRunningTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobTimeoutAction C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 JobTimeoutRebootArgument C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 StartLimitAction Configure an additional action to take if the rate limit configured with C and C is hit. Takes the same values as the setting C/C settings and executes the same actions. If C is set, hitting the rate limit will trigger no action besides that the start will not be permitted. Defaults to C. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 SourcePath A path to a configuration file this unit has been generated from. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files. This functionality should not be used in normal units. I< Optional. Type uniline. > =head2 ConditionArchitecture Check whether the system is running on a specific architecture. Takes one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, or C. The architecture is determined from the information returned by L and is thus subject to L. Note that a C setting in the same unit file has no effect on this condition. A special architecture name C is mapped to the architecture the system manager itself is compiled for. The test may be negated by prepending an exclamation mark. I< Optional. Type list of enum. > =head2 ConditionVirtualization Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation. Takes either boolean value to check if being executed in any virtualized environment, or one of C and C to test against a generic type of virtualization solution, or one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C to test against a specific implementation, or C to check whether we are running in a user namespace. See L for a full list of known virtualization technologies and their identifiers. If multiple virtualization technologies are nested, only the innermost is considered. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionHost C may be used to match against the hostname or machine ID of the host. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by L, or a machine ID formatted as string (see L). The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionKernelCommandLine C may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark — unset). The argument must either be a single word, or an assignment (i.e. two words, separated by C<=>). In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is looked for with right and left hand side matching. I< Optional. Type list of uniline. > =head2 ConditionKernelVersion C may be used to check whether the kernel version (as reported by uname -r) matches a certain expression (or if prefixed with the exclamation mark does not match it). The argument must be a list of (potentially quoted) expressions. For each of the expressions, if it starts with one of C<<>, C<<=>, C<=>, C, C<>=>, C<>> a relative version comparison is done, otherwise the specified string is matched with shell-style globs. Note that using the kernel version string is an unreliable way to determine which features are supported by a kernel, because of the widespread practice of backporting drivers, features, and fixes from newer upstream kernels into older versions provided by distributions. Hence, this check is inherently unportable and should not be used for units which may be used on different distributions. I< Optional. Type list of uniline. > =head2 ConditionSecurity C may be used to check whether the given security technology is enabled on the system. Currently, the recognized values are C, C, C, C, C, C and C. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionCapability Check whether the given capability exists in the capability bounding set of the service manager (i.e. this does not check whether capability is actually available in the permitted or effective sets, see L for details). Pass a capability name such as C, possibly prefixed with an exclamation mark to negate the check. I< Optional. Type list of uniline. > =head2 ConditionACPower Check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit. This takes a boolean argument. If set to C, the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known. Conversely, if set to C, the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source. I< Optional. Type list of uniline. > =head2 ConditionNeedsUpdate Takes one of C or C as argument, possibly prefixed with a C (to inverting the condition). This condition may be used to conditionalize units on whether the specified directory requires an update because C's modification time is newer than the stamp file C<.updated> in the specified directory. This is useful to implement offline updates of the vendor operating system resources in C that require updating of C or C on the next following boot. Units making use of this condition should order themselves before L, to make sure they run before the stamp file's modification time gets reset indicating a completed update. I< Optional. Type list of enum. > =head2 ConditionFirstBoot Takes a boolean argument. This condition may be used to conditionalize units on whether the system is booting up with an unpopulated C directory (specifically: an C with no C). This may be used to populate C on the first boot after factory reset, or when a new system instance boots up for the first time. I< Optional. Type list of boolean. > =head2 ConditionPathExists Check for the exists of a file. If the specified absolute path name does not exist, the condition will fail. If the absolute path name passed to C is prefixed with an exclamation mark (C), the test is negated, and the unit is only started if the path does not exist. I< Optional. Type list of uniline. > =head2 ConditionPathExistsGlob C is similar to C, but checks for the existence of at least one file or directory matching the specified globbing pattern. I< Optional. Type list of uniline. > =head2 ConditionPathIsDirectory C is similar to C but verifies that a certain path exists and is a directory. I< Optional. Type list of uniline. > =head2 ConditionPathIsSymbolicLink C is similar to C but verifies that a certain path exists and is a symbolic link. I< Optional. Type list of uniline. > =head2 ConditionPathIsMountPoint C is similar to C but verifies that a certain path exists and is a mount point. I< Optional. Type list of uniline. > =head2 ConditionPathIsReadWrite C is similar to C but verifies that the underlying file system is readable and writable (i.e. not mounted read-only). I< Optional. Type list of uniline. > =head2 ConditionDirectoryNotEmpty C is similar to C but verifies that a certain path exists and is a non-empty directory. I< Optional. Type list of uniline. > =head2 ConditionFileNotEmpty C is similar to C but verifies that a certain path exists and refers to a regular file with a non-zero size. I< Optional. Type list of uniline. > =head2 ConditionFileIsExecutable C is similar to C but verifies that a certain path exists, is a regular file, and marked executable. I< Optional. Type list of uniline. > =head2 ConditionUser C takes a numeric C, a UNIX user name, or the special value C<@system>. This condition may be used to check whether the service manager is running as the given user. The special value C<@system> can be used to check if the user id is within the system user range. This option is not useful for system services, as the system manager exclusively runs as the root user, and thus the test result is constant. I< Optional. Type list of uniline. > =head2 ConditionGroup C is similar to C but verifies that the service manager's real or effective group, or any of its auxiliary groups, match the specified group or GID. This setting does not support the special value C<@system>. I< Optional. Type list of uniline. > =head2 ConditionControlGroupController Verify that the given cgroup controller (eg. C) is available for use on the system. For example, a particular controller may not be available if it was disabled on the kernel command line with C. Multiple controllers may be passed with a space separating them; in this case the condition will only pass if all listed controllers are available for use. Controllers unknown to systemd are ignored. Valid controllers are C, C, C, C, C, C, and C. I< Optional. Type list of uniline. > =head2 ConditionMemory Verify that the specified amount of system memory is available to the current system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. On bare-metal systems compares the amount of physical memory in the system with the specified size, adhering to the specified comparison operator. In containers compares the amount of memory assigned to the container instead. I< Optional. Type list of uniline. > =head2 ConditionCPUs Verify that the specified number of CPUs is available to the current system. Takes a number of CPUs as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. Compares the number of CPUs in the CPU affinity mask configured of the service manager itself with the specified number, adhering to the specified comparison operator. On physical systems the number of CPUs in the affinity mask of the service manager usually matches the number of physical CPUs, but in special and virtual environments might differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container and not the physically available ones. I< Optional. Type list of uniline. > =head2 AssertArchitecture Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertVirtualization Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertHost Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelCommandLine Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelVersion Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertSecurity Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertCapability Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertACPower Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertNeedsUpdate Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFirstBoot Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExists Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExistsGlob Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsDirectory Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsSymbolicLink Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsMountPoint Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsReadWrite Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertDirectoryNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileIsExecutable Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertUser Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertGroup Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertControlGroupController Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 StartLimitInterval B I< Optional. Type uniline. > =head2 OnFailureIsolate B I< Optional. Type uniline. > =head2 FailureAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 SuccessAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 StartLimitBurst Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > =head2 StartLimitIntervalSec Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > =head2 RebootArgument Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command. I< Optional. Type uniline. > =head1 SEE ALSO =over =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Socket.pod0000644000175000017500000010240313575500330025504 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::Socket # ABSTRACT: Configuration class Systemd::Section::Socket =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::Socket - Configuration class Systemd::Section::Socket =head1 DESCRIPTION Configuration classes used by L A unit configuration file whose name ends in C<.socket> encodes information about an IPC or network socket or a file system FIFO controlled and supervised by systemd, for socket-based activation. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The socket specific configuration options are configured in the C<[Socket]> section. Additional options are listed in L, which define the execution environment the C, C, C and C commands are executed in, and in L, which define the way the processes are terminated, and in L, which configure resource control settings for the processes of the socket. For each socket unit, a matching service unit must exist, describing the service to start on incoming traffic on the socket (see L for more information about .service units). The name of the .service unit is by default the same as the name of the .socket unit, but can be altered with the C option described below. Depending on the setting of the C option described below, this .service unit must either be named like the .socket unit, but with the suffix replaced, unless overridden with C; or it must be a template unit named the same way. Example: a socket file C needs a matching service C if C is set. If C is set, a service template C must exist from which services are instantiated for each incoming connection. No implicit C or C dependency from the socket to the service is added. This means that the service may be started without the socket, in which case it must be able to open sockets by itself. To prevent this, an explicit C dependency may be added. Socket units may be used to implement on-demand starting of services, as well as parallelized starting of services. See the blog stories linked at the end for an introduction. Note that the daemon software configured for socket activation with socket units needs to be able to accept sockets from systemd, either via systemd's native socket passing interface (see L for details) or via the traditional L-style socket passing (i.e. sockets passed in via standard input and output, using C in the service file). All network sockets allocated through C<.socket> units are allocated in the host's network namespace (see L). This does not mean however that the service activated by a configured socket unit has to be part of the host's network namespace as well. It is supported and even good practice to run services in their own network namespace (for example through C, see L), receiving only the sockets configured through socket-activation from the host's namespace. In such a set-up communication within the host's network namespace is only permitted through the activation sockets passed in while all sockets allocated from the service code itself will be associated with the service's own namespace, and thus possibly subject to a a much more restrictive configuration. This configuration class was generated from systemd documentation. by L =head1 Elements =head2 ListenStream Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below. I< Optional. Type list of uniline. > =head2 ListenDatagram Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below. I< Optional. Type list of uniline. > =head2 ListenSequentialPacket Specifies an address to listen on for a stream (C), datagram (C), or sequential packet (C) socket, respectively. The address can be written in various formats: If the address starts with a slash (C), it is read as file system socket in the C socket family. If the address starts with an at symbol (C<@>), it is read as abstract namespace socket in the C family. The C<@> is replaced with a C character before binding. For details, see L. If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of C (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6. If the address string is a string in the format v.w.x.y:z, it is read as IPv4 specifier for listening on an address v.w.x.y on a port z. If the address string is a string in the format [x]:y, it is read as IPv6 address x on a port y. Note that this might make the service available via IPv4, too, depending on the C setting (see below). If the address string is a string in the format C, it is read as CID C on a port C address in the C family. The CID is a unique 32-bit integer identifier in C analogous to an IP address. Specifying the CID is optional, and may be set to the empty string. Note that C (i.e. C) is only available for C sockets. C (i.e. C) when used for IP sockets refers to TCP sockets, C (i.e. C) to UDP. These options may be specified more than once, in which case incoming traffic on any of the sockets will trigger service activation, and all listed sockets will be passed to the service, regardless of whether there is incoming traffic on them or not. If the empty string is assigned to any of these options, the list of addresses to listen on is reset, all prior uses of any of these options will have no effect. It is also possible to have more than one socket unit for the same service when using C, and the service will receive all the sockets configured in all the socket units. Sockets configured in one unit are passed in the order of configuration, but no ordering between socket units is specified. If an IP address is used here, it is often desirable to listen on it before the interface it is configured on is up and running, and even regardless of whether it will be up and running at any point. To deal with this, it is recommended to set the C option described below. I< Optional. Type list of uniline. > =head2 ListenFIFO Specifies a file system FIFO to listen on. This expects an absolute file system path as argument. Behavior otherwise is very similar to the C directive above. I< Optional. Type list of uniline. > =head2 ListenSpecial Specifies a special file in the file system to listen on. This expects an absolute file system path as argument. Behavior otherwise is very similar to the C directive above. Use this to open character device nodes as well as special files in C and C. I< Optional. Type list of uniline. > =head2 ListenNetlink Specifies a Netlink family to create a socket for to listen on. This expects a short string referring to the C family name (such as C or C) as argument, optionally suffixed by a whitespace followed by a multicast group integer. Behavior otherwise is very similar to the C directive above. I< Optional. Type list of uniline. > =head2 ListenMessageQueue Specifies a POSIX message queue name to listen on. This expects a valid message queue name (i.e. beginning with /). Behavior otherwise is very similar to the C directive above. On Linux message queue descriptors are actually file descriptors and can be inherited between processes. I< Optional. Type list of uniline. > =head2 ListenUSBFunction Specifies a USB FunctionFS endpoints location to listen on, for implementation of USB gadget functions. This expects an absolute file system path of functionfs mount point as the argument. Behavior otherwise is very similar to the C directive above. Use this to open the FunctionFS endpoint C. When using this option, the activated service has to have the C and C options set. I< Optional. Type list of uniline. > =head2 SocketProtocol Takes one of C or C. Specifies a socket protocol (C) UDP-Lite (C) SCTP socket respectively. I< Optional. Type enum. choice: 'udplite', 'sctp'. > =head2 BindIPv6Only Takes one of C, C or C. Controls the IPV6_V6ONLY socket option (see L for details). If C, IPv6 sockets bound will be accessible via both IPv4 and IPv6. If C, they will be accessible via IPv6 only. If C (which is the default, surprise!), the system wide default setting is used, as controlled by C, which in turn defaults to the equivalent of C. I< Optional. Type enum. choice: 'default', 'both', 'ipv6-only'. > =head2 Backlog Takes an unsigned integer argument. Specifies the number of connections to queue that have not been accepted yet. This setting matters only for stream and sequential packet sockets. See L for details. Defaults to SOMAXCONN (128). I< Optional. Type uniline. > =head2 BindToDevice Specifies a network interface name to bind this socket to. If set, traffic will only be accepted from the specified network interfaces. This controls the SO_BINDTODEVICE socket option (see L for details). If this option is used, an implicit dependency from this socket unit on the network interface device unit (L is created. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). I< Optional. Type uniline. > =head2 SocketUser Takes a UNIX user/group name. When specified, all AF_UNIX sockets and FIFO nodes in the file system are owned by the specified user and group. If unset (the default), the nodes are owned by the root user/group (if run in system context) or the invoking user/group (if run in user context). If only a user is specified but no group, then the group is derived from the user's default group. I< Optional. Type uniline. > =head2 SocketGroup Takes a UNIX user/group name. When specified, all AF_UNIX sockets and FIFO nodes in the file system are owned by the specified user and group. If unset (the default), the nodes are owned by the root user/group (if run in system context) or the invoking user/group (if run in user context). If only a user is specified but no group, then the group is derived from the user's default group. I< Optional. Type uniline. > =head2 SocketMode If listening on a file system socket or FIFO, this option specifies the file system access mode used when creating the file node. Takes an access mode in octal notation. Defaults to 0666. I< Optional. Type uniline. > =head2 DirectoryMode If listening on a file system socket or FIFO, the parent directories are automatically created if needed. This option specifies the file system access mode used when creating these directories. Takes an access mode in octal notation. Defaults to 0755. I< Optional. Type uniline. > =head2 Accept Takes a boolean argument. If true, a service instance is spawned for each incoming connection and only the connection socket is passed to it. If false, all listening sockets themselves are passed to the started service unit, and only one service unit is spawned for all connections (also see above). This value is ignored for datagram sockets and FIFOs where a single service unit unconditionally handles all incoming traffic. Defaults to C. For performance reasons, it is recommended to write new daemons only in a way that is suitable for C. A daemon listening on an C socket may, but does not need to, call L on the received socket before exiting. However, it must not unlink the socket from a file system. It should not invoke L on sockets it got with C, but it may do so for sockets it got with C set. Setting C is mostly useful to allow daemons designed for usage with L to work unmodified with systemd socket activation. For IPv4 and IPv6 connections, the C environment variable will contain the remote IP address, and C will contain the remote port. This is the same as the format used by CGI. For SOCK_RAW, the port is the IP protocol. I< Optional. Type boolean. > =head2 Writable Takes a boolean argument. May only be used in conjunction with C. If true, the specified special file is opened in read-write mode, if false, in read-only mode. Defaults to false. I< Optional. Type boolean. > =head2 MaxConnections The maximum number of connections to simultaneously run services instances for, when C is set. If more concurrent connections are coming in, they will be refused until at least one existing connection is terminated. This setting has no effect on sockets configured with C or datagram sockets. Defaults to 64. I< Optional. Type uniline. > =head2 MaxConnectionsPerSource The maximum number of connections for a service per source IP address. This is very similar to the C directive above. Disabled by default. I< Optional. Type uniline. > =head2 KeepAlive Takes a boolean argument. If true, the TCP/IP stack will send a keep alive message after 2h (depending on the configuration of C) for all TCP streams accepted on this socket. This controls the SO_KEEPALIVE socket option (see L and the TCP Keepalive HOWTO for details.) Defaults to C. I< Optional. Type boolean. > =head2 KeepAliveTimeSec Takes time (in seconds) as argument. The connection needs to remain idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 7200 seconds (2 hours). I< Optional. Type integer. > =head2 KeepAliveIntervalSec Takes time (in seconds) as argument between individual keepalive probes, if the socket option SO_KEEPALIVE has been set on this socket. This controls the TCP_KEEPINTVL socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 75 seconds. I< Optional. Type integer. > =head2 KeepAliveProbes Takes an integer as argument. It is the number of unacknowledged probes to send before considering the connection dead and notifying the application layer. This controls the TCP_KEEPCNT socket option (see L and the TCP Keepalive HOWTO for details.) Defaults value is 9. I< Optional. Type integer. > =head2 NoDelay Takes a boolean argument. TCP Nagle's algorithm works by combining a number of small outgoing messages, and sending them all at once. This controls the TCP_NODELAY socket option (see L Defaults to C. I< Optional. Type boolean. > =head2 Priority Takes an integer argument controlling the priority for all traffic sent from this socket. This controls the SO_PRIORITY socket option (see L for details.). I< Optional. Type integer. > =head2 DeferAcceptSec Takes time (in seconds) as argument. If set, the listening process will be awakened only when data arrives on the socket, and not immediately when connection is established. When this option is set, the C socket option will be used (see L), and the kernel will ignore initial ACK packets without any data. The argument specifies the approximate amount of time the kernel should wait for incoming data before falling back to the normal behavior of honoring empty ACK packets. This option is beneficial for protocols where the client sends the data first (e.g. HTTP, in contrast to SMTP), because the server process will not be woken up unnecessarily before it can take any action. If the client also uses the C option, the latency of the initial connection may be reduced, because the kernel will send data in the final packet establishing the connection (the third packet in the "three-way handshake"). Disabled by default. I< Optional. Type integer. > =head2 ReceiveBuffer Takes an integer argument controlling the receive or send buffer sizes of this socket, respectively. This controls the SO_RCVBUF and SO_SNDBUF socket options (see L for details.). The usual suffixes K, M, G are supported and are understood to the base of 1024. I< Optional. Type uniline. > =head2 SendBuffer Takes an integer argument controlling the receive or send buffer sizes of this socket, respectively. This controls the SO_RCVBUF and SO_SNDBUF socket options (see L for details.). The usual suffixes K, M, G are supported and are understood to the base of 1024. I< Optional. Type uniline. > =head2 IPTOS Takes an integer argument controlling the IP Type-Of-Service field for packets generated from this socket. This controls the IP_TOS socket option (see L for details.). Either a numeric string or one of C, C, C or C may be specified. I< Optional. Type integer. > =head2 IPTTL Takes an integer argument controlling the IPv4 Time-To-Live/IPv6 Hop-Count field for packets generated from this socket. This sets the IP_TTL/IPV6_UNICAST_HOPS socket options (see L and L for details.) I< Optional. Type integer. > =head2 Mark Takes an integer value. Controls the firewall mark of packets generated by this socket. This can be used in the firewall logic to filter packets from this socket. This sets the SO_MARK socket option. See L for details. I< Optional. Type integer. > =head2 ReusePort Takes a boolean value. If true, allows multiple Ls to this TCP or UDP port. This controls the SO_REUSEPORT socket option. See L for details. I< Optional. Type boolean. > =head2 SmackLabel Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details. I< Optional. Type uniline. > =head2 SmackLabelIPIn Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details. I< Optional. Type uniline. > =head2 SmackLabelIPOut Takes a string value. Controls the extended attributes C, C and C, respectively, i.e. the security label of the FIFO, or the security label for the incoming or outgoing connections of the socket, respectively. See Smack.txt for details. I< Optional. Type uniline. > =head2 SELinuxContextFromNet Takes a boolean argument. When true, systemd will attempt to figure out the SELinux label used for the instantiated service from the information handed by the peer over the network. Note that only the security level is used from the information provided by the peer. Other parts of the resulting SELinux context originate from either the target binary that is effectively triggered by socket unit or from the value of the C option. This configuration option only affects sockets with C mode set to C. Also note that this option is useful only when MLS/MCS SELinux policy is deployed. Defaults to C. I< Optional. Type boolean. > =head2 PipeSize Takes a size in bytes. Controls the pipe buffer size of FIFOs configured in this socket unit. See L for details. The usual suffixes K, M, G are supported and are understood to the base of 1024. I< Optional. Type uniline. > =head2 MessageQueueMaxMessages These two settings take integer values and control the mq_maxmsg field or the mq_msgsize field, respectively, when creating the message queue. Note that either none or both of these variables need to be set. See L for details. I< Optional. Type uniline. > =head2 FreeBind Takes a boolean value. Controls whether the socket can be bound to non-local IP addresses. This is useful to configure sockets listening on specific IP addresses before those IP addresses are successfully configured on a network interface. This sets the IP_FREEBIND socket option. For robustness reasons it is recommended to use this option whenever you bind a socket to a specific IP address. Defaults to C. I< Optional. Type boolean. > =head2 Transparent Takes a boolean value. Controls the IP_TRANSPARENT socket option. Defaults to C. I< Optional. Type boolean. > =head2 Broadcast Takes a boolean value. This controls the SO_BROADCAST socket option, which allows broadcast datagrams to be sent from this socket. Defaults to C. I< Optional. Type boolean. > =head2 PassCredentials Takes a boolean value. This controls the SO_PASSCRED socket option, which allows C sockets to receive the credentials of the sending process in an ancillary message. Defaults to C. I< Optional. Type boolean. > =head2 PassSecurity Takes a boolean value. This controls the SO_PASSSEC socket option, which allows C sockets to receive the security context of the sending process in an ancillary message. Defaults to C. I< Optional. Type boolean. > =head2 TCPCongestion Takes a string value. Controls the TCP congestion algorithm used by this socket. Should be one of "westwood", "veno", "cubic", "lp" or any other available algorithm supported by the IP stack. This setting applies only to stream sockets. I< Optional. Type uniline. > =head2 ExecStartPre Takes one or more command lines, which are executed before or after the listening sockets/FIFOs are created and bound, respectively. The first token of the command line must be an absolute filename, then followed by arguments for the process. Multiple command lines may be specified following the same scheme as used for C of service unit files. I< Optional. Type list of uniline. > =head2 ExecStartPost Takes one or more command lines, which are executed before or after the listening sockets/FIFOs are created and bound, respectively. The first token of the command line must be an absolute filename, then followed by arguments for the process. Multiple command lines may be specified following the same scheme as used for C of service unit files. I< Optional. Type list of uniline. > =head2 ExecStopPre Additional commands that are executed before or after the listening sockets/FIFOs are closed and removed, respectively. Multiple command lines may be specified following the same scheme as used for C of service unit files. I< Optional. Type list of uniline. > =head2 ExecStopPost Additional commands that are executed before or after the listening sockets/FIFOs are closed and removed, respectively. Multiple command lines may be specified following the same scheme as used for C of service unit files. I< Optional. Type list of uniline. > =head2 TimeoutSec Configures the time to wait for the commands specified in C, C, C and C to finish. If a command does not exit within the configured time, the socket will be considered failed and be shut down again. All commands still running will be terminated forcibly via C, and after another delay of this time with C. (See C in L.) Takes a unit-less value in seconds, or a time span value such as "5min 20s". Pass C<0> to disable the timeout logic. Defaults to C from the manager configuration file (see L). I< Optional. Type uniline. > =head2 Service Specifies the service unit name to activate on incoming traffic. This setting is only allowed for sockets with C. It defaults to the service that bears the same name as the socket (with the suffix replaced). In most cases, it should not be necessary to use this option. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). I< Optional. Type uniline. > =head2 RemoveOnStop Takes a boolean argument. If enabled, any file nodes created by this socket unit are removed when it is stopped. This applies to AF_UNIX sockets in the file system, POSIX message queues, FIFOs, as well as any symlinks to them configured with C. Normally, it should not be necessary to use this option, and is not recommended as services might continue to run after the socket unit has been terminated and it should still be possible to communicate with them via their file system node. Defaults to off. I< Optional. Type boolean. > =head2 Symlinks Takes a list of file system paths. The specified paths will be created as symlinks to the C socket path or FIFO path of this socket unit. If this setting is used, only one C socket in the file system or one FIFO may be configured for the socket unit. Use this option to manage one or more symlinked alias names for a socket, binding their lifecycle together. Note that if creation of a symlink fails this is not considered fatal for the socket unit, and the socket unit may still start. If an empty string is assigned, the list of paths is reset. Defaults to an empty list. I< Optional. Type uniline. > =head2 FileDescriptorName Assigns a name to all file descriptors this socket unit encapsulates. This is useful to help activated services identify specific file descriptors, if multiple fds are passed. Services may use the L call to acquire the names configured for the received file descriptors. Names may contain any ASCII character, but must exclude control characters and C<:>, and must be at most 255 characters in length. If this setting is not used, the file descriptor name defaults to the name of the socket unit, including its C<.socket> suffix. I< Optional. Type uniline. > =head2 TriggerLimitIntervalSec Configures a limit on how often this socket unit my be activated within a specific time interval. The C may be used to configure the length of the time interval in the usual time units C, C, C, C, C, … and defaults to 2s (See L for details on the various time units understood). The C setting takes a positive integer value and specifies the number of permitted activations per time interval, and defaults to 200 for C sockets (thus by default permitting 200 activations per 2s), and 20 otherwise (20 activations per 2s). Set either to 0 to disable any form of trigger rate limiting. If the limit is hit, the socket unit is placed into a failure mode, and will not be connectible anymore until restarted. Note that this limit is enforced before the service activation is enqueued. I< Optional. Type uniline. > =head2 TriggerLimitBurst Configures a limit on how often this socket unit my be activated within a specific time interval. The C may be used to configure the length of the time interval in the usual time units C, C, C, C, C, … and defaults to 2s (See L for details on the various time units understood). The C setting takes a positive integer value and specifies the number of permitted activations per time interval, and defaults to 200 for C sockets (thus by default permitting 200 activations per 2s), and 20 otherwise (20 activations per 2s). Set either to 0 to disable any form of trigger rate limiting. If the limit is hit, the socket unit is placed into a failure mode, and will not be connectible anymore until restarted. Note that this limit is enforced before the service activation is enqueued. I< Optional. Type uniline. > =head1 SEE ALSO =over =item * L =back =head1 COPYRIGHT =over =item 2010-2016 Lennart Poettering and others =item 2016 Dominique Dumont =back =head1 LICENSE =over =item LGPLv2.1+ =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Unit.pl0000644000175000017500000021715613575500330025040 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => "A unit file is a plain text ini-style file that encodes information about a service, a socket, a device, a mount point, an automount point, a swap file or partition, a start-up target, a watched file system path, a timer controlled and supervised by L, a resource management slice or a group of externally created processes. See L for a general description of the syntax. This man page lists the common configuration options of all the unit types. These options need to be configured in the [Unit] or [Install] sections of the unit files. In addition to the generic [Unit] and [Install] sections described here, each unit may have a type-specific section, e.g. [Service] for a service unit. See the respective man pages for more information: L, L, L, L, L, L, L, L, L, L, L. Unit files are loaded from a set of paths determined during compilation, described in the next section. Valid unit names consist of a \"name prefix\" and a dot and a suffix specifying the unit type. The \"unit prefix\" must consist of one or more valid characters (ASCII letters, digits, C<:>, C<->, C<_>, C<.>, and C<\\>). The total length of the unit name including the suffix must not exceed 256 characters. The type suffix must be one of C<.service>, C<.socket>, C<.device>, C<.mount>, C<.automount>, C<.swap>, C<.target>, C<.path>, C<.timer>, C<.slice>, or C<.scope>. Units names can be parameterized by a single argument called the \"instance name\". The unit is then constructed based on a \"template file\" which serves as the definition of multiple services or other units. A template unit must have a single C<\@> at the end of the name (right before the type suffix). The name of the full unit is formed by inserting the instance name between C<\@> and the unit type suffix. In the unit file itself, the instance parameter may be referred to using C<%i> and other specifiers, see below. Unit files may contain additional options on top of those listed here. If systemd encounters an unknown option, it will write a warning log message but continue loading the unit. If an option or section name is prefixed with C, it is ignored completely by systemd. Options within an ignored section do not need the prefix. Applications may use this to include additional information in the unit files. Units can be aliased (have an alternative name), by creating a symlink from the new name to the existing name in one of the unit search paths. For example, C has the alias C, created during installation as a symlink, so when systemd is asked through D-Bus to load C, it'll load C. Alias names may be used in commands like disable, start, stop, status, and similar, and in all unit dependency directives, including C, C, C, C. Aliases cannot be used with the preset command. Unit files may specify aliases through the C directive in the [Install] section. When the unit is enabled, symlinks will be created for those names, and removed when the unit is disabled. For example, C specifies C, so when enabled, the symlink C pointing to the C file will be created, and when CtrlAltDel is invoked, systemd will look for the C and execute C. systemd does not look at the [Install] section at all during normal operation, so any directives in that section only have an effect through the symlinks created during enablement. Along with a unit file C, the directory C may exist. All unit files symlinked from such a directory are implicitly added as dependencies of type C to the unit. Similar functionality exists for C type dependencies as well, the directory suffix is C<.requires/> in this case. This functionality is useful to hook units into the start-up of other units, without having to modify their unit files. For details about the semantics of C, see below. The preferred way to create symlinks in the C<.wants/> or C<.requires/> directory of a unit file is by embedding the dependency in [Install] section of the target unit, and creating the symlink in the file system with the enable or preset commands of L. Along with a unit file C, a \"drop-in\" directory C may exist. All files with the suffix C<.conf> from this directory will be parsed after the unit file itself is parsed. This is useful to alter or add configuration settings for a unit, without having to modify unit files. Drop-in files must contain appropriate section headers. For instantiated units, this logic will first look for the instance C<.d/> subdirectory (e.g. C) and read its C<.conf> files, followed by the template C<.d/> subdirectory (e.g. C) and the C<.conf> files there. Moreover for units names containing dashes (C<->), the set of directories generated by truncating the unit name after all dashes is searched too. Specifically, for a unit name C not only the regular drop-in directory C is searched but also both C and C. This is useful for defining common drop-ins for a set of related units, whose names begin with a common prefix. This scheme is particularly useful for mount, automount and slice units, whose systematic naming structure is built around dashes as component separators. Note that equally named drop-in files further down the prefix hierarchy override those further up, i.e. C overrides C. In addition to C, the drop-in C<.d/> directories for system services can be placed in C or C directories. Drop-in files in C take precedence over those in C which in turn take precedence over those in C. Drop-in files under any of these directories take precedence over unit files wherever located. Multiple drop-in files with different names are applied in lexicographic order, regardless of which of the directories they reside in. Units also support a top-level drop-in with C, where type may be e.g. C or C, that allows altering or adding to the settings of all corresponding unit files on the system. The formatting and precedence of applying drop-in configurations follow what is defined above. Configurations in C have the lowest precedence compared to settings in the name specific override directories. So the contents of C would override C. Note that while systemd offers a flexible dependency system between units it is recommended to use this functionality only sparingly and instead rely on techniques such as bus-based or socket-based activation which make dependencies implicit, resulting in a both simpler and more flexible system. As mentioned above, a unit may be instantiated from a template file. This allows creation of multiple units from a single configuration file. If systemd looks for a unit configuration file, it will first search for the literal unit name in the file system. If that yields no success and the unit name contains an C<\@> character, systemd will look for a unit template that shares the same name but with the instance string (i.e. the part between the C<\@> character and the suffix) removed. Example: if a service C is requested and no file by that name is found, systemd will look for C and instantiate a service from that configuration file if it is found. To refer to the instance string from within the configuration file you may use the special C<%i> specifier in many of the configuration options. See below for details. If a unit file is empty (i.e. has the file size 0) or is symlinked to C, its configuration will not be loaded and it appears with a load state of C, and cannot be activated. Use this as an effective way to fully disable a unit, making it impossible to start it even manually. The unit file format is covered by the Interface Stability Promise. The set of load paths for the user manager instance may be augmented or changed using various environment variables. And environment variables may in turn be set using environment generators, see L. In particular, C<\$XDG_DATA_HOME> and C<\$XDG_DATA_DIRS> may be easily set using L. Thus, directories listed here are just the defaults. To see the actual list that would be used based on compilation options and current environment use +-+systemd-analyze --user unit-paths Moreover, additional units might be loaded into systemd (\"linked\") from directories not on the unit load path. See the link command for L. Unit files may also include a number of C and C settings. Before the unit is started, systemd will verify that the specified conditions are true. If not, the starting of the unit will be (mostly silently) skipped. Failing conditions will not result in the unit being moved into the C state. The conditions are checked at the time the queued start job is to be executed. The ordering dependencies are still respected, so other units are still pulled in and ordered as if this unit was successfully activated. Use condition expressions in order to skip units that do not apply to the local system, for example because the kernel or runtime environment doesn't require their functionality. If multiple conditions are specified, the unit will be executed if all of them apply (i.e. a logical AND is applied). Condition checks can use a pipe symbol (C<|>) after the equals sign (C), which causes the condition becomes a triggering condition. If at least one triggering condition is defined for a unit, then the unit will be executed if at least one of the triggering conditions apply and all of the non-triggering conditions. If you prefix an argument with the pipe symbol and an exclamation mark, the pipe symbol must be passed first, the exclamation second. If any of these options is assigned the empty string, the list of conditions is reset completely, all previous condition settings (of any kind) will have no effect. The C, C, \x{2026} options provide a similar mechanism that causes the job to fail (instead of being skipped). The failed check is logged. Units with failed conditions are considered to be in a clean state and will be garbage collected if they are not referenced. This means that when queried, the condition failure may or may not show up in the state of the unit. Note that neither assertion nor condition expressions result in unit state changes. Also note that both are checked at the time the job is to be executed, i.e. long after depending jobs and it itself were queued. Thus, neither condition nor assertion expressions are suitable for conditionalizing unit dependencies. The condition verb of L can be used to test condition and assert expressions. Except for C, all path checks follow symlinks. This configuration class was generated from systemd documentation. by L ", 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'Description', { 'description' => 'A human readable name for the unit. This is used by systemd (and other UIs) as the label for the unit, so this string should identify the unit rather than describe it, despite the name. C is a good example. Bad examples are C (too generic) or C (too specific and meaningless for people who do not know Apache). systemd will use this string as a noun in status messages (C, C, C, C), so it should be capitalized, and should not be a full sentence or a phrase with a continuous verb. Bad examples include C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Documentation', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'A space-separated list of URIs referencing documentation for this unit or its configuration. Accepted are only URIs of the types C, C, C, C, C. For more information about the syntax of these URIs, see L. The URIs should be listed in order of relevance, starting with the most relevant. It is a good idea to first reference documentation that explains what the unit\'s purpose is, followed by how it is configured, followed by any other related documentation. This option may be specified more than once, in which case the specified list of URIs is merged. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect.', 'type' => 'list' }, 'Wants', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Configures requirement dependencies on other units. This option may be specified more than once or multiple space-separated units may be specified in one option in which case dependencies for all listed names will be created. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a C<.wants/> directory accompanying the unit file. For details, see above. Units listed in this option will be started if the configuring unit is. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started. This is the recommended way to hook start-up of one unit to the start-up of another unit. Note that requirement dependencies do not influence the order in which services are started or stopped. This has to be configured independently with the C or C options. If unit C pulls in unit C as configured with C and no ordering is configured with C or C, then both units will be started simultaneously and without any delay between them if C is activated.', 'type' => 'list' }, 'Requires', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Similar to C, but declares a stronger dependency. Dependencies of this type may also be configured by adding a symlink to a C<.requires/> directory accompanying the unit file. If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency C on the failing unit is set, this unit will not be started. Besides, with or without specifying C, this unit will be stopped if one of the other units is explicitly stopped. Often, it is a better choice to use C instead of C in order to achieve a system that is more robust when dealing with failing services. Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running. Specifically: failing condition checks (such as C, C, \x{2026} \x{2014} see below) do not cause the start job of a unit with a C dependency on it to fail. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a C dependency. Use the C dependency type together with C to ensure that a unit may never be in active state without a specific other unit also in active state (see below).", 'type' => 'list' }, 'Requisite', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Similar to C. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. C does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with C, to ensure this unit is not started before the other unit. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly.', 'type' => 'list' }, 'BindsTo', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Configures requirement dependencies, very similar in style to C. However, this dependency type is stronger: in addition to the effect of C it declares that if the unit bound to is stopped, this unit will be stopped too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager. When used in conjunction with C on the same unit the behaviour of C is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition check (such as C, C, \x{2026} \x{2014} see below) will be stopped, should it be running. Hence, in many cases it is best to combine C with C. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly.", 'type' => 'list' }, 'PartOf', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Configures dependencies similar to C, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency\x{a0}\x{2014} changes to this unit do not affect the listed units. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly.", 'type' => 'list' }, 'Conflicts', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'A space-separated list of unit names. Configures negative requirement dependencies. If a unit has a C setting on another unit, starting the former will stop the latter and vice versa. Note that this setting does not imply an ordering dependency, similarly to the C and C dependencies described above. This means that to ensure that the conflicting unit is stopped before the other unit is started, an C or C dependency must be declared. It doesn\'t matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in C/C below. If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction). In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped.', 'type' => 'list' }, 'Before', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C\'s start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn\'t matter if the ordering dependency is C or C, in this case. It also doesn\'t matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options.', 'type' => 'list' }, 'After', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C\'s start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn\'t matter if the ordering dependency is C or C, in this case. It also doesn\'t matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options.', 'type' => 'list' }, 'OnFailure', { 'description' => 'A space-separated list of one or more units that are activated when this unit enters the C state. A service unit using C enters the failed state only after the start limits are reached.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PropagatesReloadTo', { 'description' => 'A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ReloadPropagatedFrom', { 'description' => 'A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'JoinsNamespaceOf', { 'description' => 'For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join. This only applies to unit types which support the C, C and C directives (see L for details). If a unit that has this setting set is started, its processes will see the same C, C and network namespace as one listed unit that is started. If multiple listed units are already started, it is not defined which namespace is joined. Note that this setting only has an effect if C/C and/or C is enabled for both the unit that joins the namespace and the unit whose namespace is joined.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RequiresMountsFor', { 'description' => 'Takes a space-separated list of absolute paths. Automatically adds dependencies of type C and C for all mount units required to access the specified path. Mount points marked with C are not mounted automatically through C, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnFailureJobMode', { 'description' => 'Takes a value of C, C, C, C, C, C or C. Defaults to C. Specifies how the units listed in C will be enqueued. See L\'s C<--job-mode=> option for details on the possible values. If this is set to C, only a single unit may be listed in C..', 'migrate_from' => { 'formula' => '$unit', 'variables' => { 'unit' => '- OnFailureIsolate' } }, 'type' => 'leaf', 'value_type' => 'uniline' }, 'IgnoreOnIsolate', { 'description' => 'Takes a boolean argument. If C, this unit will not be stopped when isolating another unit. Defaults to C for service, target, socket, busname, timer, and path units, and C for slice, scope, device, swap, mount, and automount units.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'StopWhenUnneeded', { 'description' => 'Takes a boolean argument. If C, this unit will be stopped when it is no longer used. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down. If this option is set, a unit will be automatically cleaned up if no other active unit requires it. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RefuseManualStart', { 'description' => 'Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RefuseManualStop', { 'description' => 'Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'AllowIsolate', { 'description' => 'Takes a boolean argument. If C, this unit may be used with the systemctl isolate command. Otherwise, this will be refused. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states. This option defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'DefaultDependencies', { 'description' => 'Takes a boolean argument. If C, (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to C. It is highly recommended to leave this option enabled for the majority of common units. If set to C, this option does not disable all implicit dependencies, just non-essential ones.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'CollectMode', { 'choice' => [ 'inactive', 'inactive-or-failed' ], 'description' => "Tweaks the \"garbage collection\" algorithm for this unit. Takes one of C or C. If set to C the unit will be unloaded if it is in the C state and is not referenced by clients, jobs or other units \x{2014} however it is not unloaded if it is in the C state. In C mode, failed units are not unloaded until the user invoked systemctl reset-failed on them to reset the C state, or an equivalent command. This behaviour is altered if this option is set to C: in this case the unit is unloaded even if the unit is in a C state, and thus an explicitly resetting of the C state is not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, \x{2026}) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem. Defaults to C.", 'type' => 'leaf', 'value_type' => 'enum' }, 'FailureActionExitStatus', { 'description' => "Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0\x{2026}255 or the empty string to request default behaviour.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'SuccessActionExitStatus', { 'description' => "Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0\x{2026}255 or the empty string to request default behaviour.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'JobTimeoutSec', { 'description' => 'When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'JobRunningTimeoutSec', { 'description' => 'When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'JobTimeoutAction', { 'description' => 'C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'JobTimeoutRebootArgument', { 'description' => 'C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure an additional action to take if the rate limit configured with C and C is hit. Takes the same values as the setting C/C settings and executes the same actions. If C is set, hitting the rate limit will trigger no action besides that the start will not be permitted. Defaults to C.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SourcePath', { 'description' => 'A path to a configuration file this unit has been generated from. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files. This functionality should not be used in normal units.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ConditionArchitecture', { 'cargo' => { 'choice' => [ 'x86', 'x86-64', 'ppc', 'ppc-le', 'ppc64', 'ppc64-le', 'ia64', 'parisc', 'parisc64', 's390', 's390x', 'sparc', 'sparc64', 'mips', 'mips-le', 'mips64', 'mips64-le', 'alpha', 'arm', 'arm-be', 'arm64', 'arm64-be', 'sh', 'sh64', 'm68k', 'tilegx', 'cris', 'arc', 'arc-be', 'native' ], 'type' => 'leaf', 'value_type' => 'enum' }, 'description' => 'Check whether the system is running on a specific architecture. Takes one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, or C. The architecture is determined from the information returned by L and is thus subject to L. Note that a C setting in the same unit file has no effect on this condition. A special architecture name C is mapped to the architecture the system manager itself is compiled for. The test may be negated by prepending an exclamation mark.', 'type' => 'list' }, 'ConditionVirtualization', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation. Takes either boolean value to check if being executed in any virtualized environment, or one of C and C to test against a generic type of virtualization solution, or one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C to test against a specific implementation, or C to check whether we are running in a user namespace. See L for a full list of known virtualization technologies and their identifiers. If multiple virtualization technologies are nested, only the innermost is considered. The test may be negated by prepending an exclamation mark.', 'type' => 'list' }, 'ConditionHost', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C may be used to match against the hostname or machine ID of the host. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by L, or a machine ID formatted as string (see L). The test may be negated by prepending an exclamation mark.', 'type' => 'list' }, 'ConditionKernelCommandLine', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "C may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark \x{2014} unset). The argument must either be a single word, or an assignment (i.e. two words, separated by C<=>). In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is looked for with right and left hand side matching.", 'type' => 'list' }, 'ConditionKernelVersion', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C may be used to check whether the kernel version (as reported by uname -r) matches a certain expression (or if prefixed with the exclamation mark does not match it). The argument must be a list of (potentially quoted) expressions. For each of the expressions, if it starts with one of C<<>, C<<=>, C<=>, C, C<>=>, C<>> a relative version comparison is done, otherwise the specified string is matched with shell-style globs. Note that using the kernel version string is an unreliable way to determine which features are supported by a kernel, because of the widespread practice of backporting drivers, features, and fixes from newer upstream kernels into older versions provided by distributions. Hence, this check is inherently unportable and should not be used for units which may be used on different distributions.', 'type' => 'list' }, 'ConditionSecurity', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C may be used to check whether the given security technology is enabled on the system. Currently, the recognized values are C, C, C, C, C, C and C. The test may be negated by prepending an exclamation mark.', 'type' => 'list' }, 'ConditionCapability', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check whether the given capability exists in the capability bounding set of the service manager (i.e. this does not check whether capability is actually available in the permitted or effective sets, see L for details). Pass a capability name such as C, possibly prefixed with an exclamation mark to negate the check.', 'type' => 'list' }, 'ConditionACPower', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit. This takes a boolean argument. If set to C, the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known. Conversely, if set to C, the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source.', 'type' => 'list' }, 'ConditionNeedsUpdate', { 'cargo' => { 'choice' => [ '/var', '/etc', '!/var', '!/etc' ], 'type' => 'leaf', 'value_type' => 'enum' }, 'description' => 'Takes one of C or C as argument, possibly prefixed with a C (to inverting the condition). This condition may be used to conditionalize units on whether the specified directory requires an update because C\'s modification time is newer than the stamp file C<.updated> in the specified directory. This is useful to implement offline updates of the vendor operating system resources in C that require updating of C or C on the next following boot. Units making use of this condition should order themselves before L, to make sure they run before the stamp file\'s modification time gets reset indicating a completed update.', 'type' => 'list' }, 'ConditionFirstBoot', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'description' => 'Takes a boolean argument. This condition may be used to conditionalize units on whether the system is booting up with an unpopulated C directory (specifically: an C with no C). This may be used to populate C on the first boot after factory reset, or when a new system instance boots up for the first time.', 'type' => 'list' }, 'ConditionPathExists', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check for the exists of a file. If the specified absolute path name does not exist, the condition will fail. If the absolute path name passed to C is prefixed with an exclamation mark (C), the test is negated, and the unit is only started if the path does not exist.', 'type' => 'list' }, 'ConditionPathExistsGlob', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C, but checks for the existence of at least one file or directory matching the specified globbing pattern.', 'type' => 'list' }, 'ConditionPathIsDirectory', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists and is a directory.', 'type' => 'list' }, 'ConditionPathIsSymbolicLink', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists and is a symbolic link.', 'type' => 'list' }, 'ConditionPathIsMountPoint', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists and is a mount point.', 'type' => 'list' }, 'ConditionPathIsReadWrite', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that the underlying file system is readable and writable (i.e. not mounted read-only).', 'type' => 'list' }, 'ConditionDirectoryNotEmpty', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists and is a non-empty directory.', 'type' => 'list' }, 'ConditionFileNotEmpty', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists and refers to a regular file with a non-zero size.', 'type' => 'list' }, 'ConditionFileIsExecutable', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that a certain path exists, is a regular file, and marked executable.', 'type' => 'list' }, 'ConditionUser', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C takes a numeric C, a UNIX user name, or the special value C<@system>. This condition may be used to check whether the service manager is running as the given user. The special value C<@system> can be used to check if the user id is within the system user range. This option is not useful for system services, as the system manager exclusively runs as the root user, and thus the test result is constant.', 'type' => 'list' }, 'ConditionGroup', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that the service manager\'s real or effective group, or any of its auxiliary groups, match the specified group or GID. This setting does not support the special value C<@system>.', 'type' => 'list' }, 'ConditionControlGroupController', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the given cgroup controller (eg. C) is available for use on the system. For example, a particular controller may not be available if it was disabled on the kernel command line with C. Multiple controllers may be passed with a space separating them; in this case the condition will only pass if all listed controllers are available for use. Controllers unknown to systemd are ignored. Valid controllers are C, C, C, C, C, C, and C.', 'type' => 'list' }, 'ConditionMemory', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the specified amount of system memory is available to the current system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. On bare-metal systems compares the amount of physical memory in the system with the specified size, adhering to the specified comparison operator. In containers compares the amount of memory assigned to the container instead.', 'type' => 'list' }, 'ConditionCPUs', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the specified number of CPUs is available to the current system. Takes a number of CPUs as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. Compares the number of CPUs in the CPU affinity mask configured of the service manager itself with the specified number, adhering to the specified comparison operator. On physical systems the number of CPUs in the affinity mask of the service manager usually matches the number of physical CPUs, but in special and virtual environments might differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container and not the physically available ones.', 'type' => 'list' }, 'AssertArchitecture', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertVirtualization', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertHost', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertKernelCommandLine', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertKernelVersion', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertSecurity', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertCapability', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertACPower', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertNeedsUpdate', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertFirstBoot', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathExists', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathExistsGlob', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathIsDirectory', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathIsSymbolicLink', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathIsMountPoint', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertPathIsReadWrite', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertDirectoryNotEmpty', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertFileNotEmpty', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertFileIsExecutable', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertUser', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertGroup', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'AssertControlGroupController', { 'description' => "Similar to the C, C, \x{2026}, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitInterval', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'StartLimitInterval is now StartLimitIntervalSec.' }, 'OnFailureIsolate', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'OnFailureIsolate is now OnFailureJobMode.' } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Unit' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/ServiceUnit.pod0000644000175000017500000016451513575500330026530 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::ServiceUnit # ABSTRACT: Configuration class Systemd::Section::ServiceUnit =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::ServiceUnit - Configuration class Systemd::Section::ServiceUnit =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 Description A human readable name for the unit. This is used by systemd (and other UIs) as the label for the unit, so this string should identify the unit rather than describe it, despite the name. C is a good example. Bad examples are C (too generic) or C (too specific and meaningless for people who do not know Apache). systemd will use this string as a noun in status messages (C, C, C, C), so it should be capitalized, and should not be a full sentence or a phrase with a continuous verb. Bad examples include C or C. I< Optional. Type uniline. > =head2 Documentation A space-separated list of URIs referencing documentation for this unit or its configuration. Accepted are only URIs of the types C, C, C, C, C. For more information about the syntax of these URIs, see L. The URIs should be listed in order of relevance, starting with the most relevant. It is a good idea to first reference documentation that explains what the unit's purpose is, followed by how it is configured, followed by any other related documentation. This option may be specified more than once, in which case the specified list of URIs is merged. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect. I< Optional. Type list of uniline. > =head2 Wants Configures requirement dependencies on other units. This option may be specified more than once or multiple space-separated units may be specified in one option in which case dependencies for all listed names will be created. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a C<.wants/> directory accompanying the unit file. For details, see above. Units listed in this option will be started if the configuring unit is. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started. This is the recommended way to hook start-up of one unit to the start-up of another unit. Note that requirement dependencies do not influence the order in which services are started or stopped. This has to be configured independently with the C or C options. If unit C pulls in unit C as configured with C and no ordering is configured with C or C, then both units will be started simultaneously and without any delay between them if C is activated. I< Optional. Type list of uniline. > =head2 Requires Similar to C, but declares a stronger dependency. Dependencies of this type may also be configured by adding a symlink to a C<.requires/> directory accompanying the unit file. If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency C on the failing unit is set, this unit will not be started. Besides, with or without specifying C, this unit will be stopped if one of the other units is explicitly stopped. Often, it is a better choice to use C instead of C in order to achieve a system that is more robust when dealing with failing services. Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running. Specifically: failing condition checks (such as C, C, … — see below) do not cause the start job of a unit with a C dependency on it to fail. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a C dependency. Use the C dependency type together with C to ensure that a unit may never be in active state without a specific other unit also in active state (see below). I< Optional. Type list of uniline. > =head2 Requisite Similar to C. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. C does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with C, to ensure this unit is not started before the other unit. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 BindsTo Configures requirement dependencies, very similar in style to C. However, this dependency type is stronger: in addition to the effect of C it declares that if the unit bound to is stopped, this unit will be stopped too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager. When used in conjunction with C on the same unit the behaviour of C is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition check (such as C, C, … — see below) will be stopped, should it be running. Hence, in many cases it is best to combine C with C. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 PartOf Configures dependencies similar to C, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency — changes to this unit do not affect the listed units. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 Conflicts A space-separated list of unit names. Configures negative requirement dependencies. If a unit has a C setting on another unit, starting the former will stop the latter and vice versa. Note that this setting does not imply an ordering dependency, similarly to the C and C dependencies described above. This means that to ensure that the conflicting unit is stopped before the other unit is started, an C or C dependency must be declared. It doesn't matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in C/C below. If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction). In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped. I< Optional. Type list of uniline. > =head2 Before These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 After These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 OnFailure A space-separated list of one or more units that are activated when this unit enters the C state. A service unit using C enters the failed state only after the start limits are reached. I< Optional. Type uniline. > =head2 PropagatesReloadTo A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 ReloadPropagatedFrom A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 JoinsNamespaceOf For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join. This only applies to unit types which support the C, C and C directives (see L for details). If a unit that has this setting set is started, its processes will see the same C, C and network namespace as one listed unit that is started. If multiple listed units are already started, it is not defined which namespace is joined. Note that this setting only has an effect if C/C and/or C is enabled for both the unit that joins the namespace and the unit whose namespace is joined. I< Optional. Type uniline. > =head2 RequiresMountsFor Takes a space-separated list of absolute paths. Automatically adds dependencies of type C and C for all mount units required to access the specified path. Mount points marked with C are not mounted automatically through C, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit. I< Optional. Type uniline. > =head2 OnFailureJobMode Takes a value of C, C, C, C, C, C or C. Defaults to C. Specifies how the units listed in C will be enqueued. See L's C<--job-mode=> option for details on the possible values. If this is set to C, only a single unit may be listed in C.. I< Optional. Type uniline. > Note: OnFailureJobMode is migrated with 'C<$unit>' and with: =over =item * C<$unit> => C<- OnFailureIsolate> =back =head2 IgnoreOnIsolate Takes a boolean argument. If C, this unit will not be stopped when isolating another unit. Defaults to C for service, target, socket, busname, timer, and path units, and C for slice, scope, device, swap, mount, and automount units. I< Optional. Type boolean. > =head2 StopWhenUnneeded Takes a boolean argument. If C, this unit will be stopped when it is no longer used. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down. If this option is set, a unit will be automatically cleaned up if no other active unit requires it. Defaults to C. I< Optional. Type boolean. > =head2 RefuseManualStart Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 RefuseManualStop Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 AllowIsolate Takes a boolean argument. If C, this unit may be used with the systemctl isolate command. Otherwise, this will be refused. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states. This option defaults to C. I< Optional. Type boolean. > =head2 DefaultDependencies Takes a boolean argument. If C, (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to C. It is highly recommended to leave this option enabled for the majority of common units. If set to C, this option does not disable all implicit dependencies, just non-essential ones. I< Optional. Type boolean. > =head2 CollectMode Tweaks the "garbage collection" algorithm for this unit. Takes one of C or C. If set to C the unit will be unloaded if it is in the C state and is not referenced by clients, jobs or other units — however it is not unloaded if it is in the C state. In C mode, failed units are not unloaded until the user invoked systemctl reset-failed on them to reset the C state, or an equivalent command. This behaviour is altered if this option is set to C: in this case the unit is unloaded even if the unit is in a C state, and thus an explicitly resetting of the C state is not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, …) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem. Defaults to C. I< Optional. Type enum. choice: 'inactive', 'inactive-or-failed'. > =head2 FailureActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 SuccessActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 JobTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobRunningTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobTimeoutAction C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 JobTimeoutRebootArgument C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 StartLimitAction Configure an additional action to take if the rate limit configured with C and C is hit. Takes the same values as the setting C/C settings and executes the same actions. If C is set, hitting the rate limit will trigger no action besides that the start will not be permitted. Defaults to C. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 SourcePath A path to a configuration file this unit has been generated from. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files. This functionality should not be used in normal units. I< Optional. Type uniline. > =head2 ConditionArchitecture Check whether the system is running on a specific architecture. Takes one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, or C. The architecture is determined from the information returned by L and is thus subject to L. Note that a C setting in the same unit file has no effect on this condition. A special architecture name C is mapped to the architecture the system manager itself is compiled for. The test may be negated by prepending an exclamation mark. I< Optional. Type list of enum. > =head2 ConditionVirtualization Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation. Takes either boolean value to check if being executed in any virtualized environment, or one of C and C to test against a generic type of virtualization solution, or one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C to test against a specific implementation, or C to check whether we are running in a user namespace. See L for a full list of known virtualization technologies and their identifiers. If multiple virtualization technologies are nested, only the innermost is considered. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionHost C may be used to match against the hostname or machine ID of the host. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by L, or a machine ID formatted as string (see L). The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionKernelCommandLine C may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark — unset). The argument must either be a single word, or an assignment (i.e. two words, separated by C<=>). In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is looked for with right and left hand side matching. I< Optional. Type list of uniline. > =head2 ConditionKernelVersion C may be used to check whether the kernel version (as reported by uname -r) matches a certain expression (or if prefixed with the exclamation mark does not match it). The argument must be a list of (potentially quoted) expressions. For each of the expressions, if it starts with one of C<<>, C<<=>, C<=>, C, C<>=>, C<>> a relative version comparison is done, otherwise the specified string is matched with shell-style globs. Note that using the kernel version string is an unreliable way to determine which features are supported by a kernel, because of the widespread practice of backporting drivers, features, and fixes from newer upstream kernels into older versions provided by distributions. Hence, this check is inherently unportable and should not be used for units which may be used on different distributions. I< Optional. Type list of uniline. > =head2 ConditionSecurity C may be used to check whether the given security technology is enabled on the system. Currently, the recognized values are C, C, C, C, C, C and C. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionCapability Check whether the given capability exists in the capability bounding set of the service manager (i.e. this does not check whether capability is actually available in the permitted or effective sets, see L for details). Pass a capability name such as C, possibly prefixed with an exclamation mark to negate the check. I< Optional. Type list of uniline. > =head2 ConditionACPower Check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit. This takes a boolean argument. If set to C, the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known. Conversely, if set to C, the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source. I< Optional. Type list of uniline. > =head2 ConditionNeedsUpdate Takes one of C or C as argument, possibly prefixed with a C (to inverting the condition). This condition may be used to conditionalize units on whether the specified directory requires an update because C's modification time is newer than the stamp file C<.updated> in the specified directory. This is useful to implement offline updates of the vendor operating system resources in C that require updating of C or C on the next following boot. Units making use of this condition should order themselves before L, to make sure they run before the stamp file's modification time gets reset indicating a completed update. I< Optional. Type list of enum. > =head2 ConditionFirstBoot Takes a boolean argument. This condition may be used to conditionalize units on whether the system is booting up with an unpopulated C directory (specifically: an C with no C). This may be used to populate C on the first boot after factory reset, or when a new system instance boots up for the first time. I< Optional. Type list of boolean. > =head2 ConditionPathExists Check for the exists of a file. If the specified absolute path name does not exist, the condition will fail. If the absolute path name passed to C is prefixed with an exclamation mark (C), the test is negated, and the unit is only started if the path does not exist. I< Optional. Type list of uniline. > =head2 ConditionPathExistsGlob C is similar to C, but checks for the existence of at least one file or directory matching the specified globbing pattern. I< Optional. Type list of uniline. > =head2 ConditionPathIsDirectory C is similar to C but verifies that a certain path exists and is a directory. I< Optional. Type list of uniline. > =head2 ConditionPathIsSymbolicLink C is similar to C but verifies that a certain path exists and is a symbolic link. I< Optional. Type list of uniline. > =head2 ConditionPathIsMountPoint C is similar to C but verifies that a certain path exists and is a mount point. I< Optional. Type list of uniline. > =head2 ConditionPathIsReadWrite C is similar to C but verifies that the underlying file system is readable and writable (i.e. not mounted read-only). I< Optional. Type list of uniline. > =head2 ConditionDirectoryNotEmpty C is similar to C but verifies that a certain path exists and is a non-empty directory. I< Optional. Type list of uniline. > =head2 ConditionFileNotEmpty C is similar to C but verifies that a certain path exists and refers to a regular file with a non-zero size. I< Optional. Type list of uniline. > =head2 ConditionFileIsExecutable C is similar to C but verifies that a certain path exists, is a regular file, and marked executable. I< Optional. Type list of uniline. > =head2 ConditionUser C takes a numeric C, a UNIX user name, or the special value C<@system>. This condition may be used to check whether the service manager is running as the given user. The special value C<@system> can be used to check if the user id is within the system user range. This option is not useful for system services, as the system manager exclusively runs as the root user, and thus the test result is constant. I< Optional. Type list of uniline. > =head2 ConditionGroup C is similar to C but verifies that the service manager's real or effective group, or any of its auxiliary groups, match the specified group or GID. This setting does not support the special value C<@system>. I< Optional. Type list of uniline. > =head2 ConditionControlGroupController Verify that the given cgroup controller (eg. C) is available for use on the system. For example, a particular controller may not be available if it was disabled on the kernel command line with C. Multiple controllers may be passed with a space separating them; in this case the condition will only pass if all listed controllers are available for use. Controllers unknown to systemd are ignored. Valid controllers are C, C, C, C, C, C, and C. I< Optional. Type list of uniline. > =head2 ConditionMemory Verify that the specified amount of system memory is available to the current system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. On bare-metal systems compares the amount of physical memory in the system with the specified size, adhering to the specified comparison operator. In containers compares the amount of memory assigned to the container instead. I< Optional. Type list of uniline. > =head2 ConditionCPUs Verify that the specified number of CPUs is available to the current system. Takes a number of CPUs as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. Compares the number of CPUs in the CPU affinity mask configured of the service manager itself with the specified number, adhering to the specified comparison operator. On physical systems the number of CPUs in the affinity mask of the service manager usually matches the number of physical CPUs, but in special and virtual environments might differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container and not the physically available ones. I< Optional. Type list of uniline. > =head2 AssertArchitecture Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertVirtualization Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertHost Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelCommandLine Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelVersion Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertSecurity Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertCapability Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertACPower Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertNeedsUpdate Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFirstBoot Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExists Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExistsGlob Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsDirectory Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsSymbolicLink Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsMountPoint Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsReadWrite Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertDirectoryNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileIsExecutable Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertUser Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertGroup Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertControlGroupController Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 StartLimitInterval B I< Optional. Type uniline. > =head2 OnFailureIsolate B I< Optional. Type uniline. > =head2 FailureAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > Note: FailureAction is migrated with 'C<$service>' and with: =over =item * C<$service> => C<- - Service FailureAction> =back =head2 SuccessAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > Note: SuccessAction is migrated with 'C<$service>' and with: =over =item * C<$service> => C<- - Service SuccessAction> =back =head2 StartLimitBurst Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > Note: StartLimitBurst is migrated with 'C<$service>' and with: =over =item * C<$service> => C<- - Service StartLimitBurst> =back =head2 StartLimitIntervalSec Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > Note: StartLimitIntervalSec is migrated with 'C<$unit || $service>' and with: =over =item * C<$service> => C<- - Service StartLimitInterval> =item * C<$unit> => C<- StartLimitInterval> =back =head2 RebootArgument Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command. I< Optional. Type uniline. > Note: RebootArgument is migrated with 'C<$service>' and with: =over =item * C<$service> => C<- - Service RebootArgument> =back =head1 SEE ALSO =over =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/SocketUnit.pod0000644000175000017500000016314613575500330026357 0ustar domidomi# PODNAME: Config::Model::models::Systemd::Section::SocketUnit # ABSTRACT: Configuration class Systemd::Section::SocketUnit =encoding utf8 =head1 NAME Config::Model::models::Systemd::Section::SocketUnit - Configuration class Systemd::Section::SocketUnit =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 Description A human readable name for the unit. This is used by systemd (and other UIs) as the label for the unit, so this string should identify the unit rather than describe it, despite the name. C is a good example. Bad examples are C (too generic) or C (too specific and meaningless for people who do not know Apache). systemd will use this string as a noun in status messages (C, C, C, C), so it should be capitalized, and should not be a full sentence or a phrase with a continuous verb. Bad examples include C or C. I< Optional. Type uniline. > =head2 Documentation A space-separated list of URIs referencing documentation for this unit or its configuration. Accepted are only URIs of the types C, C, C, C, C. For more information about the syntax of these URIs, see L. The URIs should be listed in order of relevance, starting with the most relevant. It is a good idea to first reference documentation that explains what the unit's purpose is, followed by how it is configured, followed by any other related documentation. This option may be specified more than once, in which case the specified list of URIs is merged. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect. I< Optional. Type list of uniline. > =head2 Wants Configures requirement dependencies on other units. This option may be specified more than once or multiple space-separated units may be specified in one option in which case dependencies for all listed names will be created. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a C<.wants/> directory accompanying the unit file. For details, see above. Units listed in this option will be started if the configuring unit is. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started. This is the recommended way to hook start-up of one unit to the start-up of another unit. Note that requirement dependencies do not influence the order in which services are started or stopped. This has to be configured independently with the C or C options. If unit C pulls in unit C as configured with C and no ordering is configured with C or C, then both units will be started simultaneously and without any delay between them if C is activated. I< Optional. Type list of uniline. > =head2 Requires Similar to C, but declares a stronger dependency. Dependencies of this type may also be configured by adding a symlink to a C<.requires/> directory accompanying the unit file. If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency C on the failing unit is set, this unit will not be started. Besides, with or without specifying C, this unit will be stopped if one of the other units is explicitly stopped. Often, it is a better choice to use C instead of C in order to achieve a system that is more robust when dealing with failing services. Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running. Specifically: failing condition checks (such as C, C, … — see below) do not cause the start job of a unit with a C dependency on it to fail. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a C dependency. Use the C dependency type together with C to ensure that a unit may never be in active state without a specific other unit also in active state (see below). I< Optional. Type list of uniline. > =head2 Requisite Similar to C. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. C does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with C, to ensure this unit is not started before the other unit. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 BindsTo Configures requirement dependencies, very similar in style to C. However, this dependency type is stronger: in addition to the effect of C it declares that if the unit bound to is stopped, this unit will be stopped too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager. When used in conjunction with C on the same unit the behaviour of C is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition check (such as C, C, … — see below) will be stopped, should it be running. Hence, in many cases it is best to combine C with C. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 PartOf Configures dependencies similar to C, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency — changes to this unit do not affect the listed units. When C is used on C, this dependency will show as C in property listing of C. C dependency cannot be specified directly. I< Optional. Type list of uniline. > =head2 Conflicts A space-separated list of unit names. Configures negative requirement dependencies. If a unit has a C setting on another unit, starting the former will stop the latter and vice versa. Note that this setting does not imply an ordering dependency, similarly to the C and C dependencies described above. This means that to ensure that the conflicting unit is stopped before the other unit is started, an C or C dependency must be declared. It doesn't matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in C/C below. If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction). In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped. I< Optional. Type list of uniline. > =head2 Before These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 After These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created. Those two setttings configure ordering dependencies between units. If unit C contains the setting C and both units are being started, C's start-up is delayed until C has finished starting up. C is the inverse of C, i.e. while C ensures that the configured unit is started before the listed unit begins starting up, C ensures the opposite, that the listed unit is fully started up before the configured unit is started. When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with C on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It doesn't matter if the ordering dependency is C or C, in this case. It also doesn't matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of C/C when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that those settings are independent of and orthogonal to the requirement dependencies as configured by C, C, C, or C. It is a common pattern to include a unit name in both the C and C options, in which case the unit listed will be started before the unit that is configured with these options. I< Optional. Type list of uniline. > =head2 OnFailure A space-separated list of one or more units that are activated when this unit enters the C state. A service unit using C enters the failed state only after the start limits are reached. I< Optional. Type uniline. > =head2 PropagatesReloadTo A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 ReloadPropagatedFrom A space-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings. I< Optional. Type uniline. > =head2 JoinsNamespaceOf For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join. This only applies to unit types which support the C, C and C directives (see L for details). If a unit that has this setting set is started, its processes will see the same C, C and network namespace as one listed unit that is started. If multiple listed units are already started, it is not defined which namespace is joined. Note that this setting only has an effect if C/C and/or C is enabled for both the unit that joins the namespace and the unit whose namespace is joined. I< Optional. Type uniline. > =head2 RequiresMountsFor Takes a space-separated list of absolute paths. Automatically adds dependencies of type C and C for all mount units required to access the specified path. Mount points marked with C are not mounted automatically through C, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit. I< Optional. Type uniline. > =head2 OnFailureJobMode Takes a value of C, C, C, C, C, C or C. Defaults to C. Specifies how the units listed in C will be enqueued. See L's C<--job-mode=> option for details on the possible values. If this is set to C, only a single unit may be listed in C.. I< Optional. Type uniline. > Note: OnFailureJobMode is migrated with 'C<$unit>' and with: =over =item * C<$unit> => C<- OnFailureIsolate> =back =head2 IgnoreOnIsolate Takes a boolean argument. If C, this unit will not be stopped when isolating another unit. Defaults to C for service, target, socket, busname, timer, and path units, and C for slice, scope, device, swap, mount, and automount units. I< Optional. Type boolean. > =head2 StopWhenUnneeded Takes a boolean argument. If C, this unit will be stopped when it is no longer used. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down. If this option is set, a unit will be automatically cleaned up if no other active unit requires it. Defaults to C. I< Optional. Type boolean. > =head2 RefuseManualStart Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 RefuseManualStop Takes a boolean argument. If C, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to C. I< Optional. Type boolean. > =head2 AllowIsolate Takes a boolean argument. If C, this unit may be used with the systemctl isolate command. Otherwise, this will be refused. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states. This option defaults to C. I< Optional. Type boolean. > =head2 DefaultDependencies Takes a boolean argument. If C, (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to C. It is highly recommended to leave this option enabled for the majority of common units. If set to C, this option does not disable all implicit dependencies, just non-essential ones. I< Optional. Type boolean. > =head2 CollectMode Tweaks the "garbage collection" algorithm for this unit. Takes one of C or C. If set to C the unit will be unloaded if it is in the C state and is not referenced by clients, jobs or other units — however it is not unloaded if it is in the C state. In C mode, failed units are not unloaded until the user invoked systemctl reset-failed on them to reset the C state, or an equivalent command. This behaviour is altered if this option is set to C: in this case the unit is unloaded even if the unit is in a C state, and thus an explicitly resetting of the C state is not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, …) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem. Defaults to C. I< Optional. Type enum. choice: 'inactive', 'inactive-or-failed'. > =head2 FailureActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 SuccessActionExitStatus Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the C/C are set to C or C and the action is triggered. By default the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0…255 or the empty string to request default behaviour. I< Optional. Type uniline. > =head2 JobTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobRunningTimeoutSec When a job for this unit is queued, a timeout C may be configured. Similarly, C starts counting when the queued job is actually started. If either time limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. This value defaults to C (job timeouts disabled), except for device units (C defaults to C). NB: this timeout is independent from any unit-specific timeout (for example, the timeout set with C in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change. I< Optional. Type uniline. > =head2 JobTimeoutAction C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 JobTimeoutRebootArgument C optionally configures an additional action to take when the timeout is hit, see description of C and C above. It takes the same values as C. Defaults to C. C configures an optional reboot string to pass to the L system call. I< Optional. Type uniline. > =head2 StartLimitAction Configure an additional action to take if the rate limit configured with C and C is hit. Takes the same values as the setting C/C settings and executes the same actions. If C is set, hitting the rate limit will trigger no action besides that the start will not be permitted. Defaults to C. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 SourcePath A path to a configuration file this unit has been generated from. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files. This functionality should not be used in normal units. I< Optional. Type uniline. > =head2 ConditionArchitecture Check whether the system is running on a specific architecture. Takes one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, or C. The architecture is determined from the information returned by L and is thus subject to L. Note that a C setting in the same unit file has no effect on this condition. A special architecture name C is mapped to the architecture the system manager itself is compiled for. The test may be negated by prepending an exclamation mark. I< Optional. Type list of enum. > =head2 ConditionVirtualization Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation. Takes either boolean value to check if being executed in any virtualized environment, or one of C and C to test against a generic type of virtualization solution, or one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C to test against a specific implementation, or C to check whether we are running in a user namespace. See L for a full list of known virtualization technologies and their identifiers. If multiple virtualization technologies are nested, only the innermost is considered. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionHost C may be used to match against the hostname or machine ID of the host. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by L, or a machine ID formatted as string (see L). The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionKernelCommandLine C may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark — unset). The argument must either be a single word, or an assignment (i.e. two words, separated by C<=>). In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is looked for with right and left hand side matching. I< Optional. Type list of uniline. > =head2 ConditionKernelVersion C may be used to check whether the kernel version (as reported by uname -r) matches a certain expression (or if prefixed with the exclamation mark does not match it). The argument must be a list of (potentially quoted) expressions. For each of the expressions, if it starts with one of C<<>, C<<=>, C<=>, C, C<>=>, C<>> a relative version comparison is done, otherwise the specified string is matched with shell-style globs. Note that using the kernel version string is an unreliable way to determine which features are supported by a kernel, because of the widespread practice of backporting drivers, features, and fixes from newer upstream kernels into older versions provided by distributions. Hence, this check is inherently unportable and should not be used for units which may be used on different distributions. I< Optional. Type list of uniline. > =head2 ConditionSecurity C may be used to check whether the given security technology is enabled on the system. Currently, the recognized values are C, C, C, C, C, C and C. The test may be negated by prepending an exclamation mark. I< Optional. Type list of uniline. > =head2 ConditionCapability Check whether the given capability exists in the capability bounding set of the service manager (i.e. this does not check whether capability is actually available in the permitted or effective sets, see L for details). Pass a capability name such as C, possibly prefixed with an exclamation mark to negate the check. I< Optional. Type list of uniline. > =head2 ConditionACPower Check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit. This takes a boolean argument. If set to C, the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known. Conversely, if set to C, the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source. I< Optional. Type list of uniline. > =head2 ConditionNeedsUpdate Takes one of C or C as argument, possibly prefixed with a C (to inverting the condition). This condition may be used to conditionalize units on whether the specified directory requires an update because C's modification time is newer than the stamp file C<.updated> in the specified directory. This is useful to implement offline updates of the vendor operating system resources in C that require updating of C or C on the next following boot. Units making use of this condition should order themselves before L, to make sure they run before the stamp file's modification time gets reset indicating a completed update. I< Optional. Type list of enum. > =head2 ConditionFirstBoot Takes a boolean argument. This condition may be used to conditionalize units on whether the system is booting up with an unpopulated C directory (specifically: an C with no C). This may be used to populate C on the first boot after factory reset, or when a new system instance boots up for the first time. I< Optional. Type list of boolean. > =head2 ConditionPathExists Check for the exists of a file. If the specified absolute path name does not exist, the condition will fail. If the absolute path name passed to C is prefixed with an exclamation mark (C), the test is negated, and the unit is only started if the path does not exist. I< Optional. Type list of uniline. > =head2 ConditionPathExistsGlob C is similar to C, but checks for the existence of at least one file or directory matching the specified globbing pattern. I< Optional. Type list of uniline. > =head2 ConditionPathIsDirectory C is similar to C but verifies that a certain path exists and is a directory. I< Optional. Type list of uniline. > =head2 ConditionPathIsSymbolicLink C is similar to C but verifies that a certain path exists and is a symbolic link. I< Optional. Type list of uniline. > =head2 ConditionPathIsMountPoint C is similar to C but verifies that a certain path exists and is a mount point. I< Optional. Type list of uniline. > =head2 ConditionPathIsReadWrite C is similar to C but verifies that the underlying file system is readable and writable (i.e. not mounted read-only). I< Optional. Type list of uniline. > =head2 ConditionDirectoryNotEmpty C is similar to C but verifies that a certain path exists and is a non-empty directory. I< Optional. Type list of uniline. > =head2 ConditionFileNotEmpty C is similar to C but verifies that a certain path exists and refers to a regular file with a non-zero size. I< Optional. Type list of uniline. > =head2 ConditionFileIsExecutable C is similar to C but verifies that a certain path exists, is a regular file, and marked executable. I< Optional. Type list of uniline. > =head2 ConditionUser C takes a numeric C, a UNIX user name, or the special value C<@system>. This condition may be used to check whether the service manager is running as the given user. The special value C<@system> can be used to check if the user id is within the system user range. This option is not useful for system services, as the system manager exclusively runs as the root user, and thus the test result is constant. I< Optional. Type list of uniline. > =head2 ConditionGroup C is similar to C but verifies that the service manager's real or effective group, or any of its auxiliary groups, match the specified group or GID. This setting does not support the special value C<@system>. I< Optional. Type list of uniline. > =head2 ConditionControlGroupController Verify that the given cgroup controller (eg. C) is available for use on the system. For example, a particular controller may not be available if it was disabled on the kernel command line with C. Multiple controllers may be passed with a space separating them; in this case the condition will only pass if all listed controllers are available for use. Controllers unknown to systemd are ignored. Valid controllers are C, C, C, C, C, C, and C. I< Optional. Type list of uniline. > =head2 ConditionMemory Verify that the specified amount of system memory is available to the current system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. On bare-metal systems compares the amount of physical memory in the system with the specified size, adhering to the specified comparison operator. In containers compares the amount of memory assigned to the container instead. I< Optional. Type list of uniline. > =head2 ConditionCPUs Verify that the specified number of CPUs is available to the current system. Takes a number of CPUs as argument, optionally prefixed with a comparison operator C<<>, C<<=>, C<=>, C, C<>=>, C<>>. Compares the number of CPUs in the CPU affinity mask configured of the service manager itself with the specified number, adhering to the specified comparison operator. On physical systems the number of CPUs in the affinity mask of the service manager usually matches the number of physical CPUs, but in special and virtual environments might differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container and not the physically available ones. I< Optional. Type list of uniline. > =head2 AssertArchitecture Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertVirtualization Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertHost Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelCommandLine Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertKernelVersion Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertSecurity Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertCapability Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertACPower Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertNeedsUpdate Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFirstBoot Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExists Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathExistsGlob Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsDirectory Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsSymbolicLink Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsMountPoint Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertPathIsReadWrite Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertDirectoryNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileNotEmpty Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertFileIsExecutable Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertUser Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertGroup Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 AssertControlGroupController Similar to the C, C, …, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly). Note that hitting a configured assertion does not cause the unit to enter the C state (or in fact result in any state change of the unit), it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. I< Optional. Type uniline. > =head2 StartLimitInterval B I< Optional. Type uniline. > =head2 OnFailureIsolate B I< Optional. Type uniline. > =head2 FailureAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 SuccessAction Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below. I< Optional. Type enum. choice: 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force'. > =head2 StartLimitBurst Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > =head2 StartLimitIntervalSec Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. I< Optional. Type uniline. > =head2 RebootArgument Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command. I< Optional. Type uniline. > =head1 SEE ALSO =over =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/TimerUnit.pl0000644000175000017500000002020513575500330026024 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'type' => 'leaf', 'value_type' => 'enum' }, 'StartLimitBurst', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitIntervalSec', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RebootArgument', { 'description' => 'Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command.', 'type' => 'leaf', 'value_type' => 'uniline' } ], 'include' => [ 'Systemd::Section::Unit' ], 'name' => 'Systemd::Section::TimerUnit' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/Service.pl0000644000175000017500000011536213575500330025515 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'A unit configuration file whose name ends in C<.service> encodes information about a process controlled and supervised by systemd. This man page lists the configuration options specific to this unit type. See L for the common options of all unit configuration files. The common configuration items are configured in the generic C<[Unit]> and C<[Install]> sections. The service specific configuration options are configured in the C<[Service]> section. Additional options are listed in L, which define the execution environment the commands are executed in, and in L, which define the way the processes of the service are terminated, and in L, which configure resource control settings for the processes of the service. If a service is requested under a certain name but no unit configuration file is found, systemd looks for a SysV init script by the same name (with the C<.service> suffix removed) and dynamically creates a service unit from that script. This is useful for compatibility with SysV. Note that this compatibility is quite comprehensive but not 100%. For details about the incompatibilities, see the Incompatibilities with SysV document. The L command allows creating C<.service> and C<.scope> units dynamically and transiently from the command line. This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'Type', { 'description' => "Configures the process start-up type for this service unit. One of C, C, C, C, C, C or C: It is generally recommended to use CC for long-running services whenever possible, as it is the simplest and fastest option. However, as this service type won't propagate service start-up failures and doesn't allow ordering of other units against completion of initialization of the service (which for example is useful if clients need to connect to the service through some form of IPC, and the IPC channel is only established by the service itself \x{2014} in contrast to doing this ahead of time through socket or bus activation or similar), it might not be sufficient for many cases. If so, C or C (the latter only in case the service provides a D-Bus interface) are the preferred options as they allow service program code to precisely schedule when to consider the service started up successfully and when to proceed with follow-up units. The C service type requires explicit support in the service codebase (as sd_notify() or an equivalent API needs to be invoked by the service at the appropriate time) \x{2014} if it's not supported, then C is an alternative: it supports the traditional UNIX service start-up protocol. Finally, C might be an option for cases where it is enough to ensure the service binary is invoked, and where the service binary itself executes no or little initialization on its own (and its initialization is unlikely to fail). Note that using any type other than C possibly delays the boot process, as the service manager needs to wait for service initialization to complete. It is hence recommended not to needlessly use any types other than C. (Also note it is generally not recommended to use C or C for long-running services.)", 'type' => 'leaf', 'value_type' => 'uniline' }, 'RemainAfterExit', { 'description' => 'Takes a boolean value that specifies whether the service shall be considered active even when all its processes exited. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'GuessMainPID', { 'description' => 'Takes a boolean value that specifies whether systemd should try to guess the main PID of a service if it cannot be determined reliably. This option is ignored unless C is set and C is unset because for the other types or with an explicitly configured PID file, the main PID is always known. The guessing algorithm might come to incorrect conclusions if a daemon consists of more than one process. If the main PID cannot be determined, failure detection and automatic restarting of a service will not work reliably. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PIDFile', { 'description' => 'Takes a path referring to the PID file of the service. Usage of this option is recommended for services where C is set to C. The path specified typically points to a file below C. If a relative path is specified it is hence prefixed with C. The service manager will read the PID of the main process of the service from this file after start-up of the service. The service manager will not write to the file configured here, although it will remove the file after the service has shut down if it still exists. The PID file does not need to be owned by a privileged user, but if it is owned by an unprivileged user additional safety restrictions are enforced: the file may not be a symlink to a file owned by a different user (neither directly nor indirectly), and the PID file must refer to a process already belonging to the service.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BusName', { 'description' => 'Takes a D-Bus bus name that this service is reachable as. This option is mandatory for services where C is set to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ExecStart', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Commands with their arguments that are executed when this service is started. The value is split into zero or more command lines according to the rules described below (see section "Command Lines" below). Unless C is C, exactly one command must be given. When C is used, zero or more commands may be specified. Commands may be specified by providing multiple command lines in the same directive, or alternatively, this directive may be specified more than once with the same effect. If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect. If no C is specified, then the service must have C and at least one C line set. (Services lacking both C and C are not valid.) For each of the specified commands, the first argument must be either an absolute path to an executable or a simple file name without any slashes. Optionally, this filename may be prefixed with a number of special characters: C<@>, C<->, C<:>, and one of C<+>/C/C may be used together and they can appear in any order. However, only one of C<+>, C, C may be used at a time. Note that these prefixes are also supported for the other command line settings, i.e. C, C, C, C and C. If more than one command is specified, the commands are invoked sequentially in the order they appear in the unit file. If one of the commands fails (and is not prefixed with C<->), other lines are not executed, and the unit is considered failed. Unless C is set, the process started via this command line will be considered the main process of the daemon.', 'type' => 'list' }, 'ExecStartPre', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Additional commands that are executed before or after the command in C, respectively. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. If any of those commands (not prefixed with C<->) fail, the rest are not executed and the unit is considered failed. C commands are only run after all C commands that were not prefixed with a C<-> exit successfully. C commands are only run after the commands specified in C have been invoked successfully, as determined by C (i.e. the process has been started for C or C, the last C process exited successfully for C, the initial process exited successfully for C, C is sent for C, or the C has been taken for C). Note that C may not be used to start long-running processes. All processes forked off by processes invoked via C will be killed before the next service process is run. Note that if any of the commands specified in C, C, or C fail (and are not prefixed with C<->, see above) or time out before the service is fully up, execution continues with commands specified in C, the commands in C are skipped.', 'type' => 'list' }, 'ExecStartPost', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Additional commands that are executed before or after the command in C, respectively. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. If any of those commands (not prefixed with C<->) fail, the rest are not executed and the unit is considered failed. C commands are only run after all C commands that were not prefixed with a C<-> exit successfully. C commands are only run after the commands specified in C have been invoked successfully, as determined by C (i.e. the process has been started for C or C, the last C process exited successfully for C, the initial process exited successfully for C, C is sent for C, or the C has been taken for C). Note that C may not be used to start long-running processes. All processes forked off by processes invoked via C will be killed before the next service process is run. Note that if any of the commands specified in C, C, or C fail (and are not prefixed with C<->, see above) or time out before the service is fully up, execution continues with commands specified in C, the commands in C are skipped.', 'type' => 'list' }, 'ExecCondition', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Optional commands that are executed before the command(s) in C. Syntax is the same as for C, except that multiple command lines are allowed and the commands are executed one after the other, serially. The behavior is like an C and condition check hybrid: when an C command exits with exit code 1 through 254 (inclusive), the remaining commands are skipped and the unit is not marked as failed. However, if an C command exits with 255 or abnormally (e.g. timeout, killed by a signal, etc.), the unit will be considered failed (and remaining commands will be skipped). Exit code of 0 or those matching C will continue execution to the next command(s). The same recommendations about not running long-running processes in C also applies to C. C will also run the commands in C, as part of stopping the service, in the case of any non-zero or abnormal exits, like the ones described above.', 'type' => 'list' }, 'ExecReload', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Commands to execute to trigger a configuration reload in the service. This argument takes multiple command lines, following the same scheme as described for C above. Use of this setting is optional. Specifier and environment variable substitution is supported here following the same scheme as for C. One additional, special environment variable is set: if known, C<$MAINPID> is set to the main process of the daemon, and may be used for command lines like the following: Note however that reloading a daemon by sending a signal (as with the example line above) is usually not a good choice, because this is an asynchronous operation and hence not suitable to order reloads of multiple services against each other. It is strongly recommended to set C to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete.', 'type' => 'list' }, 'ExecStop', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Commands to execute to stop the service started via C. This argument takes multiple command lines, following the same scheme as described for C above. Use of this setting is optional. After the commands configured in this option are run, it is implied that the service is stopped, and any processes remaining for it are terminated according to the C setting (see L). If this option is not specified, the process is terminated by sending the signal specified in C or C when service stop is requested. Specifier and environment variable substitution is supported (including C<$MAINPID>, see above). Note that it is usually not sufficient to specify a command for this setting that only asks the service to terminate (for example, by sending some form of termination signal to it), but does not wait for it to do so. Since the remaining processes of the services are killed according to C and C or C as described above immediately after the command exited, this may not result in a clean stop. The specified command should hence be a synchronous operation, not an asynchronous one. Note that the commands specified in C are only executed when the service started successfully first. They are not invoked if the service was never started at all, or in case its start-up failed, for example because any of the commands specified in C, C or C failed (and weren\'t prefixed with C<->, see above) or timed out. Use C to invoke commands when a service failed to start up correctly and is shut down again. Also note that the stop operation is always performed if the service started successfully, even if the processes in the service terminated on their own or were killed. The stop commands must be prepared to deal with that case. C<$MAINPID> will be unset if systemd knows that the main process exited by the time the stop commands are called. Service restart requests are implemented as stop operations followed by start operations. This means that C and C are executed during a service restart operation. It is recommended to use this setting for commands that communicate with the service requesting clean termination. For post-mortem clean-up steps use C instead. ', 'type' => 'list' }, 'ExecStopPost', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Additional commands that are executed after the service is stopped. This includes cases where the commands configured in C were used, where the service does not have any C defined, or where the service exited unexpectedly. This argument takes multiple command lines, following the same scheme as described for C. Use of these settings is optional. Specifier and environment variable substitution is supported. Note that \x{2013} unlike C \x{2013} commands specified with this setting are invoked when a service failed to start up correctly and is shut down again. It is recommended to use this setting for clean-up operations that shall be executed even when the service failed to start up correctly. Commands configured with this setting need to be able to operate even if the service failed starting up half-way and left incompletely initialized data around. As the service's processes have been terminated already when the commands specified with this setting are executed they should not attempt to communicate with them. Note that all commands that are configured with this setting are invoked with the result code of the service, as well as the main process' exit code and status, set in the C<\$SERVICE_RESULT>, C<\$EXIT_CODE> and C<\$EXIT_STATUS> environment variables, see L for details.", 'type' => 'list' }, 'RestartSec', { 'description' => 'Configures the time to sleep before restarting a service (as configured with C). Takes a unit-less value in seconds, or a time span value such as "5min 20s". Defaults to 100ms.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TimeoutStartSec', { 'description' => "Configures the time to wait for start-up. If a daemon service does not signal start-up completion within the configured time, the service will be considered failed and will be shut down again. Takes a unit-less value in seconds, or a time span value such as \"5min 20s\". Pass C to disable the timeout logic. Defaults to C from the manager configuration file, except when C is used, in which case the timeout is disabled by default (see L). If a service of C sends C, this may cause the start time to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the start time has exended beyond C, the service manager will allow the service to continue to start, provided the service repeats C within the interval specified until the service startup status is finished by C. (see L). ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'TimeoutStopSec', { 'description' => "This option serves two purposes. First, it configures the time to wait for each C command. If any of them times out, subsequent C commands are skipped and the service will be terminated by C. If no C commands are specified, the service gets the C immediately. Second, it configures the time to wait for the service itself to stop. If it doesn't terminate in the specified time, it will be forcibly terminated by C (see C in L). Takes a unit-less value in seconds, or a time span value such as \"5min 20s\". Pass C to disable the timeout logic. Defaults to C from the manager configuration file (see L). If a service of C sends C, this may cause the stop time to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the stop time has exended beyond C, the service manager will allow the service to continue to stop, provided the service repeats C within the interval specified, or terminates itself (see L). ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'TimeoutAbortSec', { 'description' => "This option configures the time to wait for the service to terminate when it was aborted due to a watchdog timeout (see C). If the service has a short C this option can be used to give the system more time to write a core dump of the service. Upon expiration the service will be forcibly terminated by C (see C in L). The core file will be truncated in this case. Use C to set a sensible timeout for the core dumping per service that is large enough to write all expected data while also being short enough to handle the service failure in due time. Takes a unit-less value in seconds, or a time span value such as \"5min 20s\". Pass an empty value to skip the dedicated watchdog abort timeout handling and fall back C. Pass C to disable the timeout logic. Defaults to C from the manager configuration file (see L). If a service of C handles C itself (instead of relying on the kernel to write a core dump) it can send C to extended the abort time beyond C. The first receipt of this message must occur before C is exceeded, and once the abort time has exended beyond C, the service manager will allow the service to continue to abort, provided the service repeats C within the interval specified, or terminates itself (see L). ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'TimeoutSec', { 'description' => 'A shorthand for configuring both C and C to the specified value. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RuntimeMaxSec', { 'description' => "Configures a maximum time for the service to run. If this is used and the service has been active for longer than the specified time it is terminated and put into a failure state. Note that this setting does not have any effect on C services, as they terminate immediately after activation completed. Pass C (the default) to configure no runtime limit. If a service of C sends C, this may cause the runtime to be extended beyond C. The first receipt of this message must occur before C is exceeded, and once the runtime has exended beyond C, the service manager will allow the service to continue to run, provided the service repeats C within the interval specified until the service shutdown is achieved by C (or termination). (see L). ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'WatchdogSec', { 'description' => 'Configures the watchdog timeout for a service. The watchdog is activated when the start-up is completed. The service must call L regularly with C (i.e. the "keep-alive ping"). If the time between two such calls is larger than the configured time, then the service is placed in a failed state and it will be terminated with C (or the signal specified by C). By setting C to C, C, C or C, the service will be automatically restarted. The time configured here will be passed to the executed service process in the C environment variable. This allows daemons to automatically enable the keep-alive pinging logic if watchdog support is enabled for the service. If this option is used, C (see below) should be set to open access to the notification socket provided by systemd. If C is not set, it will be implicitly set to C
. Defaults to 0, which disables this feature. The service can check whether the service manager expects watchdog keep-alive notifications. See L for details. L may be used to enable automatic watchdog notification support. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Restart', { 'choice' => [ 'no', 'on-success', 'on-failure', 'on-abnormal', 'on-watchdog', 'on-abort', 'always' ], 'description' => 'Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached. The service process may be the main service process, but it may also be one of the processes specified with C, C, C, C, or C. When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted. Timeouts include missing the watchdog "keep-alive ping" deadline and a service start, reload, and stop operation timeouts. Takes one of C, C, C, C, C, C, or C. If set to C (the default), the service will not be restarted. If set to C, it will be restarted only when the service process exits cleanly. In this context, a clean exit means an exit code of 0, or one of the signals C, C, C or C, and additionally, exit statuses and signals specified in C. If set to C, the service will be restarted when the process exits with a non-zero exit code, is terminated by a signal (including on core dump, but excluding the aforementioned four signals), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered. If set to C, the service will be restarted when the process is terminated by a signal (including on core dump, excluding the aforementioned four signals), when an operation times out, or when the watchdog timeout is triggered. If set to C, the service will be restarted only if the service process exits due to an uncaught signal not specified as a clean exit status. If set to C, the service will be restarted only if the watchdog timeout for the service expires. If set to C, the service will be restarted regardless of whether it exited cleanly or not, got terminated abnormally by a signal, or hit a timeout. As exceptions to the setting above, the service will not be restarted if the exit code or signal is specified in C (see below) or the service is stopped with systemctl stop or an equivalent operation. Also, the services will always be restarted if the exit code or signal is specified in C (see below). Note that service restart is subject to unit start rate limiting configured with C and C, see L for details. A restarted service enters the failed state only after the start limits are reached. Setting this to C is the recommended choice for long-running services, in order to increase reliability by attempting automatic recovery from errors. For services that shall be able to terminate on their own choice (and avoid immediate restarting), C is an alternative choice.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessExitStatus', { 'description' => 'Takes a list of exit status definitions that, when returned by the main service process, will be considered successful termination, in addition to the normal successful exit code 0 and the signals C, C, C, and C. Exit status definitions can be numeric exit codes, termination code names, or termination signal names, separated by spaces. See the Process Exit Codes section in L for a list of termination codes names (for this setting only the part without the C or C prefix should be used). See L for a list of signal names. This option may appear more than once, in which case the list of successful exit statuses is merged. If the empty string is assigned to this option, the list is reset, all prior assignments of this option will have no effect. Note: systemd-analyze exit-codes may be used to list exit codes and translate between numerical code values and names.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestartPreventExitStatus', { 'description' => "Takes a list of exit status definitions that, when returned by the main service process, will prevent automatic service restarts, regardless of the restart setting configured with C. Exit status definitions can either be numeric exit codes or termination signal names, and are separated by spaces. Defaults to the empty list, so that, by default, no exit status is excluded from the configured restart logic. For example: RestartPreventExitStatus=1 6 SIGABRT ensures that exit codes 1 and 6 and the termination signal C will not result in automatic service restarting. This option may appear more than once, in which case the list of restart-preventing statuses is merged. If the empty string is assigned to this option, the list is reset and all prior assignments of this option will have no effect. Note that this setting has no effect on processes configured via C, C, C, C or C, but only on the main service process, i.e. either the one invoked by C or (depending on C, C, \x{2026}) the otherwise configured main process.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestartForceExitStatus', { 'description' => 'Takes a list of exit status definitions that, when returned by the main service process, will force automatic service restarts, regardless of the restart setting configured with C. The argument format is similar to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootDirectoryStartOnly', { 'description' => 'Takes a boolean argument. If true, the root directory, as configured with the C option (see L for more information), is only applied to the process started with C, and not to the various other C, C, C, C, and C commands. If false, the setting is applied to all configured commands the same way. Defaults to false.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'NonBlocking', { 'description' => 'Set the C flag for all file descriptors passed via socket-based activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), excluding those passed in via the file descriptor storage logic (see C for details), will have the C flag set and hence are in non-blocking mode. This option is only useful in conjunction with a socket unit, as described in L and has no effect on file descriptors which were previously saved in the file-descriptor store for example. Defaults to false.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'NotifyAccess', { 'choice' => [ 'none', 'main', 'exec', 'all' ], 'description' => 'Controls access to the service status notification socket, as accessible via the L call. Takes one of C (the default), C
, C or C. If C, no daemon status updates are accepted from the service processes, all status update messages are ignored. If C
, only service updates sent from the main process of the service are accepted. If C, only service updates sent from any of the main or control processes originating from one of the C commands are accepted. If C, all services updates from all members of the service\'s control group are accepted. This option should be set to open access to the notification socket when using C or C (see above). If those options are used but C is not configured, it will be implicitly set to C
. Note that sd_notify() notifications may be attributed to units correctly only if either the sending process is still around at the time PID 1 processes the message, or if the sending process is explicitly runtime-tracked by the service manager. The latter is the case if the service manager originally forked off the process, i.e. on all processes that match C
or C. Conversely, if an auxiliary process of the unit sends an sd_notify() message and immediately exits, the service manager might not be able to properly attribute the message to the unit, and thus will ignore it, even if CC is set for it.', 'type' => 'leaf', 'value_type' => 'enum' }, 'Sockets', { 'description' => 'Specifies the name of the socket units this service shall inherit socket file descriptors from when the service is started. Normally, it should not be necessary to use this setting, as all socket file descriptors whose unit shares the same name as the service (subject to the different unit name suffix of course) are passed to the spawned process. Note that the same socket file descriptors may be passed to multiple processes simultaneously. Also note that a different service may be activated on incoming socket traffic than the one which is ultimately configured to inherit the socket file descriptors. Or, in other words: the C setting of C<.socket> units does not have to match the inverse of the C setting of the C<.service> it refers to. This option may appear more than once, in which case the list of socket units is merged. Note that once set, clearing the list of sockets again (for example, by assigning the empty string to this option) is not supported.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FileDescriptorStoreMax', { 'description' => 'Configure how many file descriptors may be stored in the service manager for the service using L\'s C messages. This is useful for implementing services that can restart after an explicit request or a crash without losing state. Any open sockets and other file descriptors which should not be closed during the restart may be stored this way. Application state can either be serialized to a file in C, or better, stored in a L memory file descriptor. Defaults to 0, i.e. no file descriptors may be stored in the service manager. All file descriptors passed to the service manager from a specific service are passed back to the service\'s main process on the next service restart. Any file descriptors passed to the service manager are automatically closed when C or C is seen on them, or when the service is fully stopped and no job is queued or being executed for it. If this option is used, C (see above) should be set to open access to the notification socket provided by systemd. If C is not set, it will be implicitly set to C
.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'USBFunctionDescriptors', { 'description' => 'Configure the location of a file containing USB FunctionFS descriptors, for implementation of USB gadget functions. This is used only in conjunction with a socket unit with C configured. The contents of this file are written to the C file after it is opened.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'USBFunctionStrings', { 'description' => 'Configure the location of a file containing USB FunctionFS strings. Behavior is similar to C above.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OOMPolicy', { 'description' => 'Configure the Out-Of-Memory (OOM) killer policy. On Linux, when memory becomes scarce the kernel might decide to kill a running process in order to free up memory and reduce memory pressure. This setting takes one of C, C or C. If set to C and a process of the service is killed by the kernel\'s OOM killer this is logged but the service continues running. If set to C the event is logged but the service is terminated cleanly by the service manager. If set to C and one of the service\'s processes is killed by the OOM killer the kernel is instructed to kill all remaining processes of the service, too. Defaults to the setting C in L is set to, except for services where C is turned on, where it defaults to C. Use the C setting to configure whether processes of the unit shall be considered preferred or less preferred candidates for process termination by the Linux OOM killer logic. See L for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FailureAction', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'FailureAction is now part of Unit.' }, 'SuccessAction', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'SuccessAction is now part of Unit.' }, 'StartLimitBurst', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'StartLimitBurst is now part of Unit.' }, 'StartLimitInterval', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'service/StartLimitInterval is now Unit/StartLimitIntervalSec.' }, 'RebootArgument', { 'status' => 'deprecated', 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'RebootArgument is now part of Unit.' } ], 'generated_by' => 'parse-man.pl from systemd doc', 'include' => [ 'Systemd::Common::ResourceControl', 'Systemd::Common::Exec', 'Systemd::Common::Kill' ], 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Service' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Section/SocketUnit.pl0000644000175000017500000002020613575500330026175 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force' ], 'description' => 'Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of C, C, C, C, C, C, C, C, and C. In system mode, all options are allowed. In user mode, only C, C, and C are allowed. Both options default to C. If C is set, no action will be triggered. C causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl reboot). C causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and C causes immediate execution of the L system call, which might result in data loss (i.e. equivalent to systemctl reboot -ff). Similarly, C, C, C have the effect of powering down the system with similar semantics. C causes the manager to exit following the normal shutdown procedure, and C causes it terminate without shutting down services. When C or C is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with C/C, see below.', 'type' => 'leaf', 'value_type' => 'enum' }, 'StartLimitBurst', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitIntervalSec', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time interval are not permitted to start any more. Use C to configure the checking interval (defaults to C in manager configuration file, set it to 0 to disable any kind of rate limiting). Use C to configure how many starts per interval are allowed (defaults to C in manager configuration file). These configuration options are particularly useful in conjunction with the service setting C (see L); however, they apply to all kinds of starts (including manual), not just those triggered by the C logic. Note that units which are configured for C and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, after the interval has passed. From this point on, the restart logic is activated again. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards this rate limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RebootArgument', { 'description' => 'Configure the optional argument for the L system call if C or C is a reboot action. This works just like the optional argument to systemctl reboot command.', 'type' => 'leaf', 'value_type' => 'uniline' } ], 'include' => [ 'Systemd::Section::Unit' ], 'name' => 'Systemd::Section::SocketUnit' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Common/0000755000175000017500000000000013575500330023374 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Common/Kill.pl0000644000175000017500000001364013575500330024630 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'Unit configuration files for services, sockets, mount points, swap devices and scopes share a subset of configuration options which define the killing procedure of processes belonging to the unit. This man page lists the configuration options shared by these five unit types. See L for the common options shared by all unit configuration files, and L, L, L, L and L for more information on the configuration file options specific to each unit type. The kill procedure configuration options are configured in the [Service], [Socket], [Mount] or [Swap] section, depending on the unit type. This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'KillMode', { 'description' => 'Specifies how processes of this unit shall be killed. One of C, C, C, C. If set to C, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with C). If set to C, only the main process itself is killed. If set to C, the C signal (see below) is sent to the main process while the subsequent C signal (see below) is sent to all remaining processes of the unit\'s control group. If set to C, no process is killed. In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless it is empty. Processes will first be terminated via C (unless the signal to send is changed via C or C). Optionally, this is immediately followed by a C (if enabled with C). If processes still remain after the main process of a unit has exited or the delay configured via the C has passed, the termination request is repeated with the C signal or the signal specified via C (unless this is disabled via the C option). See L for more information. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'KillSignal', { 'description' => 'Specifies which signal to use when stopping a service. This controls the signal that is sent as first step of shutting down a unit (see above), and is usually followed by C (see above and below). For a list of valid signals, see L. Defaults to C. Note that, right after sending the signal specified in this setting, systemd will always send C, to ensure that even suspended tasks can be terminated cleanly.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestartKillSignal', { 'description' => 'Specifies which signal to use when restarting a service. The same as C described above, with the exception that this setting is used in a restart job. Not set by default, and the value of C is used.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SendSIGHUP', { 'description' => 'Specifies whether to send C to remaining processes immediately after sending the signal configured with C. This is useful to indicate to shells and shell-like programs that their connection has been severed. Takes a boolean value. Defaults to "no". ', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'SendSIGKILL', { 'description' => 'Specifies whether to send C (or the signal specified by C) to remaining processes after a timeout, if the normal shutdown procedure left processes of the service around. When disabled, a C of C or C service will not restart if processes from prior services exist within the control group. Takes a boolean value. Defaults to "yes". ', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'FinalKillSignal', { 'description' => 'Specifies which signal to send to remaining processes after a timeout if C is enabled. The signal configured here should be one that is not typically caught and processed by services (C is not suitable). Developers can find it useful to use this to generate a coredump to troubleshoot why a service did not terminate upon receiving the initial C signal. This can be achieved by configuring C and setting C to either C or C Defaults to C. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'WatchdogSignal', { 'description' => 'Specifies which signal to use to terminate the service when the watchdog timeout expires (enabled through C). Defaults to C. ', 'type' => 'leaf', 'value_type' => 'uniline' } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::Kill' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Common/Exec.pl0000644000175000017500000055655013575500330024635 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'Unit configuration files for services, sockets, mount points, and swap devices share a subset of configuration options which define the execution environment of spawned processes. This man page lists the configuration options shared by these four unit types. See L for the common options of all unit configuration files, and L, L, L, and L for more information on the specific unit configuration files. The execution specific configuration options are configured in the [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type. In addition, options which control resources through Linux Control Groups (cgroups) are listed in L. Those options complement options listed here. The following service exit codes are defined by the LSB specification. The LSB specification suggests that error codes 200 and above are reserved for implementations. Some of them are used by the service manager to indicate problems during process invocation: Finally, the BSD operating systems define a set of exit codes, typically defined on Linux systems too: This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'WorkingDirectory', { 'description' => 'Takes a directory path relative to the service\'s root directory specified by C, or the special value C<~>. Sets the working directory for executed processes. If set to C<~>, the home directory of the user specified in C is used. If not set, defaults to the root directory when systemd is running as a system instance and the respective user\'s home directory if run as user. If the setting is prefixed with the C<-> character, a missing working directory is not considered fatal. If C/C is not set, then C is relative to the root of the system running the service manager. Note that setting this parameter might result in additional dependencies to be added to the unit (see above).', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootDirectory', { 'description' => 'Takes a directory path relative to the host\'s root directory (i.e. the root of the system running the service manager). Sets the root directory for executed processes, with the L system call. If this is used, it must be ensured that the process binary and all its auxiliary files are available in the chroot() jail. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). The C and C settings are particularly useful in conjunction with C. For details, see below.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootImage', { 'description' => 'Takes a path to a block device node or regular file as argument. This call is similar to C however mounts a file system hierarchy from a block device node or loopback file instead of a directory. The device node or file system image file needs to contain a file system without a partition table, or a file system within an MBR/MS-DOS or GPT partition table with only a single Linux-compatible partition, or a set of file systems within a GPT partition table that follows the Discoverable Partitions Specification. When C is set to C or C, or set to C and C is set, then this setting adds C with C mode, C and C with C mode to C. See L for the details about C or C. Also, see C below, as it may change the setting of C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MountAPIVFS', { 'description' => 'Takes a boolean argument. If on, a private mount namespace for the unit\'s processes is created and the API file systems C, C, and C are mounted inside of it, unless they are already mounted. Note that this option has no effect unless used in conjunction with C/C as these three mounts are generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace will be a 1:1 copy of the host\'s, and include these three mounts. Note that the C file system of the host is bind mounted if this option is used without C. To run the service with a private, minimal version of C, combine this option with C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'BindPaths', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit\'s view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host\'s mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either C or C for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. C creates regular writable bind mounts (unless the source file system mount is already marked read-only), while C creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit\'s list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. This option is particularly useful when C/C is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in C, or under C and other protected directories if C is specified. C with C<:ro> or C should be used instead.', 'type' => 'list' }, 'BindReadOnlyPaths', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit\'s view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host\'s mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either C or C for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. C creates regular writable bind mounts (unless the source file system mount is already marked read-only), while C creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit\'s list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. This option is particularly useful when C/C is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in C, or under C and other protected directories if C is specified. C with C<:ro> or C should be used instead.', 'type' => 'list' }, 'User', { 'description' => "Set the UNIX user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric ID as argument. For system services (services run by the system service manager, i.e. managed by PID 1) and for user services of the root user (services managed by root's instance of systemd --user), the default is C, but C may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with C<+>. Note that restrictions on the user/group name syntax are enforced: the specified name must consist only of the characters a-z, A-Z, 0-9, C<_> and C<->, except for the first character which must be one of a-z, A-Z or C<_> (i.e. numbers and C<-> are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. When used in conjunction with C the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped \x{2014} unless it is already allocated statically (see below). If C is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the L facility, which is applied at boot or package install time. If the C setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the C setting (see below).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'Group', { 'description' => "Set the UNIX user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric ID as argument. For system services (services run by the system service manager, i.e. managed by PID 1) and for user services of the root user (services managed by root's instance of systemd --user), the default is C, but C may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with C<+>. Note that restrictions on the user/group name syntax are enforced: the specified name must consist only of the characters a-z, A-Z, 0-9, C<_> and C<->, except for the first character which must be one of a-z, A-Z or C<_> (i.e. numbers and C<-> are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. When used in conjunction with C the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped \x{2014} unless it is already allocated statically (see below). If C is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the L facility, which is applied at boot or package install time. If the C setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the C setting (see below).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'DynamicUser', { 'description' => "Takes a boolean parameter. If set, a UNIX user and group pair is allocated dynamically when the unit is started, and released as soon as it is stopped. The user and group will not be added to C or C, but are managed transiently during runtime. The L glibc NSS module provides integration of these dynamic users/groups into the system's user and group databases. The user and group name to use may be configured via C and C (see above). If these options are not used and dynamic user/group allocation is enabled for a unit, the name of the dynamic user/group is implicitly derived from the unit name. If the unit name without the type suffix qualifies as valid user name it is used directly, otherwise a name incorporating a hash of it is used. If a statically allocated user or group of the configured name already exists, it is used and no dynamic user/group is allocated. Note that if C is specified and the static group with the name exists, then it is required that the static user with the name already exists. Similarly, if C is specified and the static user with the name exists, then it is required that the static group with the name already exists. Dynamic users/groups are allocated from the UID/GID range 61184\x{2026}65519. It is recommended to avoid this range for regular system or login users. At any point in time each UID/GID from this range is only assigned to zero or one dynamically allocated users/groups in use. However, UID/GIDs are recycled after a unit is terminated. Care should be taken that any processes running as part of a unit for which dynamic users/groups are enabled do not leave files or directories owned by these users/groups around, as a different unit might get the same UID/GID assigned later on, and thus gain access to these files or directories. If C is enabled, C and C are implied (and cannot be turned off). This ensures that the lifetime of IPC objects and temporary files created by the executed processes is bound to the runtime of the service, and hence the lifetime of the dynamic user/group. Since C and C are usually the only world-writable directories on a system this ensures that a unit making use of dynamic user/group allocation cannot leave files around after unit termination. Furthermore C and C are implicitly enabled (and cannot be disabled), to ensure that processes invoked cannot take benefit or create SUID/SGID files or directories. Moreover C and C are implied, thus prohibiting the service to write to arbitrary file system locations. In order to allow the service to write to certain directories, they have to be whitelisted using C, but care must be taken so that UID/GID recycling doesn't create security issues involving files created by the service. Use C (see below) in order to assign a writable runtime directory to a service, owned by the dynamic user/group and removed automatically when the unit is terminated. Use C, C and C in order to assign a set of writable directories for specific purposes to the service in a way that they are protected from vulnerabilities due to UID reuse (see below). If this option is enabled, care should be taken that the unit's processes do not get access to directories outside of these explicitly configured and managed ones. Specifically, do not use C and be careful with C file descriptor passing for directory file descriptors, as this would permit processes to create files or directories owned by the dynamic user/group that are not subject to the lifecycle and access guarantees of the service. Defaults to off.", 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'SupplementaryGroups', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Sets the supplementary Unix groups the processes are executed as. This takes a space-separated list of group names or IDs. This option may be specified more than once, in which case all listed groups are set as supplementary groups. When the empty string is assigned, the list of supplementary groups is reset, and all assignments prior to this one will have no effect. In any way, this option does not override, but extends the list of supplementary groups configured in the system group database for the user. This does not affect commands prefixed with C<+>.', 'type' => 'list' }, 'PAMName', { 'description' => 'Sets the PAM service name to set up a session as. If set, the executed process will be registered as a PAM session under the specified service name. This is only useful in conjunction with the C setting, and is otherwise ignored. If not set, no PAM session will be opened for the executed processes. See L for details. Note that for each unit making use of this option a PAM session handler process will be maintained as part of the unit and stays around as long as the unit is active, to ensure that appropriate actions can be taken when the unit and hence the PAM session terminates. This process is named C<(sd-pam)> and is an immediate child process of the unit\'s main process. Note that when this option is used for a unit it is very likely (depending on PAM configuration) that the main unit process will be migrated to its own session scope unit when it is activated. This process will hence be associated with two units: the unit it was originally started from (and for which C was configured), and the session scope unit. Any child processes of that process will however be associated with the session scope unit only. This has implications when used in combination with CC, as these child processes will not be able to affect changes in the original unit through notification messages. These messages will be considered belonging to the session scope unit and not the original unit. It is hence not recommended to use C in combination with CC.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CapabilityBoundingSet', { 'description' => 'Controls which capabilities to include in the capability bounding set for the executed process. See L for details. Takes a whitespace-separated list of capability names, e.g. C, C, C. Capabilities listed will be included in the bounding set, all others are removed. If the list of capabilities is prefixed with C<~>, all but the listed capabilities will be included, the effect of the assignment inverted. Note that this option also affects the respective capabilities in the effective, permitted and inheritable capability sets. If this option is not used, the capability bounding set is not modified on process execution, hence no limits on the capabilities of the process are enforced. This option may appear more than once, in which case the bounding sets are merged by C, or by C if the lines are prefixed with C<~> (see below). If the empty string is assigned to this option, the bounding set is reset to the empty capability set, and all prior settings have no effect. If set to C<~> (without any further argument), the bounding set is reset to the full set of available capabilities, also undoing any previous settings. This does not affect commands prefixed with C<+>. Example: if a unit has the following, CapabilityBoundingSet=CAP_A CAP_B CapabilityBoundingSet=CAP_B CAP_C then C, C, and C are set. If the second line is prefixed with C<~>, e.g., CapabilityBoundingSet=CAP_A CAP_B CapabilityBoundingSet=~CAP_B CAP_C then, only C is set.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'AmbientCapabilities', { 'description' => 'Controls which capabilities to include in the ambient capability set for the executed process. Takes a whitespace-separated list of capability names, e.g. C, C, C. This option may appear more than once in which case the ambient capability sets are merged (see the above examples in C). If the list of capabilities is prefixed with C<~>, all but the listed capabilities will be included, the effect of the assignment inverted. If the empty string is assigned to this option, the ambient capability set is reset to the empty capability set, and all prior settings have no effect. If set to C<~> (without any further argument), the ambient capability set is reset to the full set of available capabilities, also undoing any previous settings. Note that adding capabilities to ambient capability set adds them to the process\'s inherited capability set. Ambient capability sets are useful if you want to execute a process as a non-privileged user but still want to give it some capabilities. Note that in this case option C is automatically added to C to retain the capabilities over the user change. C does not affect commands prefixed with C<+>.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'NoNewPrivileges', { 'description' => 'Takes a boolean argument. If true, ensures that the service process and all its children can never gain new privileges through execve() (e.g. via setuid or setgid bits, or filesystem capabilities). This is the simplest and most effective way to ensure that a process and its children can never elevate privileges again. Defaults to false, but certain settings override this and ignore the value of this setting. This is the case when C, C, C, C, C, C, C, C, C, C, C, C or C are specified. Note that even if this setting is overridden by them, systemctl show shows the original value of this setting. Also see No New Privileges Flag.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'SecureBits', { 'description' => 'Controls the secure bits set for the executed process. Takes a space-separated combination of options from the following list: C, C, C, C, C, and C. This option may appear more than once, in which case the secure bits are ORed. If the empty string is assigned to this option, the bits are reset to 0. This does not affect commands prefixed with C<+>. See L for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SELinuxContext', { 'description' => 'Set the SELinux security context of the executed process. If set, this will override the automated domain transition. However, the policy still needs to authorize the transition. This directive is ignored if SELinux is disabled. If prefixed by C<->, all errors will be ignored. This does not affect commands prefixed with C<+>. See L for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'AppArmorProfile', { 'description' => 'Takes a profile name as argument. The process executed by the unit will switch to this profile when started. Profiles must already be loaded in the kernel, or the unit will fail. This result in a non operation if AppArmor is not enabled. If prefixed by C<->, all errors will be ignored. This does not affect commands prefixed with C<+>.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SmackProcessLabel', { 'description' => 'Takes a C security label as argument. The process executed by the unit will be started under this label and SMACK will decide whether the process is allowed to run or not, based on it. The process will continue to run under the label specified here unless the executable has its own C label, in which case the process will transition to run under that label. When not specified, the label that systemd is running under is used. This directive is ignored if SMACK is disabled. The value may be prefixed by C<->, in which case all errors will be ignored. An empty value may be specified to unset previous assignments. This does not affect commands prefixed with C<+>.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitCPU', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitFSIZE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitDATA', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitSTACK', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitCORE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRSS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNOFILE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitAS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNPROC', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitMEMLOCK', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitLOCKS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitSIGPENDING', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitMSGQUEUE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNICE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRTPRIO', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRTTIME', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair C to set both limits individually (e.g. C). Use the string C to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. LimitAS=16G). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see L for details). Note that if no time unit is specified for C the default unit of seconds is implied, while for C the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for C will be rounded up implicitly to multiples of 1s. For C the value may be specified in two syntaxes: if prefixed with C<+> or C<->, the value is understood as regular Linux nice value in the range -20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that C is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in L over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, C is a more powerful (and working) replacement for C. For system units these resource limits may be chosen freely. For user units however (i.e. units run by a per-user instance of L), these limits are bound by (possibly more restrictive) per-user limits enforced by the OS. Resource limits not configured explicitly for a unit default to the value configured in the various C, C, \x{2026} options available in L, and \x{2013} if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user services, see above).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'UMask', { 'description' => 'Controls the file mode creation mask. Takes an access mode in octal notation. See L for details. Defaults to 0022.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'KeyringMode', { 'choice' => [ 'inherit', 'private', 'shared' ], 'description' => 'Controls how the kernel session keyring is set up for the service (see L for details on the session keyring). Takes one of C, C, C. If set to C no special keyring setup is done, and the kernel\'s default behaviour is applied. If C is used a new session keyring is allocated when a service process is invoked, and it is not linked up with any user keyring. This is the recommended setting for system services, as this ensures that multiple services running under the same system user ID (in particular the root user) do not share their key material among each other. If C is used a new session keyring is allocated as for C, but the user keyring of the user configured with C is linked into it, so that keys assigned to the user may be requested by the unit\'s processes. In this modes multiple units running processes under the same user ID may share key material. Unless C is selected the unique invocation ID for the unit (see below) is added as a protected key by the name C to the newly created session keyring. Defaults to C for services of the system service manager and to C for non-service units and for services of the user service manager.', 'type' => 'leaf', 'value_type' => 'enum' }, 'OOMScoreAdjust', { 'description' => 'Sets the adjustment value for the Linux kernel\'s Out-Of-Memory (OOM) killer score for executed processes. Takes an integer between -1000 (to disable OOM killing of processes of this unit) and 1000 (to make killing of processes of this unit under memory pressure very likely). See proc.txt for details. If not specified defaults to the OOM score adjustment level of the service manager itself, which is normally at 0. Use the C setting of service units to configure how the service manager shall react to the kernel OOM killer terminating a process of the service. See L for details.', 'max' => '1000', 'min' => '-1000', 'type' => 'leaf', 'value_type' => 'integer' }, 'TimerSlackNSec', { 'description' => 'Sets the timer slack in nanoseconds for the executed processes. The timer slack controls the accuracy of wake-ups triggered by timers. See L for more information. Note that in contrast to most other time span definitions this parameter takes an integer value in nano-seconds if no unit is specified. The usual time units are understood too.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Personality', { 'choice' => [ 'x86', 'x86-64', 'ppc', 'ppc-le', 'ppc64', 'ppc64-le', 's390', 's390x' ], 'description' => 'Controls which kernel architecture L shall report, when invoked by unit processes. Takes one of the architecture identifiers C, C, C, C, C, C, C or C. Which personality architectures are supported depends on the system architecture. Usually the 64bit versions of the various system architectures support their immediate 32bit personality architecture counterpart, but no others. For example, C systems support the C and C personalities but no others. The personality feature is useful when running 32-bit services on a 64-bit host system. If not specified, the personality is left unmodified and thus reflects the personality of the host system\'s kernel.', 'type' => 'leaf', 'value_type' => 'enum' }, 'IgnoreSIGPIPE', { 'description' => 'Takes a boolean argument. If true, causes C to be ignored in the executed process. Defaults to true because C generally is useful only in shell pipelines.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Nice', { 'description' => 'Sets the default nice level (scheduling priority) for executed processes. Takes an integer between -20 (highest priority) and 19 (lowest priority). See L for details.', 'max' => '19', 'min' => '-20', 'type' => 'leaf', 'value_type' => 'integer' }, 'CPUSchedulingPolicy', { 'choice' => [ 'other', 'batch', 'idle', 'fifo', 'rr' ], 'description' => 'Sets the CPU scheduling policy for executed processes. Takes one of C, C, C, C or C. See L for details.', 'type' => 'leaf', 'value_type' => 'enum' }, 'CPUSchedulingPriority', { 'description' => 'Sets the CPU scheduling priority for executed processes. The available priority range depends on the selected CPU scheduling policy (see above). For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority) can be used. See L for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CPUSchedulingResetOnFork', { 'description' => 'Takes a boolean argument. If true, elevated CPU scheduling priorities and policies will be reset when the executed processes fork, and can hence not leak into child processes. See L for details. Defaults to false.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'CPUAffinity', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than once, in which case the specified CPU affinity masks are merged. If the empty string is assigned, the mask is reset, all assignments prior to this will have no effect. See L for details.', 'type' => 'list' }, 'NUMAPolicy', { 'description' => 'Controls the NUMA memory policy of the executed processes. Takes a policy type, one of: C, C, C, C and C. A list of NUMA nodes that should be associated with the policy must be specified in C. For more details on each policy please see, L. For overall overview of NUMA support in Linux see, L', 'type' => 'leaf', 'value_type' => 'uniline' }, 'NUMAMask', { 'description' => 'Controls the NUMA node list which will be applied alongside with selected NUMA policy. Takes a list of NUMA nodes and has the same syntax as a list of CPUs for C option. Note that the list of NUMA nodes is not required for C and C policies and for C policy we expect a single NUMA node.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOSchedulingClass', { 'choice' => [ '0', '1', '2', '3', 'none', 'realtime', 'best-effort', 'idle' ], 'description' => 'Sets the I/O scheduling class for executed processes. Takes an integer between 0 and 3 or one of the strings C, C, C or C. If the empty string is assigned to this option, all prior assignments to both C and C have no effect. See L for details.', 'type' => 'leaf', 'value_type' => 'enum' }, 'IOSchedulingPriority', { 'description' => 'Sets the I/O scheduling priority for executed processes. Takes an integer between 0 (highest priority) and 7 (lowest priority). The available priorities depend on the selected I/O scheduling class (see above). If the empty string is assigned to this option, all prior assignments to both C and C have no effect. See L for details.', 'max' => '7', 'min' => '0', 'type' => 'leaf', 'value_type' => 'integer' }, 'ProtectSystem', { 'choice' => [ 'no', 'yes', 'full', 'strict' ], 'description' => 'Takes a boolean argument or the special values C or C. If true, mounts the C and C directories read-only for processes invoked by this unit. If set to C, the C directory is mounted read-only, too. If set to C the entire file system hierarchy is mounted read-only, except for the API file system subtrees C, C and C (protect these directories using C, C, C). This setting ensures that any modification of the vendor-supplied operating system (and optionally its configuration, and local mounts) is prohibited for the service. It is recommended to enable this setting for all long-running services, unless they are involved with system updates or need to modify the operating system in other ways. If this option is used, C may be used to exclude specific directories from being made read-only. This setting is implied if C is set. This setting cannot ensure protection in all cases. In general it has the same limitations as C, see below. Defaults to off.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'ProtectHome', { 'choice' => [ 'no', 'yes', 'read-only', 'tmpfs' ], 'description' => 'Takes a boolean argument or the special values C or C. If true, the directories C, C, and C are made inaccessible and empty for processes invoked by this unit. If set to C, the three directories are made read-only instead. If set to C, temporary file systems are mounted on the three directories in read-only mode. The value C is useful to hide home directories not relevant to the processes invoked by the unit, while still allowing necessary directories to be made visible when listed in C or C. Setting this to C is mostly equivalent to set the three directories in C. Similarly, C is mostly equivalent to C, and C is mostly equivalent to C with C<:ro>. It is recommended to enable this setting for all long-running services (in particular network-facing ones), to ensure they cannot get access to private user data, unless the services actually require access to the user\'s private data. This setting is implied if C is set. This setting cannot ensure protection in all cases. In general it has the same limitations as C, see below.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'RuntimeDirectory', { 'description' => "These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, \x{2026}). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean \x{2026} command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'StateDirectory', { 'description' => "These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, \x{2026}). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean \x{2026} command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'CacheDirectory', { 'description' => "These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, \x{2026}). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean \x{2026} command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogsDirectory', { 'description' => "These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, \x{2026}). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean \x{2026} command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'ConfigurationDirectory', { 'description' => "These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include C<..>. If set, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table, when the unit is started. Also, the corresponding environment variable is defined with the full path of directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). In case of C the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if C is configured to C or C (see below). The directories specified with C, C, C, C are not removed when the unit is stopped. Except in case of C, the innermost specified directories will be owned by the user and group specified in C and C. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in C, C, C, C and C. These options imply C for the specified paths. When combined with C or C these paths always reside on the host and are mounted from there into the unit's file system namespace. If C is used in conjunction with C, C and C is slightly altered: the directories are created below C, C and C, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below C, C and C. Use C to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in C due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using L. The directories defined by these options are always created under the standard paths used by systemd (C, C, C, \x{2026}). If the service needs directories in a different location, a different mechanism has to be used to create them. L provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the C configuration is executed before the unit is started. To remove any of the directories created by these settings, use the systemctl clean \x{2026} command on the relevant units, see L for details. Example: if a system service unit has the following, RuntimeDirectory=foo/bar baz the service manager creates C (if it does not exist), C, and C. The directories C and C except C are owned by the user and group specified in C and C, and removed when the service is stopped. Example: if a system service unit has the following, RuntimeDirectory=foo/bar StateDirectory=aaa/bbb ccc then the environment variable C is set with C, and C is set with C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'RuntimeDirectoryMode', { 'description' => 'Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StateDirectoryMode', { 'description' => 'Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CacheDirectoryMode', { 'description' => 'Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogsDirectoryMode', { 'description' => 'Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ConfigurationDirectoryMode', { 'description' => 'Specifies the access mode of the directories specified in C, C, C, C, or C, respectively, as an octal number. Defaults to C<0755>. See "Permissions" in L for a discussion of the meaning of permission bits.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RuntimeDirectoryPreserve', { 'choice' => [ 'no', 'yes', 'restart' ], 'description' => 'Takes a boolean argument or C. If set to C (the default), the directories specified in C are always removed when the service stops. If set to C the directories are preserved when the service is both automatically and manually restarted. Here, the automatic restart means the operation specified in C, and manual restart means the one triggered by systemctl restart foo.service. If set to C, then the directories are not removed when the service is stopped. Note that since the runtime directory C is a mount point of C, then for system services the directories specified in C are removed when the system is rebooted.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'TimeoutCleanSec', { 'description' => "Configures a timeout on the clean-up operation requested through systemctl clean \x{2026}, see L for details. Takes the usual time values and defaults to C, i.e. by default no time-out is applied. If a time-out is configured the clean operation will be aborted forcibly when the time-out is reached, potentially leaving resources on disk.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'ReadWritePaths', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host\'s root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit\'s processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes\' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit\'s namespace, i.e. writable mounts appearing on the host will be writable in the unit\'s namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C.', 'type' => 'list' }, 'ReadOnlyPaths', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host\'s root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit\'s processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes\' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit\'s namespace, i.e. writable mounts appearing on the host will be writable in the unit\'s namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C.', 'type' => 'list' }, 'InaccessiblePaths', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Sets up a new file system namespace for executed processes. These options may be used to limit access a process might have to the file system hierarchy. Each setting takes a space-separated list of paths relative to the host\'s root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with C/C. Paths listed in C are accessible from within the namespace with the same access modes as from outside of it. Paths listed in C are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest C inside of C in order to provide writable subdirectories within read-only directories. Use C in order to whitelist specific paths for write access if C is used. Paths listed in C will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest C, C, C, or C inside it. For a more flexible option, see C. Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. Paths in C, C and C may be prefixed with C<->, in which case they will be ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root directory of the unit, as configured with C/C, instead of relative to the root directory of the host (see above). When combining C<-> and C<+> on the same path make sure to specify C<-> first, and C<+> second. Note that these settings will disconnect propagation of mounts from the unit\'s processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For C and C propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes\' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit\'s namespace, i.e. writable mounts appearing on the host will be writable in the unit\'s namespace too, even when propagated below a path marked with C! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either C or C.', 'type' => 'list' }, 'TemporaryFileSystem', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Takes a space-separated list of mount points for temporary file systems (tmpfs). If set, a new file system namespace is set up for executed processes, and a temporary file system is mounted on each mount point. This option may be specified more than once, in which case temporary file systems are mounted on all listed mount points. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. Each mount point may optionally be suffixed with a colon (C<:>) and mount options such as C or C. By default, each temporary file system is mounted with C. These can be disabled by explicitly specifying the corresponding mount options, e.g., C or C. This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary files or directories can be still accessed by combining with C or C: Example: if a unit has the following, TemporaryFileSystem=/var:ro BindReadOnlyPaths=/var/lib/systemd then the invoked processes by the unit cannot see any files or directories under C except for C or its contents.', 'type' => 'list' }, 'PrivateTmp', { 'description' => 'Takes a boolean argument. If true, sets up a new file system namespace for the executed processes and mounts private C and C directories inside it that is not shared by processes outside of the namespace. This is useful to secure access to temporary files of the process, but makes sharing between processes via C or C impossible. If this is enabled, all temporary files created by a service in these directories will be removed after the service is stopped. Defaults to false. It is possible to run two or more units within the same private C and C namespace by using the C directive, see L for details. This setting is implied if C is set. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Enabling this setting has the side effect of adding C and C dependencies on all mount units necessary to access C and C. Moreover an implicitly C ordering on L is added. Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PrivateDevices', { 'description' => 'Takes a boolean argument. If true, sets up a new C mount for the executed processes and only adds API pseudo devices such as C, C or C (as well as the pseudo TTY subsystem) to it, but no physical devices such as C, system memory C, system ports C and others. This is useful to securely turn off physical device access by the executed process. Defaults to false. Enabling this option will install a system call filter to block low-level I/O system calls that are grouped in the C<@raw-io> set, will also remove C and C from the capability bounding set for the unit (see above), and set C (see L for details). Note that using this setting will disconnect propagation of mounts from the service to the host (propagation in the opposite direction continues to work). This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. The new C will be mounted read-only and \'noexec\'. The latter may break old programs which try to set up executable memory by using L of C instead of using C. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PrivateNetwork', { 'description' => 'Takes a boolean argument. If true, sets up a new network namespace for the executed processes and configures only the loopback network device C inside it. No other network devices will be available to the executed process. This is useful to turn off network access by the executed process. Defaults to false. It is possible to run two or more units within the same private network namespace by using the C directive, see L for details. Note that this option will disconnect all socket families from the host, including C and C. Effectively, for C this means that device configuration events received from L are not delivered to the unit\'s processes. And for C this has the effect that C sockets in the abstract socket namespace of the host will become unavailable to the unit\'s processes (however, those located in the file system will continue to be accessible). Note that the implementation of this setting might be impossible (for example if network namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within a private network namespace. This may be combined with C to listen on sockets inside of network namespaces of other services.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'NetworkNamespacePath', { 'description' => 'Takes an absolute file system path refererring to a Linux network namespace pseudo-file (i.e. a file like C or a bind mount or symlink to one). When set the invoked processes are added to the network namespace referenced by that path. The path has to point to a valid namespace file at the moment the processes are forked off. If this option is used C has no effect. If this option is used together with C then it only has an effect if this unit is started before any of the listed units that have C or C configured, as otherwise the network namespace of those units is reused. When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within the specified network namespace.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PrivateUsers', { 'description' => 'Takes a boolean argument. If true, sets up a new user namespace for the executed processes and configures a minimal user and group mapping, that maps the C user and group as well as the unit\'s own user and group to themselves and everything else to the C user and group. This is useful to securely detach the user and group databases used by the unit from the rest of the system, and thus to create an effective sandbox environment. All files, directories, processes, IPC objects and other resources owned by users/groups not equaling C or the unit\'s own will stay visible from within the unit but appear owned by the C user and group. If this mode is enabled, all unit processes are run without privileges in the host user namespace (regardless if the unit\'s own user/group is C or not). Specifically this means that the process will have zero process capabilities on the host\'s user namespace, but full capabilities within the service\'s user namespace. Settings such as C will affect only the latter, and there\'s no way to acquire additional capabilities in the host\'s user namespace. Defaults to off. This setting is particularly useful in conjunction with C/C, as the need to synchronize the user and group databases in the root directory and on the host is reduced, as the only users and groups who need to be matched are C, C and the unit\'s own user and group. Note that the implementation of this setting might be impossible (for example if user namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectHostname', { 'description' => 'Takes a boolean argument. When set, sets up a new UTS namespace for the executed processes. In addition, changing hostname or domainname is prevented. Defaults to off. Note that the implementation of this setting might be impossible (for example if UTS namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. Note that when this option is enabled for a service hostname changes no longer propagate from the system into the service, it is hence not suitable for services that need to take notice of system hostname changes dynamically.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectKernelTunables', { 'description' => 'Takes a boolean argument. If true, kernel variables accessible through C, C, C, C, C, C, C and C will be made read-only to all processes of the unit. Usually, tunable kernel variables should be initialized only at boot-time, for example with the L mechanism. Few services need to write to these at runtime; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Defaults to off. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. services for which C is set), C is implied. Note that this option does not prevent indirect changes to kernel tunables effected by IPC calls to other processes. However, C may be used to make relevant IPC file system objects inaccessible. If C is set, C is implied.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectKernelModules', { 'description' => 'Takes a boolean argument. If true, explicit module loading will be denied. This allows module load and unload operations to be turned off on modular kernels. It is recommended to turn this on for most services that do not need special file systems or extra kernel modules to work. Defaults to off. Enabling this option removes C from the capability bounding set for the unit, and installs a system call filter to block module system calls, also C is made inaccessible. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Note that limited automatic module loading due to user configuration or kernel mapping tables might still happen as side effect of requested user operations, both privileged and unprivileged. To disable module auto-load feature please see LC mechanism and C documentation. If turned on and if running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectKernelLogs', { 'description' => 'Takes a boolean argument. If true, access to the kernel log ring buffer will be denied. It is recommended to turn this on for most services that do not need to read from or write to the kernel log ring buffer. Enabling this option removes C from the capability bounding set for this unit, and installs a system call filter to block the L system call (not to be confused with the libc API L for userspace logging). The kernel exposes its log buffer to userspace via C and C. If enabled, these are made inaccessible to all the processes in the unit.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectControlGroups', { 'description' => 'Takes a boolean argument. If true, the Linux Control Groups (L) hierarchies accessible through C will be made read-only to all processes of the unit. Except for container managers no services should require write access to the control groups hierarchies; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related calls, see above. Defaults to off. If C is set, C is implied.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RestrictAddressFamilies', { 'description' => 'Restricts the set of socket address families accessible to the processes of this unit. Takes a space-separated list of address family names to whitelist, such as C, C or C. When prefixed with C<~> the listed address families will be applied as blacklist, otherwise as whitelist. Note that this restricts access to the L system call only. Sockets passed into the process by other means (for example, by using socket activation with socket units, see L) are unaffected. Also, sockets created with socketpair() (which creates connected AF_UNIX sockets only) are unaffected. Note that this option has no effect on 32-bit x86, s390, s390x, mips, mips-le, ppc, ppc-le, pcc64, ppc64-le and is ignored (but works correctly on other ABIs, including x86-64). Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. By default, no restrictions apply, all address families are accessible to processes. If assigned the empty string, any previous address family restriction changes are undone. This setting does not affect commands prefixed with C<+>. Use this option to limit exposure of processes to remote access, in particular via exotic and sensitive network protocols, such as C. Note that in most cases, the local C address family should be included in the configured whitelist as it is frequently used for local communication, including for L logging.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestrictNamespaces', { 'description' => "Restricts access to Linux namespace functionality for the processes of this unit. For details about Linux namespaces, see L. Either takes a boolean argument, or a space-separated list of namespace type identifiers. If false (the default), no restrictions on namespace creation and switching are made. If true, access to any kind of namespacing is prohibited. Otherwise, a space-separated list of namespace type identifiers must be specified, consisting of any combination of: C, C, C, C, C, C and C. Any namespace type listed is made accessible to the unit's processes, access to namespace types not listed is prohibited (whitelisting). By prepending the list with a single tilde character (C<~>) the effect may be inverted: only the listed namespace types will be made inaccessible, all unlisted ones are permitted (blacklisting). If the empty string is assigned, the default namespace restrictions are applied, which is equivalent to false. This option may appear more than once, in which case the namespace types are merged by C, or by C if the lines are prefixed with C<~> (see examples below). Internally, this setting limits access to the L, L and L system calls, taking the specified flags parameters into account. Note that \x{2014} if this option is used \x{2014} in addition to restricting creation and switching of the specified types of namespaces (or all of them, if true) access to the setns() system call with a zero flags parameter is prohibited. This setting is only supported on x86, x86-64, mips, mips-le, mips64, mips64-le, mips64-n32, mips64-le-n32, ppc64, ppc64-le, s390 and s390x, and enforces no restrictions on other architectures. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Example: if a unit has the following, RestrictNamespaces=cgroup ipc RestrictNamespaces=cgroup net then C, C, and C are set. If the second line is prefixed with C<~>, e.g., RestrictNamespaces=cgroup ipc RestrictNamespaces=~cgroup net then, only C is set.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LockPersonality', { 'description' => 'Takes a boolean argument. If set, locks down the L system call so that the kernel execution domain may not be changed from the default or the personality selected with C directive. This may be useful to improve security, because odd personality emulations may be poorly tested and source of vulnerabilities. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'MemoryDenyWriteExecute', { 'description' => 'Takes a boolean argument. If set, attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable are prohibited. Specifically, a system call filter is added that rejects L system calls with both C and C set, L or L system calls with C set and L system calls with C set. Note that this option is incompatible with programs and libraries that generate program code dynamically at runtime, including JIT execution engines, executable stacks, and code "trampoline" feature of various C compilers. This option improves service security, as it makes harder for software exploits to change running code dynamically. However, the protection can be circumvented, if the service can write to a filesystem, which is not mounted with C (such as C), or it can use memfd_create(). This can be prevented by making such file systems inaccessible to the service (e.g. C) and installing further system call filters (C). Note that this feature is fully available on x86-64, and partially on x86. Specifically, the shmat() protection is not available on x86. Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RestrictRealtime', { 'description' => 'Takes a boolean argument. If set, any attempts to enable realtime scheduling in a process of the unit are refused. This restricts access to realtime task scheduling policies such as C, C or C. See L for details about these scheduling policies. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. Realtime scheduling policies may be used to monopolize CPU time for longer periods of time, and may hence be used to lock up or otherwise trigger Denial-of-Service situations on the system. It is hence recommended to restrict access to realtime scheduling to the few programs that actually require them. Defaults to off.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RestrictSUIDSGID', { 'description' => 'Takes a boolean argument. If set, any attempts to set the set-user-ID (SUID) or set-group-ID (SGID) bits on files or directories will be denied (for details on these bits see L). If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. As the SUID/SGID bits are mechanisms to elevate privileges, and allows users to acquire the identity of other users, it is recommended to restrict creation of SUID/SGID files to the few programs that actually require them. Note that this restricts marking of any type of file system object with these bits, including both regular files and directories (where the SGID is a different meaning than for files, see documentation). This option is implied if C is enabled. Defaults to off.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RemoveIPC', { 'description' => 'Takes a boolean parameter. If set, all System V and POSIX IPC objects owned by the user and group the processes of this unit are run as are removed when the unit is stopped. This setting only has an effect if at least one of C, C and C are used. It has no effect on IPC objects owned by the root user. Specifically, this removes System V semaphores, as well as System V and POSIX shared memory segments and message queues. If multiple units use the same user or group the IPC objects are removed when the last of these units is stopped. This setting is implied if C is set.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PrivateMounts', { 'description' => "Takes a boolean parameter. If set, the processes of this unit will be run in their own private file system (mount) namespace with all mount propagation from the processes towards the host's main file system namespace turned off. This means any file system mount points established or removed by the unit's processes will be private to them and not be visible to the host. However, file system mount points established or removed on the host will be propagated to the unit's processes. See L for details on file system namespaces. Defaults to off. When turned on, this executes three operations for each invoked process: a new C namespace is created, after which all existing mounts are remounted to C to disable propagation from the unit's processes to the host (but leaving propagation in the opposite direction in effect). Finally, the mounts are remounted again to the propagation mode configured with C, see below. File system namespaces are set up individually for each process forked off by the service manager. Mounts established in the namespace of the process created by C will hence be cleaned up automatically as soon as that process exits and will not be available to subsequent processes forked off for C (and similar applies to the various other commands configured for units). Similarly, C does not permit sharing kernel mount namespaces between units, it only enables sharing of the C and C directories. Other file system namespace unit settings \x{2014} C, C, C, C, C, C, C, C, \x{2026} \x{2014} also enable file system namespacing in a fashion equivalent to this option. Hence it is primarily useful to explicitly request this behaviour if none of the other settings are used.", 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'MountFlags', { 'description' => "Takes a mount propagation setting: C, C or C, which controls whether file system mount points in the file system namespaces set up for this unit's processes will receive or propagate mounts and unmounts from other file system namespaces. See L for details on mount propagation, and the three propagation flags in particular. This setting only controls the final propagation setting in effect on all mount points of the file system namespace created for each process of this unit. Other file system namespacing unit settings (see the discussion in C above) will implicitly disable mount and unmount propagation from the unit's processes towards the host by changing the propagation setting of all mount points in the unit's file system namepace to C first. Setting this option to C does not reestablish propagation in that case. If not set \x{2013} but file system namespaces are enabled through another file system namespace unit setting \x{2013} C mount propagation is used, but \x{2014} as mentioned \x{2014} as C is applied first, propagation from the unit's processes to the host is still turned off. It is not recommended to to use C mount propagation for units, as this means temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked off processes, as unmount propagation events won't be received by the file system namespace of the unit. Usually, it is best to leave this setting unmodified, and use higher level file system namespacing options instead, in particular C, see above.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'SystemCallFilter', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Takes a space-separated list of system call names. If this setting is used, all system calls executed by the unit processes except for the listed ones will result in immediate process termination with the C signal (whitelisting). (See C below for changing the default action). If the first character of the list is C<~>, the effect is inverted: only the listed system calls will result in immediate process termination (blacklisting). Blacklisted system calls and system call groups may optionally be suffixed with a colon (C<:>) and C error number (between 0 and 4095) or errno name such as C, C or C (see L for a full list). This value will be returned when a blacklisted system call is triggered, instead of terminating the processes immediately. This value takes precedence over the one given in C, see below. If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel ('seccomp filtering') and is useful for enforcing a minimal sandboxing environment. Note that the execve, exit, exit_group, getrlimit, rt_sigreturn, sigreturn system calls and the system calls for querying time and sleeping are implicitly whitelisted and do not need to be listed explicitly. This option may be specified more than once, in which case the filter masks are merged. If the empty string is assigned, the filter is reset, all prior assignments will have no effect. This does not affect commands prefixed with C<+>. Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with C or similar. Note that strict system call filters may impact execution and error handling code paths of the service invocation. Specifically, access to the execve system call is required for the execution of the service binary \x{2014} if it is blocked service invocation will necessarily fail. Also, if execution of the service binary fails for some reason (for example: missing service executable), the error handling logic might require access to an additional set of system calls in order to process and log this failure correctly. It might be necessary to temporarily disable system call filters in order to simplify debugging of such failures. If you specify both types of this option (i.e. whitelisting and blacklisting), the first encountered will take precedence and will dictate the default action (termination or approval of a system call). Then the next occurrences of this option will add or delete the listed system calls from the set of the filtered system calls, depending of its type and the default action. (For example, if you have started with a whitelisting of read and write, and right after it add a blacklisting of write, then write will be removed from the set.) As the number of possible system calls is large, predefined sets of system calls are provided. A set starts with C<\@> character, followed by name of the set. Currently predefined system call setsSetDescription\@aioAsynchronous I/O (L, L, and related calls)\@basic-ioSystem calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing (L, L, and related calls)\@chownChanging file ownership (L, L, and related calls)\@clockSystem calls for changing the system clock (L, L, and related calls)\@cpu-emulationSystem calls for CPU emulation functionality (L and related calls)\@debugDebugging, performance monitoring and tracing functionality (L, L and related calls)\@file-systemFile system operations: opening, creating files and directories for read and write, renaming and removing them, reading file properties, or creating hard and symbolic links.\@io-eventEvent loop system calls (L, L, L, L and related calls)\@ipcPipes, SysV IPC, POSIX Message Queues and other IPC (L, L)\@keyringKernel keyring access (L and related calls)\@memlockLocking of memory into RAM (L, L and related calls)\@moduleLoading and unloading of kernel modules (L, L and related calls)\@mountMounting and unmounting of file systems (L, L, and related calls)\@network-ioSocket I/O (including local AF_UNIX): L, L\@obsoleteUnusual, obsolete or unimplemented (L, L, \x{2026})\@privilegedAll system calls which need super-user capabilities (L)\@processProcess control, execution, namespaceing operations (L, L, L, \x{2026}\@raw-ioRaw I/O port access (L, L, pciconfig_read(), \x{2026})\@rebootSystem calls for rebooting and reboot preparation (L, kexec(), \x{2026})\@resourcesSystem calls for changing resource limits, memory and scheduling parameters (L, L, \x{2026})\@setuidSystem calls for changing user ID and group ID credentials, (L, L, L, \x{2026})\@signalSystem calls for manipulating and handling process signals (L, L, \x{2026})\@swapSystem calls for enabling/disabling swap devices (L, L)\@syncSynchronizing files and memory to disk: (L, L, and related calls)\@system-serviceA reasonable set of system calls used by common system services, excluding any special purpose calls. This is the recommended starting point for whitelisting system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: C<\@clock>, C<\@mount>, C<\@swap>, C<\@reboot>.\@timerSystem calls for scheduling operations by time (L, L, \x{2026}) Note, that as new system calls are added to the kernel, additional system calls might be added to the groups above. Contents of the sets may also change between systemd versions. In addition, the list of system calls depends on the kernel version and architecture for which systemd was compiled. Use systemd-analyze\x{a0}syscall-filter to list the actual list of system calls in each filter. Generally, whitelisting system calls (rather than blacklisting) is the safer mode of operation. It is recommended to enforce system call whitelists for all long-running system services. Specifically, the following lines are a relatively safe basic choice for the majority of system services: Note that various kernel system calls are defined redundantly: there are multiple system calls for executing the same operation. For example, the pidfd_send_signal() system call may be used to execute operations similar to what can be done with the older kill() system call, hence blocking the latter without the former only provides weak protection. Since new system calls are added regularly to the kernel as development progresses, keeping system call blacklists comprehensive requires constant work. It is thus recommended to use whitelisting instead, which offers the benefit that new system calls are by default implicitly blocked until the whitelist is updated. Also note that a number of system calls are required to be accessible for the dynamic linker to work. The dynamic linker is required for running most regular programs (specifically: all dynamic ELF binaries, which is how most distributions build packaged programs). This means that blocking these system calls (which include open(), openat() or mmap()) will make most programs typically shipped with generic distributions unusable. It is recommended to combine the file system namespacing related options with C, in order to prohibit the unit's processes to undo the mappings. Specifically these are the options C, C, C, C, C, C, C, C, C and C.", 'type' => 'list' }, 'SystemCallErrorNumber', { 'description' => 'Takes an C error number (between 1 and 4095) or errno name such as C, C or C, to return when the system call filter configured with C is triggered, instead of terminating the process immediately. See L for a full list of error codes. When this setting is not used, or when the empty string is assigned, the process will be terminated immediately when the filter is triggered.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SystemCallArchitectures', { 'description' => "Takes a space-separated list of architecture identifiers to include in the system call filter. The known architecture identifiers are the same as for C described in L, as well as C, C, C, and the special identifier C. The special identifier C implicitly maps to the native architecture of the system (or more precisely: to the architecture the system manager is compiled for). If running in user mode, or in system mode, but without the C capability (e.g. setting C), C is implied. By default, this option is set to the empty list, i.e. no system call architecture filtering is applied. If this setting is used, processes of this unit will only be permitted to call native system calls, and system calls of the specified architectures. For the purposes of this option, the x32 architecture is treated as including x86-64 system calls. However, this setting still fulfills its purpose, as explained below, on x32. System call filtering is not equally effective on all architectures. For example, on x86 filtering of network socket-related calls is not possible, due to ABI limitations \x{2014} a limitation that x86-64 does not have, however. On systems supporting multiple ABIs at the same time \x{2014} such as x86/x86-64 \x{2014} it is hence recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to circumvent the restrictions applied to the native ABI of the system. In particular, setting C is a good choice for disabling non-native ABIs. System call architectures may also be restricted system-wide via the C option in the global configuration. See L for details.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'Environment', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Sets environment variables for executed processes. Takes a space-separated list of variable assignments. This option may be specified more than once, in which case all listed variables will be set. If the same variable is set twice, the later setting will override the earlier setting. If the empty string is assigned to this option, the list of environment variables is reset, all prior assignments have no effect. Variable expansion is not performed inside the strings, however, specifier expansion is possible. The \$ character has no special meaning. If you need to assign a value containing spaces or the equals sign to a variable, use double quotes (\") for the assignment. Example: Environment=\"VAR1=word1 word2\" VAR2=word3 \"VAR3=\$word 5 6\" gives three variables C, C, C with the values C, C, C<\$word 5 6>. See L for details about environment variables. Note that environment variables are not suitable for passing secrets (such as passwords, key material, \x{2026}) to service processes. Environment variables set for a unit are exposed to unprivileged clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data.", 'type' => 'list' }, 'EnvironmentFile', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Similar to C but reads the environment variables from a text file. The text file should contain new-line-separated variable assignments. Empty lines, lines without an C<=> separator, or lines starting with ; or # will be ignored, which may be used for commenting. A line ending with a backslash will be concatenated with the following one, allowing multiline variable definitions. The parser strips leading and trailing whitespace from the values of assignments, unless you use double quotes ("). C escapes are supported, but not most control characters. C<\\t> and C<\\n> can be used to insert tabs and newlines within C. The argument passed should be an absolute filename or wildcard expression, optionally prefixed with C<->, which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect. The files listed with this directive will be read shortly before the process is executed (more specifically, after all processes from a previous unit state terminated. This means you can generate these files in one unit state, and read it with this option in the next). Settings from these files override settings made with C. If the same variable is set twice from these files, the files will be read in the order they are specified and the later setting will override the earlier setting.', 'type' => 'list' }, 'PassEnvironment', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Pass environment variables set for the system service manager to executed processes. Takes a space-separated list of variable names. This option may be specified more than once, in which case all listed variables will be passed. If the empty string is assigned to this option, the list of environment variables to pass is reset, all prior assignments have no effect. Variables specified that are not set for the system manager will not be passed and will be silently ignored. Note that this option is only relevant for the system service manager, as system services by default do not automatically inherit any environment variables set for the service manager itself. However, in case of the user service manager all environment variables are passed to the executed processes anyway, hence this option is without effect for the user service manager. Variables set for invoked processes due to this setting are subject to being overridden by those configured with C or C. C escapes are supported, but not most control characters. C<\\t> and C<\\n> can be used to insert tabs and newlines within C. Example: PassEnvironment=VAR1 VAR2 VAR3 passes three variables C, C, C with the values set for those variables in PID1. See L for details about environment variables.', 'type' => 'list' }, 'UnsetEnvironment', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Explicitly unset environment variable assignments that would normally be passed from the service manager to invoked processes of this unit. Takes a space-separated list of variable names or variable assignments. This option may be specified more than once, in which case all listed variables/assignments will be unset. If the empty string is assigned to this option, the list of environment variables/assignments to unset is reset. If a variable assignment is specified (that is: a variable name, followed by C<=>, followed by its value), then any environment variable matching this precise assignment is removed. If a variable name is specified (that is a variable name without any following C<=> or value), then any assignment matching the variable name, regardless of its value is removed. Note that the effect of C is applied as final step when the environment list passed to executed processes is compiled. That means it may undo assignments from any configuration source, including assignments made through C or C, inherited from the system manager\'s global set of environment variables, inherited via C, set by the service manager itself (such as C<$NOTIFY_SOCKET> and such), or set by a PAM module (in case C is used). See L for details about environment variables.', 'type' => 'list' }, 'StandardInput', { 'choice' => [ 'null', 'tty', 'tty-force', 'tty-fail', 'data', 'socket' ], 'description' => "Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one of C, C, C, C, C, C, C or C. If C is selected, standard input will be connected to C, i.e. all read attempts by the process will result in immediate EOF. If C is selected, standard input is connected to a TTY (as configured by C, see below) and the executed process becomes the controlling process of the terminal. If the terminal is already being controlled by another process, the executed process waits until the current controlling process releases the terminal. C is similar to C, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal. C is similar to C, but if the terminal already has a controlling process start-up of the executed process fails. The C option may be used to configure arbitrary textual or binary data to pass via standard input to the executed process. The data to pass is configured via C/C (see below). Note that the actual file descriptor type passed (memory file, regular file, UNIX pipe, \x{2026}) might depend on the kernel and available privileges. In any case, the file descriptor is read-only, and when read returns the specified data followed by EOF. The C option may be used to connect a specific file system object to standard input. An absolute path following the C<:> character is expected, which may refer to a regular file, a FIFO or special file. If an C socket in the file system is specified, a stream socket is connected to it. The latter is useful for connecting standard input of processes to arbitrary system services. The C option is valid in socket-activated services only, and requires the relevant socket unit file (see L for details) to have C set, or to specify a single socket only. If this option is set, standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional L socket activation daemon. The C option connects standard input to a specific, named file descriptor provided by a socket unit. The name may be specified as part of this option, following a C<:> character (e.g. C). If no name is specified, the name C is implied (i.e. C is equivalent to C). At least one socket unit defining the specified name must be provided via the C option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See C in L for more details about named file descriptors and their ordering. This setting defaults to C. Note that services which specify C and use C or C with C/C/C, should specify C, to make sure that the tty initialization is finished before they start.", 'type' => 'leaf', 'value_type' => 'enum' }, 'StandardOutput', { 'choice' => [ 'inherit', 'null', 'tty', 'journal', 'kmsg', 'journal+console', 'kmsg+console', 'socket' ], 'description' => 'Controls where file descriptor 1 (stdout) of the executed processes is connected to. Takes one of C, C, C, C, C, C, C, C, C, C or C. C duplicates the file descriptor of standard input for standard output. C connects standard output to C, i.e. everything written to it will be lost. C connects standard output to a tty (as configured via C, see below). If the TTY is used for output only, the executed process will not become the controlling process of the terminal, and will not fail or wait for other processes to release the terminal. C connects standard output with the journal, which is accessible via L. Note that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the specific option listed below is hence a superset of this one. (Also note that any external, additional syslog daemons receive their log data from the journal, too, hence this is the option to use when logging shall be processed with such a daemon.) C connects standard output with the kernel log buffer which is accessible via L, in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which case this option is no different from C. C and C work in a similar way as the two options above but copy the output to the system console as well. The C option may be used to connect a specific file system object to standard output. The semantics are similar to the same option of C, see above. If path refers to a regular file on the filesystem, it is opened (created if it doesn\'t exist yet) for writing at the beginning of the file, but without truncating it. If standard input and output are directed to the same file path, it is opened only once, for reading as well as writing and duplicated. This is particularly useful when the specified path refers to an C socket in the file system, as in that case only a single stream connection is created for both input and output. C is similar to C above, but it opens the file in append mode. C connects standard output to a socket acquired via socket activation. The semantics are similar to the same option of C, see above. The C option connects standard output to a specific, named file descriptor provided by a socket unit. A name may be specified as part of this option, following a C<:> character (e.g. C). If no name is specified, the name C is implied (i.e. C is equivalent to C). At least one socket unit defining the specified name must be provided via the C option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See C in L for more details about named descriptors and their ordering. If the standard output (or error output, see below) of a unit is connected to the journal or the kernel log buffer, the unit will implicitly gain a dependency of type C on C (also see the "Implicit Dependencies" section above). Also note that in this case stdout (or stderr, see below) will be an C stream socket, and not a pipe or FIFO that can be re-opened. This means when executing shell scripts the construct echo "hello" > /dev/stderr for writing text to stderr will not work. To mitigate this use the construct echo "hello" >&2 instead, which is mostly equivalent and avoids this pitfall. This setting defaults to the value set with C in L, which defaults to C. Note that setting this parameter might result in additional dependencies to be added to the unit (see above).', 'type' => 'leaf', 'value_type' => 'enum' }, 'StandardError', { 'description' => 'Controls where file descriptor 2 (stderr) of the executed processes is connected to. The available options are identical to those of C, with some exceptions: if set to C the file descriptor used for standard output is duplicated for standard error, while C will use a default file descriptor name of C. This setting defaults to the value set with C in L, which defaults to C. Note that setting this parameter might result in additional dependencies to be added to the unit (see above).', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StandardInputText', { 'description' => 'Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to the executed processes. These settings have no effect unless C is set to C. Use this option to embed process input data directly in the unit file. C accepts arbitrary textual data. C-style escapes for special characters as well as the usual C<%>-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional C<\\n> to the end or beginning of a line). C accepts arbitrary binary data, encoded in Base64. No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. Note that C and C operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a C<\\> character (see L for details). This is particularly useful for large data configured with these two options. Example:', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StandardInputData', { 'description' => 'Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to the executed processes. These settings have no effect unless C is set to C. Use this option to embed process input data directly in the unit file. C accepts arbitrary textual data. C-style escapes for special characters as well as the usual C<%>-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional C<\\n> to the end or beginning of a line). C accepts arbitrary binary data, encoded in Base64. No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. Note that C and C operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a C<\\> character (see L for details). This is particularly useful for large data configured with these two options. Example:', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogLevelMax', { 'description' => 'Configures filtering by log level of log messages generated by this unit. Takes a syslog log level, one of C (lowest log level, only highest priority messages), C, C, C, C, C, C, C (highest log level, also lowest priority messages). See L for details. By default no filtering is applied (i.e. the default maximum log level is C). Use this option to configure the logging system to drop log messages of a specific service above the specified level. For example, set CC in order to turn off debug logging of a particularly chatty unit. Note that the configured level is applied to any log messages written by any of the processes belonging to this unit, sent via any supported logging protocol. The filtering is applied early in the logging pipeline, before any kind of further processing is done. Moreover, messages which pass through this filter successfully might still be dropped by filters applied at a later stage in the logging subsystem. For example, C configured in L might prohibit messages of higher log levels to be stored on disk, even though the per-unit C permitted it to be processed.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogExtraFields', { 'description' => 'Configures additional log metadata fields to include in all log records generated by processes associated with this unit. This setting takes one or more journal field assignments in the format C separated by whitespace. See L for details on the journal field concept. Even though the underlying journal implementation permits binary field values, this setting accepts only valid UTF-8 values. To include space characters in a journal field value, enclose the assignment in double quotes ("). The usual specifiers are expanded in all assignments (see below). Note that this setting is not only useful for attaching additional metadata to log records of a unit, but given that all fields and values are indexed may also be used to implement cross-unit log record matching. Assign an empty string to reset the list.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogRateLimitIntervalSec', { 'description' => 'Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by C, more messages than specified in C are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for C may be specified in the following units: "s", "min", "h", "ms", "us" (see L for details). The default settings are set by C and C configured in L. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogRateLimitBurst', { 'description' => 'Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by C, more messages than specified in C are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for C may be specified in the following units: "s", "min", "h", "ms", "us" (see L for details). The default settings are set by C and C configured in L. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SyslogIdentifier', { 'description' => 'Sets the process name ("syslog tag") to prefix log lines sent to the logging system or the kernel log buffer with. If not set, defaults to the process name of the executed process. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>) and only applies to log messages written to stdout or stderr.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SyslogFacility', { 'description' => 'Sets the syslog facility identifier to use when logging. One of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C or C. See L for details. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>), and only applies to log messages written to stdout or stderr. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SyslogLevel', { 'description' => 'The default syslog log level to use when logging to the logging system or the kernel log buffer. One of C, C, C, C, C, C, C, C. See L for details. This option is only useful when C or C are set to C or C (or to the same settings in combination with C<+console>), and only applies to log messages written to stdout or stderr. Note that individual lines output by executed processes may be prefixed with a different log level which can be used to override the default log level specified here. The interpretation of these prefixes may be disabled with C, see below. For details, see L. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SyslogLevelPrefix', { 'description' => 'Takes a boolean argument. If true and C or C are set to C or C (or to the same settings in combination with C<+console>), log lines written by the executed process that are prefixed with a log level will be processed with this log level set but the prefix removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as-is. This only applies to log messages written to stdout or stderr. For details about this prefixing see L. Defaults to true.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'TTYPath', { 'description' => 'Sets the terminal device node to use if standard input, output, or error are connected to a TTY (see above). Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TTYReset', { 'description' => 'Reset the terminal device specified with C before and after execution. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TTYVHangup', { 'description' => 'Disconnect all clients which have opened the terminal device specified with C before and after execution. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TTYVTDisallocate', { 'description' => 'If the terminal device specified with C is a virtual console terminal, try to deallocate the TTY before and after execution. This ensures that the screen and scrollback buffer is cleared. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'UtmpIdentifier', { 'description' => 'Takes a four character identifier string for an L and wtmp entry for this service. This should only be set for services such as getty implementations (such as L) where utmp/wtmp entries must be created and cleared before and after execution, or for services that shall be executed as if they were run by a getty process (see below). If the configured string is longer than four characters, it is truncated and the terminal four characters are used. This setting interprets %I style string replacements. This setting is unset by default, i.e. no utmp/wtmp entries are created or cleaned up for this service.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'UtmpMode', { 'choice' => [ 'init', 'login', 'user' ], 'description' => 'Takes one of C, C or C. If C is set, controls which type of L/wtmp entries for this service are generated. This setting has no effect unless C is set too. If C is set, only an C entry is generated and the invoked process must implement a getty-compatible utmp/wtmp logic. If C is set, first an C entry, followed by a C entry is generated. In this case, the invoked process must implement a L-compatible utmp/wtmp logic. If C is set, first an C entry, then a C entry and finally a C entry is generated. In this case, the invoked process may be any process that is suitable to be run as session leader. Defaults to C.', 'type' => 'leaf', 'value_type' => 'enum' } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::Exec' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Common/ResourceControl.pl0000644000175000017500000014456513575500330027100 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'class_description' => 'Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset of configuration options for resource control of spawned processes. Internally, this relies on the Linux Control Groups (cgroups) kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of resource management. This man page lists the configuration options shared by those six unit types. See L for the common options of all unit configuration files, and L, L, L, L, L, and L for more information on the specific unit configuration files. The resource control configuration options are configured in the [Slice], [Scope], [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type. In addition, options which control resources available to programs executed by systemd are listed in L. Those options complement options listed here. See the New Control Group Interfaces for an introduction on how to make use of resource control APIs from programs. This configuration class was generated from systemd documentation. by L ', 'copyright' => [ '2010-2016 Lennart Poettering and others', '2016 Dominique Dumont' ], 'element' => [ 'CPUAccounting', { 'description' => 'Turn on CPU usage accounting for this unit. Takes a boolean argument. Note that turning on CPU accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'CPUWeight', { 'description' => 'Assign the specified CPU time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the C control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see cgroup-v2.txt and sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. These settings replace C and C.', 'max' => '10000', 'min' => '1', 'type' => 'leaf', 'upstream_default' => '100', 'value_type' => 'integer' }, 'StartupCPUWeight', { 'description' => 'Assign the specified CPU time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the C control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see cgroup-v2.txt and sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. These settings replace C and C.', 'max' => '10000', 'min' => '1', 'type' => 'leaf', 'upstream_default' => '100', 'value_type' => 'integer' }, 'CPUQuota', { 'description' => 'Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the C attribute on the unified control group hierarchy and C on legacy. For details about these control group attributes, see cgroup-v2.txt and sched-bwc.txt. Example: C ensures that the executed processes will never get more than 20% CPU time on one CPU.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CPUQuotaPeriodSec', { 'description' => 'Assign the duration over which the CPU time quota specified by C is measured. Takes a time duration value in seconds, with an optional suffix such as "ms" for milliseconds (or "s" for seconds.) The default setting is 100ms. The period is clamped to the range supported by the kernel, which is [1ms, 1000ms]. Additionally, the period is adjusted up so that the quota interval is also at least 1ms. Setting C to an empty value resets it to the default. This controls the second field of C attribute on the unified control group hierarchy and C on legacy. For details about these control group attributes, see cgroup-v2.txt and sched-design-CFS.txt. Example: C to request that the CPU quota is measured in periods of 10ms.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'AllowedCPUs', { 'description' => 'Restrict processes to be executed on specific CPUs. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. Setting C doesn\'t guarantee that all of the CPUs will be used by the processes as it may be limited by parent units. The effective configuration is reported as C. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'AllowedMemoryNodes', { 'description' => 'Restrict processes to be executed on specific memory NUMA nodes. Takes a list of memory NUMA nodes indices or ranges separated by either whitespace or commas. Memory NUMA nodes ranges are specified by the lower and upper CPU indices separated by a dash. Setting C doesn\'t guarantee that all of the memory NUMA nodes will be used by the processes as it may be limited by parent units. The effective configuration is reported as C. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryAccounting', { 'description' => 'Turn on process and kernel memory accounting for this unit. Takes a boolean argument. Note that turning on memory accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'MemoryMin', { 'description' => 'Specify the memory usage protection of the executed processes in this unit. If the memory usages of this unit and all its ancestors are below their minimum boundaries, this unit\'s memory won\'t be reclaimed. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, all available memory is protected, which may be useful in order to always inherit all of the protection afforded by ancestors. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. Units may have their children use a default C value by specifying C, which has the same semantics as C. This setting does not affect C in the unit itself.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryLow', { 'description' => 'Specify the best-effort memory usage protection of the executed processes in this unit. If the memory usages of this unit and all its ancestors are below their low boundaries, this unit\'s memory won\'t be reclaimed as long as memory can be reclaimed from unprotected units. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, all available memory is protected, which may be useful in order to always inherit all of the protection afforded by ancestors. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C. Units may have their children use a default C value by specifying C, which has the same semantics as C. This setting does not affect C in the unit itself.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryHigh', { 'description' => 'Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away aggressively in such cases. This is the main mechanism to control memory usage of a unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory throttling is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryMax', { 'description' => 'Specify the absolute limit on memory usage of the executed processes in this unit. If memory usage cannot be contained under the limit, out-of-memory killer is invoked inside the unit. It is recommended to use C as the main control mechanism and use C as the last line of defense. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory limit is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting replaces C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemorySwapMax', { 'description' => 'Specify the absolute limit on swap usage of the executed processes in this unit. Takes a swap size in bytes. If the value is suffixed with K, M, G or T, the specified swap size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value C, no swap limit is applied. This controls the C control group attribute. For details about this control group attribute, see cgroup-v2.txt. This setting is supported only if the unified control group hierarchy is used and disables C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TasksAccounting', { 'description' => 'Turn on task accounting for this unit. Takes a boolean argument. If enabled, the system manager will keep track of the number of tasks in the unit. The number of tasks accounted this way includes both kernel threads and userspace processes, with each thread counting individually. Note that turning on tasks accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with C in L.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'TasksMax', { 'description' => 'Specify the maximum number of tasks that may be created in the unit. This ensures that the number of tasks accounted for the unit (see above) stays below a specific limit. This either takes an absolute number of tasks or a percentage value that is taken relative to the configured maximum number of tasks on the system. If assigned the special value C, no tasks limit is applied. This controls the C control group attribute. For details about this control group attribute, see pids.txt. The system default for this setting may be controlled with C in L.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOAccounting', { 'description' => 'Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. This setting replaces C and disables settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'IOWeight', { 'description' => 'Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 100. For details about this control group attribute, see cgroup-v2.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. These settings replace C and C and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupIOWeight', { 'description' => 'Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 100. For details about this control group attribute, see cgroup-v2.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. These settings replace C and C and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IODeviceWeight', { 'description' => 'Set the per-device overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 1 and 10000. (Example: C). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see cgroup-v2.txt. This setting replaces C and disables settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOReadBandwidthMax', { 'description' => 'Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings replace C and C and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOWriteBandwidthMax', { 'description' => 'Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings replace C and C and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOReadIOPSMax', { 'description' => 'Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the C control group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOWriteIOPSMax', { 'description' => 'Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the C control group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt. These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with C or C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IODeviceLatencyTargetSec', { 'description' => 'Set the per-device average target I/O latency for the executed processes, if the unified control group hierarchy is used on the system. Takes a file path and a timespan separated by a space to specify the device specific latency target. (Example: "/dev/sda 25ms"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute. Use this option multiple times to set latency target for multiple devices. For details about this control group attribute, see cgroup-v2.txt. Implies C. These settings are supported only if the unified control group hierarchy is used.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IPAccounting', { 'description' => "Takes a boolean argument. If true, turns on IPv4 and IPv6 network traffic accounting for packets sent or received by the unit. When this option is turned on, all IPv4 and IPv6 sockets created by any process of the unit are accounted for. When this option is used in socket units, it applies to all IPv4 and IPv6 sockets associated with it (including both listening and connection sockets where this applies). Note that for socket-activated services, this configuration setting and the accounting data of the service unit and the socket unit are kept separate, and displayed separately. No propagation of the setting and the collected statistics is done, in either direction. Moreover, any traffic sent or received on any of the socket unit's sockets is accounted to the socket unit \x{2014} and never to the service unit it might have activated, even if the socket is used by it. The system default for this setting may be controlled with C in L.", 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'IPAddressAllow', { 'description' => "Turn on address range network traffic filtering for IP packets sent and received over C and C sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits (separated by a C character). If the latter is omitted, the address is considered a host address, i.e. the prefix covers the whole address (32 for IPv4, 128 for IPv6). The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default all access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source IP address is checked against these access lists, in case of egress traffic the destination IP address is checked. When configured the lists are enforced as follows: In order to implement a whitelisting IP firewall, it is recommended to use a CC setting on an upper-level slice unit (such as the root slice C<-.slice> or the slice containing all system services C \x{2013} see L for details on these slice units), plus individual per-service C lines permitting network access to relevant services, and only them. Note that for socket-activated services, the IP access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP access lists on both the socket and the service unit, however it often makes sense to maintain one list more open and the other one more restricted, depending on the usecase. If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for IP security.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'IPAddressDeny', { 'description' => "Turn on address range network traffic filtering for IP packets sent and received over C and C sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits (separated by a C character). If the latter is omitted, the address is considered a host address, i.e. the prefix covers the whole address (32 for IPv4, 128 for IPv6). The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default all access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source IP address is checked against these access lists, in case of egress traffic the destination IP address is checked. When configured the lists are enforced as follows: In order to implement a whitelisting IP firewall, it is recommended to use a CC setting on an upper-level slice unit (such as the root slice C<-.slice> or the slice containing all system services C \x{2013} see L for details on these slice units), plus individual per-service C lines permitting network access to relevant services, and only them. Note that for socket-activated services, the IP access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP access lists on both the socket and the service unit, however it often makes sense to maintain one list more open and the other one more restricted, depending on the usecase. If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for IP security.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'IPIngressFilterPath', { 'description' => 'Add custom network traffic filters implemented as BPF programs, applying to all IP packets sent and received over C and C sockets. Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (C). The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any C and C filters in any of these units. By default there are no filters specified. If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. Note that for socket-activated services, the IP filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires CC) instead of using this setting.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IPEgressFilterPath', { 'description' => 'Add custom network traffic filters implemented as BPF programs, applying to all IP packets sent and received over C and C sockets. Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (C). The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any C and C filters in any of these units. By default there are no filters specified. If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. Note that for socket-activated services, the IP filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires CC) instead of using this setting.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'DeviceAllow', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Control access to specific device nodes by the executed processes. Takes two space-separated strings: a device node specifier followed by a combination of C, C, C to control reading, writing, or creation of the specific device node(s) by the unit (mknod), respectively. On cgroup-v1 this controls the C control group attribute. For details about this control group attribute, see devices.txt. On cgroup-v2 this functionality is implemented using eBPF filtering. The device node specifier is either a path to a device node in the file system, starting with C, or a string starting with either C or C followed by a device group name, as listed in C. The latter is useful to whitelist all current and future devices belonging to a specific device group at once. The device group is matched according to filename globbing rules, you may hence use the C<*> and C wildcards. (Note that such globbing wildcards are not available for device node path specifications!) In order to match device nodes by numeric major/minor, use device node paths in the C and C directories. However, matching devices by major/minor is generally not recommended as assignments are neither stable nor portable between systems or different kernel versions. Examples: C is a path to a device node, referring to an ATA or SCSI block device. C and C are specifiers for all pseudo TTYs and all ALSA sound devices, respectively. C is a specifier matching all CPU related device groups. Note that whitelists defined this way should only reference device groups which are resolvable at the time the unit is started. Any device groups not resolvable then are not added to the device whitelist. In order to work around this limitation, consider extending service units with an ExecStartPre=/sbin/modprobe\x{2026} line that loads the necessary kernel module implementing the device group if missing. Example: \x{2026} [Service] ExecStartPre=-/sbin/modprobe -abq loop DeviceAllow=block-loop DeviceAllow=/dev/loop-control \x{2026} ", 'type' => 'list' }, 'DevicePolicy', { 'choice' => [ 'auto', 'closed', 'strict' ], 'description' => ' Control the policy for allowing device access: ', 'type' => 'leaf', 'value_type' => 'enum' }, 'Slice', { 'description' => 'The name of the slice unit to place the unit in. Defaults to C for all non-instantiated units of all unit types (except for slice units themselves see below). Instance units are by default placed in a subslice of C that is named after the template name. This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied. For units of type slice, the only accepted value for this setting is the parent slice. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units. Special care should be taken when relying on the default slice assignment in templated service units that have C set, see L, section "Default Dependencies" for details.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'Delegate', { 'description' => 'Turns on delegation of further resource control partitioning to processes of the unit. Units where this is enabled may create and manage their own private subhierarchy of control groups below the control group of the unit itself. For unprivileged services (i.e. those using the C setting) the unit\'s control group will be made accessible to the relevant user. When enabled the service manager will refrain from manipulating control groups or moving processes below the unit\'s control group, so that a clear concept of ownership is established: the control group tree above the unit\'s control group (i.e. towards the root control group) is owned and managed by the service manager of the host, while the control group tree below the unit\'s control group is owned and managed by the unit itself. Takes either a boolean argument or a list of control group controller names. If true, delegation is turned on, and all supported controllers are enabled for the unit, making them available to the unit\'s processes for management. If false, delegation is turned off entirely (and no additional controllers are enabled). If set to a list of controllers, delegation is turned on, and the specified controllers are enabled for the unit. Note that additional controllers than the ones specified might be made available as well, depending on configuration of the containing slice unit or other units contained in it. Note that assigning the empty string will enable delegation, but reset the list of controllers, all assignments prior to this will have no effect. Defaults to false. Note that controller delegation to less privileged code is only safe on the unified control group hierarchy. Accordingly, access to the specified controllers will not be granted to unprivileged services on the legacy hierarchy, even when requested. The following controller names may be specified: C, C, C, C, C, C, C. Not all of these controllers are available on all kernels however, and some are specific to the unified hierarchy while others are specific to the legacy hierarchy. Also note that the kernel might support further controllers, which aren\'t covered here yet as delegation is either not supported at all for them or not defined cleanly. For further details on the delegation model consult Control Group APIs and Delegation.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'DisableControllers', { 'description' => 'Disables controllers from being enabled for a unit\'s children. If a controller listed is already in use in its subtree, the controller will be removed from the subtree. This can be used to avoid child units being able to implicitly or explicitly enable a controller. Defaults to not disabling any controllers. It may not be possible to successfully disable a controller if the unit or any child of the unit in question delegates controllers to its children, as any delegated subtree of the cgroup hierarchy is unmanaged by systemd. Multiple controllers may be specified, separated by spaces. You may also pass C multiple times, in which case each new instance adds another controller to disable. Passing C by itself with no controller name present resets the disabled controller list. Valid controllers are C, C, C, C, C, C, and C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CPUShares', { 'description' => 'Assign the specified CPU time share weight to the processes executed. These options take an integer value and control the C control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time share weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. Implies C. These settings are deprecated. Use C and C instead.', 'max' => '262144', 'min' => '2', 'type' => 'leaf', 'upstream_default' => '1024', 'value_type' => 'integer' }, 'StartupCPUShares', { 'description' => 'Assign the specified CPU time share weight to the processes executed. These options take an integer value and control the C control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see sched-design-CFS.txt. The available CPU time is split up among all units within one slice relative to their CPU time share weight. While C only applies to the startup phase of the system, C applies to normal runtime of the system, and if the former is not set also to the startup phase. Using C allows prioritizing specific services at boot-up differently than during normal runtime. Implies C. These settings are deprecated. Use C and C instead.', 'max' => '262144', 'min' => '2', 'type' => 'leaf', 'upstream_default' => '1024', 'value_type' => 'integer' }, 'MemoryLimit', { 'description' => 'Specify the limit on maximum memory usage of the executed processes. The limit specifies how much process and kernel memory can be used by tasks in this unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value C, no memory limit is applied. This controls the C control group attribute. For details about this control group attribute, see memory.txt. Implies C. This setting is deprecated. Use C instead.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BlockIOAccounting', { 'description' => 'Turn on Block I/O accounting for this unit, if the legacy control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with C in L. This setting is deprecated. Use C instead.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'BlockIOWeight', { 'description' => 'Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 500. For details about this control group attribute, see blkio-controller.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. Implies C. These settings are deprecated. Use C and C instead.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupBlockIOWeight', { 'description' => 'Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the C control group attribute, which defaults to 500. For details about this control group attribute, see blkio-controller.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. While C only applies to the startup phase of the system, C applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. Implies C. These settings are deprecated. Use C and C instead.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BlockIODeviceWeight', { 'description' => 'Set the per-device overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 10 and 1000. (Example: "/dev/sda 500"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the C control group attribute, which defaults to 1000. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see blkio-controller.txt. Implies C. This setting is deprecated. Use C instead.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BlockIOReadBandwidth', { 'description' => 'Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C and C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see blkio-controller.txt. Implies C. These settings are deprecated. Use C and C instead.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BlockIOWriteBandwidth', { 'description' => 'Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C and C control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see blkio-controller.txt. Implies C. These settings are deprecated. Use C and C instead.', 'type' => 'leaf', 'value_type' => 'uniline' } ], 'generated_by' => 'parse-man.pl from systemd 244 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::ResourceControl' } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd/Service.pl0000644000175000017500000000422113575500330024100 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unknown parameter' } ], 'element' => [ 'disable', { 'description' => 'When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details.', 'summary' => 'disable configuration file supplied by the vendor', 'type' => 'leaf', 'upstream_default' => '0', 'value_type' => 'boolean' }, 'Service', { 'config_class_name' => 'Systemd::Section::Service', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Unit', { 'config_class_name' => 'Systemd::Section::ServiceUnit', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'warped_node', 'warp' => { 'follow' => { 'disable' => '- disable' }, 'rules' => [ '$disable', { 'level' => 'hidden' } ] } } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::Service', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit', 'file' => '&index.service' } } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd.pl0000644000175000017500000000212013575500330022474 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'element' => [ 'service', { 'cargo' => { 'config_class_name' => 'Systemd::Service', 'type' => 'node' }, 'index_type' => 'string', 'type' => 'hash' }, 'socket', { 'cargo' => { 'config_class_name' => 'Systemd::Socket', 'type' => 'node' }, 'index_type' => 'string', 'type' => 'hash' }, 'timer', { 'cargo' => { 'config_class_name' => 'Systemd::Timer', 'type' => 'node' }, 'index_type' => 'string', 'type' => 'hash' } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd' } } ] ; Config-Model-Systemd-0.244.1/lib/Config/Model/models/Systemd.pod0000644000175000017500000000147613575500330022660 0ustar domidomi# PODNAME: Config::Model::models::Systemd # ABSTRACT: Configuration class Systemd =encoding utf8 =head1 NAME Config::Model::models::Systemd - Configuration class Systemd =head1 DESCRIPTION Configuration classes used by L =head1 Elements =head2 service I< Optional. Type hash of node of class L . > =head2 socket I< Optional. Type hash of node of class L . > =head2 timer I< Optional. Type hash of node of class L . > =head1 SEE ALSO =over =item * L =item * L =item * L =item * L =back =cut Config-Model-Systemd-0.244.1/lib/Config/Model/Backend/0000755000175000017500000000000013575500330020560 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/Backend/Systemd/0000755000175000017500000000000013575500330022210 5ustar domidomiConfig-Model-Systemd-0.244.1/lib/Config/Model/Backend/Systemd/Layers.pm0000644000175000017500000000424613575500330024013 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Systemd::Layers; $Config::Model::Backend::Systemd::Layers::VERSION = '0.244.1'; use Mouse::Role; sub default_directories { my $self = shift ; my $app = $self->node->instance->application; my @layers ; if ($app eq 'systemd-user') { @layers = ( # paths documented by systemd-system.conf man page '/etc/systemd/user.conf.d/', '/run/systemd/user.conf.d/', '/usr/lib/systemd/user.conf.d/', # path found on Debian '/usr/lib/systemd/user/' ); } elsif ($app eq 'systemd') { @layers = ( # paths documented by systemd-system.conf man page '/etc/systemd/system.conf.d/', '/run/systemd/system.conf.d/', '/lib/systemd/system.conf.d/', # not documented but used to symlink to real files '/etc/systemd/system/', # path found on Debian '/lib/systemd/system/', ); } return @layers; } 1; # ABSTRACT: Role that provides Systemd default directories __END__ =pod =encoding UTF-8 =head1 NAME Config::Model::Backend::Systemd::Layers - Role that provides Systemd default directories =head1 VERSION version 0.244.1 =head1 SYNOPSIS package Config::Model::Backend::Systemd ; extends 'Config::Model::Backend::Any'; with 'Config::Model::Backend::Systemd::Layers'; =head1 DESCRIPTION Small role to provide Systemd default directories (user or system) to L and L. =head1 Methods =head2 default_directories Returns a list of default directory, depending on the application used (either C or C. =head1 AUTHOR Dominique Dumont =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2015-2018 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut Config-Model-Systemd-0.244.1/lib/Config/Model/Backend/Systemd/Unit.pm0000644000175000017500000002105113575500330023464 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Systemd::Unit ; $Config::Model::Backend::Systemd::Unit::VERSION = '0.244.1'; use strict; use warnings; use 5.010; use Mouse ; use Log::Log4perl qw(get_logger :levels); use Path::Tiny; extends 'Config::Model::Backend::IniFile'; with 'Config::Model::Backend::Systemd::Layers'; my $logger = get_logger("Backend::Systemd::Unit"); my $user_logger = get_logger("User"); sub read { my $self = shift ; my %args = @_ ; # enable 2 styles of comments (gh #1) $args{comment_delimiter} = "#;"; # args are: # root => './my_test', # fake root directory, used for tests # config_dir => /etc/foo', # absolute path # file => 'foo.conf', # file name # file_path => './my_test/etc/foo/foo.conf' # check => yes|no|skip # file write is handled by Unit backend if ($self->instance->application =~ /systemd-(?!user)/) { # file_path overridden by model => how can config_dir be found ? my $file = $args{file_path}; # allow non-existent file to let user start from scratch return 1 unless path( $file )->exists; return $self->load_ini_file(%args, file_path => $file); } my $unit_type = $self->node->element_name; my $unit_name = $self->node->index_value; $self->node->instance->layered_start; my $root = $args{root} || path('/'); my $cwd = $args{root} || path('.'); # load layers for this service foreach my $layer ($self->default_directories) { my $local_root = $layer =~ m!^/! ? $root : $cwd; my $layer_dir = $local_root->child($layer); next unless $layer_dir->is_dir; my $layer_file = $layer_dir->child($unit_name.'.'.$unit_type); next unless $layer_file->exists; $logger->warn("reading default layer from unit $unit_type name $unit_name from $layer_file"); $self->load_ini_file(%args, file_path => $layer_file); # TODO: may also need to read files in # $unit_name.'.'.$unit_type.'.d' to get all default values # (e.g. /lib/systemd/system/rc-local.service.d/debian.conf) } $self->node->instance->layered_stop; # now read editable file (files that can be edited with systemctl edit . # for systemd -> /etc/ systemd/system/unit.type.d/override.conf # for user -> ~/.local/systemd/user/*.conf # for local file -> $args{filexx} # TODO: document limitations (can't read arbitrary files in /etc/ # systemd/system/unit.type.d/ and # ~/.local/systemd/user/unit.type.d/*.conf my $app = $self->instance->application; my $service_path; if ($app eq 'systemd') { $service_path = $args{file_path}->parent->child("$unit_name.$unit_type.d/override.conf"); } else { $service_path = $args{file_path} ; } if ($service_path->exists and $service_path->realpath eq '/dev/null') { $logger->debug("skipping unit $unit_type name $unit_name from $service_path"); } elsif ($service_path->exists) { $logger->debug("reading unit $unit_type name $unit_name from $service_path"); $self->load_ini_file(%args, file_path => $service_path); } } sub load_ini_file { my ($self, %args) = @_ ; $logger->debug("opening file '".$args{file_path}."' to read"); my $res = $self->SUPER::read( %args ); die "failed ". $args{file_path}." read" unless $res; } # overrides call to node->load_data sub load_data { my $self = shift; my %args = @_ ; # data, check, split_reg my $check = $args{check}; my $data = $args{data} ; my $disp_leaf = sub { my ($scanner, $data, $node,$element_name,$index, $leaf_object) = @_ ; if (ref($data) eq 'ARRAY') { Config::Model::Exception::User->throw( object => $leaf_object, error => "Cannot store twice the same value ('" .join("', '",@$data). "'). " ."Is '$element_name' line duplicated in config file ? " ."You can use -force option to load value '". $data->[-1]."'." ) if $check eq 'yes'; $data = $data->[-1]; } $leaf_object->store(value => $data, check => $check); } ; my $unit_cb = sub { my ($scanner, $data_ref,$node,@elements) = @_ ; # read data in the model order foreach my $elt (@elements) { my $unit_data = delete $data_ref->{$elt}; # extract relevant data next unless defined $unit_data; $scanner->scan_element($unit_data, $node,$elt) ; } # read accepted elements foreach my $elt (sort keys %$data_ref) { my $unit_data = $data_ref->{$elt}; # extract relevant data # force creation of element (can be removed with Config::Model 2.086) my $obj = $node->fetch_element(name => $elt, check => $check); $scanner->scan_element($unit_data, $node,$elt) ; } }; # this setup is required because IniFile backend cannot push value # coming from several ini files on a single list element. (even # though keys can be repeated in a single ini file and stored as # list in a single config element, this is not possible if the # list values come from several files) my $list_cb = sub { my ($scanner, $data,$node,$element_name,@idx) = @_ ; my $list_ref = ref($data) ? $data : [ $data ]; my $list_obj= $node->fetch_element(name => $element_name, check => $check); foreach my $d (@$list_ref) { $list_obj->push($d); # push also empty values } }; my $scan = Config::Model::ObjTreeScanner-> new ( node_content_cb => $unit_cb, list_element_cb => $list_cb, leaf_cb => $disp_leaf, ) ; $scan->scan_node($data, $self->node) ; } sub write { my $self = shift ; my %args = @_ ; # args are: # root => './my_test', # fake root directory, userd for tests # config_dir => /etc/foo', # absolute path # file => 'foo.conf', # file name # file_path => './my_test/etc/foo/foo.conf' # check => yes|no|skip if ($self->node->grab_value('disable')) { my $fp = $args{file_path}; if ($fp->realpath ne '/dev/null') { $user_logger->warn("symlinking file $fp to /dev/null"); $fp->remove; symlink ('/dev/null', $fp->stringify); } return 1; } my $unit_name = $self->node->index_value; my $unit_type = $self->node->element_name; my $app = $self->instance->application; my $service_path; if ($app eq 'systemd') { my $dir = $args{file_path}->parent->child("$unit_name.$unit_type.d"); $service_path = $dir->child('override.conf'); } else { $service_path = $args{file_path}; } $logger->debug("writing unit to $service_path"); # mouse super() does not work... $self->SUPER::write(%args, file_path => $service_path); } sub _write_leaf{ my ($self, $args, $node, $elt) = @_ ; # must skip disable element which cannot be hidden :-( if ($elt eq 'disable') { return ''; } else { return $self->SUPER::_write_leaf($args, $node, $elt); } } no Mouse ; __PACKAGE__->meta->make_immutable ; 1; # ABSTRACT: R/W backend for systemd unit files __END__ =pod =encoding UTF-8 =head1 NAME Config::Model::Backend::Systemd::Unit - R/W backend for systemd unit files =head1 VERSION version 0.244.1 =head1 SYNOPSIS # in systemd service or socket model rw_config => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit', 'file' => '&index.service' } =head1 DESCRIPTION C provides a plugin class to enable L to read and write systemd configuration files. This class inherits L is designed to be used by L. =head1 Methods =head2 read This method read config data from systemd default file to get default values and read config data. =head2 write This method write systemd configuration data. When the service is disabled, the target configuration file is replaced by a link to C. =head1 AUTHOR Dominique Dumont =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2015-2018 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut Config-Model-Systemd-0.244.1/lib/Config/Model/Backend/Systemd.pm0000644000175000017500000002124213575500330022547 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Systemd ; $Config::Model::Backend::Systemd::VERSION = '0.244.1'; use strict; use warnings; use 5.010; use Mouse ; use Log::Log4perl qw(get_logger :levels); use Path::Tiny 0.086; extends 'Config::Model::Backend::Any'; with 'Config::Model::Backend::Systemd::Layers'; my $logger = get_logger("Backend::Systemd"); my $user_logger = get_logger("User"); has config_dir => ( is => 'rw', isa => 'Path::Tiny' ); has 'annotation' => ( is => 'ro', isa => 'Bool', default => 1 ); # TODO: accepts other systemd suffixes my @service_types = qw/service socket/; my $joined_types = join('|', @service_types); my $filter = qr/\.($joined_types)(\.d)?$/; sub get_backend_arg { my $self = shift ; my $ba = $self->instance->backend_arg; if (not $ba) { Config::Model::Exception::User->throw( objet => $self->node, error => "Missing systemd unit to work on. This may be passed as 3rd argument to cme", ); } return $ba; } sub read { my $self = shift ; my $app = $self->instance->application; if ($app =~ /file/) { $self->read_systemd_files(@_); } else { $self->read_systemd_units(@_); } } sub read_systemd_files { my $self = shift ; my %args = @_ ; # args are: # root => './my_test', # fake root directory, used for tests # config_dir => /etc/foo', # absolute path # config_file => 'foo.conf', # file name # file_path => './my_test/etc/foo/foo.conf' # check => yes|no|skip #use Tk::ObjScanner; Tk::ObjScanner::scan_object(\%args) ; my $file = $args{file_path}; if (not $file) { Config::Model::Exception::User->throw( objet => $self->node, error => "Missing systemd file to work on. This may be passed as 3rd argument to cme", ); } $user_logger->warn( "Loading unit file '$file'"); my ($service_name, $unit_type) = split /\./, path($file)->basename; my @to_create = $unit_type ? ($unit_type) : @service_types; foreach my $unit_type (@to_create) { $logger->debug("registering unit $unit_type name $service_name from file name"); $self->node->load(step => qq!$unit_type:"$service_name"!, check => $args{check} ) ; } } sub read_systemd_units { my $self = shift ; my %args = @_ ; # args are: # root => './my_test', # fake root directory, used for tests # config_dir => /etc/foo', # absolute path # config_file => 'foo.conf', # file name # file_path => './my_test/etc/foo/foo.conf' # io_handle => $io # IO::File object # check => yes|no|skip my $app = $self->instance->application; my $select_unit = $self->get_backend_arg; if (not $select_unit) { Config::Model::Exception::User->throw( objet => $self->node, error => "Missing systemd unit to work on. This may be passed as 3rd argument to cme", ); } if ($select_unit ne '*') { $user_logger->warn( "Loading unit matching '$select_unit'"); } else { $user_logger->warn("Loading all units...") } my $root_path = $args{root} || path('/'); # load layers. layered mode is handled by Unit backend. Only a hash # key is created here, so layered mode does not matter foreach my $layer ($self->default_directories) { my $dir = $root_path->child($layer); next unless $dir->is_dir; $self->config_dir($dir); foreach my $file ($dir->children($filter) ) { my $file_name = $file->basename(); my $unit_name = $file->basename($filter); $logger->trace( "checking unit $file_name from $file (layered mode) against $select_unit"); if ($select_unit ne '*' and $file_name !~ /$select_unit/) { $logger->trace( "unit $file_name from $file (layered mode) does not match $select_unit"); next; } my ($unit_type) = ($file =~ $filter); $logger->debug( "registering unit $unit_type name $unit_name from $file (layered mode))"); # force config_dir during init $self->node->load(step => qq!$unit_type:"$unit_name"!, check => $args{check} ) ; } } my $dir = $root_path->child($args{config_dir}); if (not $dir->is_dir) { $logger->debug("skipping missing directory $dir"); return 1 ; } $self->config_dir($dir); my $found = 0; foreach my $file ($dir->children($filter) ) { my ($unit_type,$dot_d) = ($file =~ $filter); my $file_name = $file->basename(); my $unit_name = $file->basename($filter); next if ($select_unit ne '*' and $file_name !~ /$select_unit/); $logger->trace( "checking $file against $select_unit"); if ($file->realpath eq '/dev/null') { $logger->warn("unit $unit_type name $unit_name from $file is disabled"); $self->node->load(step => qq!$unit_type:"$unit_name" disable=1!, check => $args{check} ) ; } elsif ($dot_d and $file->child('override.conf')->exists) { $logger->warn("registering unit $unit_type name $unit_name from override file"); $self->node->load(step => qq!$unit_type:"$unit_name"!, check => $args{check} ) ; } else { $logger->warn("registering unit $unit_type name $unit_name from $file"); $self->node->load(step => qq!$unit_type:"$unit_name"!, check => $args{check} ) ; } $found++; } if (not $found) { # no service exists, let's create them. $user_logger->warn( "No unit '$select_unit' found in $dir, creating one..."); my ($service_name, $unit_type) = split /\./, $select_unit; my @to_create = $unit_type ? ($unit_type) : @service_types; $service_name //= $select_unit; foreach my $unit_type (@to_create) { $logger->debug("registering unit $unit_type name $service_name from scratch"); $self->node->load(step => qq!$unit_type:"$service_name"!, check => $args{check} ) ; } } return 1 ; } sub write { my $self = shift ; my %args = @_ ; # args are: # root => './my_test', # fake root directory, userd for tests # config_dir => /etc/foo', # absolute path # file => 'foo.conf', # file name # file_path => './my_test/etc/foo/foo.conf' # check => yes|no|skip # file write is handled by Unit backend return 1 if $self->instance->application =~ /file/; my $root_path = $args{root} || path('/'); my $dir = $args{root}->path($args{config_dir}); die "Unknown directory $dir" unless $dir->is_dir; my $select_unit = $self->get_backend_arg; # delete files for non-existing elements (deleted services) foreach my $file ($dir->children($filter) ) { my ($unit_type) = ($file =~ $filter); my $unit_name = $file->basename($filter); next if ($select_unit ne '*' and $unit_name !~ /$select_unit/); my $unit_collection = $self->node->fetch_element($unit_type); if (not $unit_collection->defined($unit_name)) { $user_logger->warn("removing file $file of deleted service"); $file->remove; } } return 1; } no Mouse ; __PACKAGE__->meta->make_immutable ; 1; # ABSTRACT: R/W backend for systemd configurations files __END__ =pod =encoding UTF-8 =head1 NAME Config::Model::Backend::Systemd - R/W backend for systemd configurations files =head1 VERSION version 0.244.1 =head1 SYNOPSIS # in systemd model rw_config => { 'backend' => 'Systemd' } =head1 DESCRIPTION Config::Model::Backend::Systemd provides a plugin class to enable L to read and write systemd configuration files. This class inherits L is designed to be used by L. =head1 Methods =head2 read This method scans systemd default directory and systemd config directory to create all units in L tree. The actual configuration parameters are read by L. =head2 write This method is a bit of a misnomer. It deletes configuration files of deleted service. The actual configuration parameters are written by L. =head1 AUTHOR Dominique Dumont =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2015-2018 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut Config-Model-Systemd-0.244.1/META.json0000644000175000017500000000374113575500330015644 0ustar domidomi{ "abstract" : "Editor and validator for systemd configuration files", "author" : [ "Dominique Dumont" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Config-Model-Systemd", "prereqs" : { "build" : { "requires" : { "Config::Model" : "2.133", "Module::Build" : "0.34" } }, "configure" : { "requires" : { "Module::Build" : "0.34" } }, "runtime" : { "recommends" : { "App::Cme" : "0", "Config::Model::TkUI" : "0" }, "requires" : { "Config::Model" : "2.133", "Config::Model::Backend::Any" : "0", "Config::Model::Backend::IniFile" : "0", "Log::Log4perl" : "0", "Mouse" : "0", "Mouse::Role" : "0", "Path::Tiny" : "0.086", "perl" : "5.010" } }, "test" : { "requires" : { "Config::Model::Tester" : "4.005", "Config::Model::Tester::Setup" : "0", "Test::File::Contents" : "0", "Test::More" : "0", "Test::Pod" : "1.00" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "ddumont at cpan.org", "web" : "https://github.com/dod38fr/config-model-systemd/issues" }, "homepage" : "https://github.com/dod38fr/config-model/wiki", "repository" : { "type" : "git", "url" : "git://github.com/dod38fr/config-model-systemd.git", "web" : "http://github.com/dod38fr/config-model-systemd" } }, "version" : "0.244.1", "x_generated_by_perl" : "v5.30.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.17" } Config-Model-Systemd-0.244.1/contrib/0000755000175000017500000000000013575500330015656 5ustar domidomiConfig-Model-Systemd-0.244.1/contrib/parse-man.pl0000644000175000017500000004676213575500330020115 0ustar domidomi#!/usr/bin/perl # # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; use 5.22.0; use utf8; use open qw(:std :encoding(UTF-8)); # undeclared streams in UTF-8 use lib 'lib'; use XML::Twig; use Path::Tiny; use Config::Model::Itself 2.012; use Config::Model::Exception; use Getopt::Long; use experimental qw/postderef signatures/ ; # default class name is Systemd::Section::ucfirst($item) my @service_list = qw/service socket timer/; my @list = qw/exec kill resource-control unit/; # Override the default class name # Please remove the old generated model if a class name is changed. my %map = ( 'exec' => 'Common::Exec', 'kill' => 'Common::Kill', 'resource-control' => 'Common::ResourceControl', ); my %opt; GetOptions (\%opt, "from=s") or die("Error in command line arguments\n"); die "Missing '-from' option " unless $opt{from}; my ($systemd_version) = (`systemctl --version` =~ m/(\d+)/) ; die "Cannot find systemd version" unless $systemd_version; say "Parsing man pages of systemd $systemd_version"; # make sure that Systemd model is created from scratch path('lib/Config/Model/models')->remove_tree; my $systemd_path = path($opt{from}); die "Can't open directory ".$opt{from}."\n" unless $systemd_path->is_dir; my $systemd_man_path = $systemd_path->child('man'); Config::Model::Exception::Trace(1); sub parse_xml ($list, $map) { my %data = ( element => [] ); my $config_class; my $file ; my $subsystem; my $desc = sub ($t, $elt) { my $txt = $elt->text; # there's black magic in XML::Twig that trash error message # contained in an error object. So the error must be stringified # explicitly before being sent upward # but it's easier to store data and handle it later outside of XML::Twig realm $data{class}{$config_class} //= []; push $data{class}{$config_class}->@*, $txt; }; my $manpage = sub ($t, $elt) { my $man = $elt->first_child('refentrytitle')->text; my $nb = $elt->first_child('manvolnum')->text; $elt->set_text( qq!L<$man($nb)>!); }; my $condition_variable = sub ($t, $elt) { my @var_list = $elt->children('term') ; my $listitem = $elt->first_child('listitem'); my $pre_doc = $listitem->first_child_text('para'); my $post_doc = $listitem->last_child_text('para'); foreach my $var_elt (@var_list) { my $var_name = $var_elt->text; my ($var_doc_elt) = $listitem->get_xpath(qq!./para/varname[string()="$var_name"]!); # say "condition_variable $var_name found at ",$var_doc_elt->path; my ($name, $extra_info) = $var_name =~ /C<([\w-]+)=([^>]*)>/ ; die "Error: cannot extract parameter name from '$var_name'" unless defined $name; my $desc = join ("\n\n", $pre_doc, $var_doc_elt->parent->text, $post_doc); push $data{element}->@*, [$config_class => $name => $desc => $extra_info]; } }; my $variable = sub ($t, $elt) { if ($systemd_version < 244 and $elt->first_child_text('term') =~ /^C($t, $elt); } my @para_text = map {$_->text} $elt->first_child('listitem')->children('para'); my $desc = join("\n\n", @para_text); # detect deprecated param and what replaces them my @supersedes ; if ($desc =~ /settings? (?:are|is) deprecated. Use ([\w=\s,]+)./) { my $capture = $1; @supersedes = $capture =~ /(\w+)=/g; } # apply substitution only on variable names (FooBar=). The regexp must test # for capital letter and C<..> to avoid breaking URL parameters $desc =~ s/C<([A-Z]\w+)=>/C<$1>/g; # detect verbatim parts setup with programlisting tag $desc =~ s/^\+-\+/ /gm; # no need to have more than 2 \n to separate paragraphs $desc =~ s/\n{3,}/\n\n/g; foreach my $term_elt ($elt->children('term')) { my $varname = $term_elt->first_child('varname')->text; my ($name, $extra_info) = $varname =~ /C<([\w-]+)=([^>]*)>/ ; next unless defined $name; say "- $config_class: storing parameter $name"; # we hope that deprecated items are listed in the same order with the new items push $data{element}->@*, [$config_class => $name => $desc => $extra_info => shift @supersedes ]; } }; my $set_config_class = sub ($name) { $config_class = 'Systemd::'.( $map->{$name} || 'Section::'.ucfirst($name)); say "Parsing class $config_class from " . $file->basename(".xml") . ':'; }; my $parse_sub_title = sub { my $t = $_->text(); if ($t =~ /\[(\w+)\] Section Options/ ) { $set_config_class->($1) ; } }; my $turn_to_pod_c = sub { my $t = $_->text(); $_->set_text("C<$t>");}; my $twig = XML::Twig->new ( twig_handlers => { 'refsect1/title' => $parse_sub_title, 'refsect1[string(title)=~ /Description/]/para' => $desc, 'refsect2/title' => $parse_sub_title, # only found in systemd.unit (so far) 'refsect2[string(title)=~ /Conditions/]/para' => $desc, 'citerefentry' => $manpage, 'literal' => $turn_to_pod_c, 'option' => $turn_to_pod_c, 'filename' => $turn_to_pod_c, 'constant' => $turn_to_pod_c, # this also remove the indentation of programlisting # element, 'para' => sub { $_->subs_text(qr/\n\s+/,"\n"); 1;}, # hack: use my own tag which is removed later to create # code block. Can't directly indent text as the content of # para element is also indented (and cleanup above) 'programlisting' => sub {my $t = $_->text(); $t =~ s/\n\s*/\n+-+/g; $_->set_text("\n\n+-+$t\n\n");}, # varname handling is done before the variable handling # below 'varname' => $turn_to_pod_c, 'refsect1/variablelist/varlistentry' => $variable, 'refsect2/variablelist/varlistentry' => $variable, } ); foreach my $_subsystem ($list->@*) { $subsystem = $_subsystem; $file = $systemd_man_path->child("systemd.$subsystem.xml"); $set_config_class->($subsystem); $twig->parsefile($file); } return \%data; } sub check_for_list ($element, $description) { my $is_list = 0; $is_list ||= $element =~ /^(Exec|Condition)/ ; # Requires list and its siblings parameters. See systemd.unit $is_list ||= $element =~ /^(Requires|Requisite|Wants|BindsTo|PartOf|Conflicts)$/ ; # see systemd.resource-control $is_list ||= $element =~ /^(DeviceAllow)$/ ; # see systemd.socket $is_list ||= $element =~ /^Listen/ ; $is_list ||= $description =~ /may be (specified|used) more than once/i ; return $is_list ? qw/type=list cargo/ : () ; } sub setup_element ($meta_root, $config_class, $element, $desc, $extra_info, $supersedes) { my @log; if (not $meta_root->fetch_element('class')->exists($config_class)) { say "Creating model class $config_class"; $meta_root->load( steps => [ qq!class:$config_class!, q!generated_by="parseman.pl from systemd doc"!, qq!accept:".*" type=leaf value_type=uniline warn="Unknown parameter"! ]); } my $step = "class:$config_class element:$element"; my $obj = $meta_root->grab(step => $step, autoadd => 1); # trim description (which is not saved in this sub) to simplify # the regexp below $desc =~ s/[\s\n]+/ /g; my $value_type = $desc =~ /Takes a boolean argument or/ ? 'enum' : $desc =~ /Takes an? (boolean|integer)/ ? $1 : $desc =~ /Takes time \(in seconds\)/ ? 'integer' : $desc =~ /allowed range/i ? 'integer' : $desc =~ /Takes one of/ ? 'enum' : $desc =~ /Takes the same values as/ ? 'enum' : $extra_info =~ /\w\|\w/ ? 'enum' : 'uniline'; if ($extra_info and $value_type ne 'enum') { push @log, "did not use extra info: $extra_info" unless scalar grep {$extra_info eq $_} qw/weight range/; } my ($min, $max); if ($desc =~ /Takes an integer between ([-\d]+) (?:\([\w\s]+\))? and ([-\d]+)/) { ($min, $max) = ($1, $2); push @log, "integer between $min and $max"; } if ($desc =~ /allowed range is ([-\d]+) to ([-\d]+)/) { ($min, $max) = ($1, $2); push @log, "integer range is $min to $max"; } my @load ; my @load_extra; if ($value_type eq 'integer' and $desc =~ /usual suffixes K/) { $value_type = 'uniline'; push @load_extra , q!match="^\d+(?i)[KMG]$"!; } push @load, check_for_list($element, $desc); push @load, 'type=leaf', "value_type=$value_type"; push @load_extra, 'write_as=no,yes' if $value_type eq 'boolean'; if ($value_type eq 'enum') { my @choices; # handle "Takes the same settings as ..." (seen only for enum) if ($desc =~ /takes the same values as the setting C<(\w+)>/i) { my $other = $1; my $other_obj = $obj->grab("- element:$other"); @choices = $other_obj->fetch_element('choice')->fetch; say "Copy enum choices from $other to ", $obj->location; } elsif ($extra_info =~ /\w\|\w/) { @choices = split /\|/, $extra_info ; } elsif ($desc =~ /Takes a boolean argument or /) { my ($choices) = ($desc =~ /Takes a boolean argument or (?:the )?(?:special values|architecture identifiers\s*)?([^.]+?)\./); @choices = ('no','yes'); push @choices, extract_choices($choices); push @load, qw/replace:false=no replace:true=yes replace:0=no replace:1=yes/; } if ($desc =~ /Takes one of/) { my ($choices) = ($desc =~ /Takes one of ([^.]+?)(?:\.|to test)/); @choices = extract_choices($choices); } die "Error in $config_class: cannot find the values of $element enum type from «$desc»\n" unless @choices; push @log, "enum choices are '".join("', '", @choices)."'"; push @load_extra, 'choice='.join(',',@choices); } push @load_extra, "min=$min" if defined $min; push @load_extra, "max=$max" if defined $max; if ($value_type eq 'integer' and $desc =~ /defaults? (?:to|is) (\d+)/i) { push @load_extra, "upstream_default=$1" ; } if ($supersedes) { push @load_extra, "status=deprecated"; push @log, "deprecated in favor of $supersedes"; # put migration in place for the other element my $new = $meta_root->grab( step => "class:$config_class element:$supersedes", autoadd => 1 ); $new->load(steps => qq!migrate_from variables:old="- $element" formula="\$old"!); } $obj->load(step => [@load, @load_extra]); say "class $config_class element $element:\n\t".join("\n\t", @log) if @log; return $obj; } sub extract_choices($choices) { my @choices = ($choices =~ m!C<([/\w\-+]+)>!g ); if ($choices =~ m{possibly prefixed with (?:a )?C<([!\w]+)>} ) { push @choices, map { "$1$_"} @choices; } return @choices; } sub move_deprecated_element ($meta_root, $from, $to) { say "Handling move of service/$from to unit/$to..."; # create deprecated moved element in Service for backward compat my $warn = $from eq $to ? "$from is now part of Unit." : "service/$from is now Unit/$to."; $meta_root->load( steps => [ 'class:Systemd::Section::Service', qq!element:$from type=leaf value_type=uniline status=deprecated!, qq!warn="$warn"! ]); # Due to the fact that Unit are used in Service, Timer, Socket but # only Service needs backward compat, a special Unit class is created # for each Service. # Saving $to definition stored from data extracted from Systemd # doc my $from_element_dump = $meta_root->grab( "class:Systemd::Section::Unit element:$to" )->dump_tree; # remove $from element from common Unit class $meta_root->load("class:Systemd::Section::Unit element:.rm($to)"); foreach my $service (@service_list) { my $unit_class = "Systemd::Section::". ucfirst($service).'Unit'; # inject $from element in Special Unit class $meta_root ->grab("class:$unit_class element:$to") ->load($from_element_dump); # make sure that special Unit class provide all elements from # common Unit class $meta_root->load(steps => [ "class:$unit_class include=Systemd::Section::Unit", 'accept:".*" type=leaf value_type=uniline warn="Unknown parameter"' ]); } # inject the migration instruction that retrieve $from element setting # from Service class (where it's deprecated) and copy them to the new # $from element in Unit class in a service file (hence this migration # instruction is done only in ServiceUnit class) $meta_root->load( steps => [ qq!class:Systemd::Section::ServiceUnit element:$to!, qq!migrate_from variables:service="- - Service $from" formula="\$service"! ]); } my $data = parse_xml([@list, @service_list], \%map) ; # Itself constructor returns an object to read or write the data # structure containing the model to be edited my $rw_obj = Config::Model::Itself -> new () ; # now load the existing model to be edited $rw_obj -> read_all() ; my $meta_root = $rw_obj->meta_root; # remove old generated classes foreach my $config_class ($meta_root->fetch_element('class')->fetch_all_indexes) { my $gen = $meta_root->grab_value( step => qq!class:$config_class generated_by!, mode => 'loose', ); next unless $gen and $gen =~ /parse-man/; $meta_root->load(qq!class:-$config_class!); } say "Creating systemd model..."; foreach my $config_class (keys $data->{class}->%*) { say "Creating model class $config_class"; my $desc_ref = $data->{class}{$config_class}; # cleanup leading white space and add formatting my $desc_text = join("\n\n", map { s/\n[\t ]+/\n/gr =~ s/C<([A-Z]\w+)=>/C<$1>/gr;} $desc_ref->@*); $desc_text.="\nThis configuration class was generated from systemd documentation.\n" ."by L\n"; my $steps = "class:$config_class class_description"; $meta_root->grab(step => $steps, autoadd => 1)->store($desc_text); $meta_root->load( steps => [ qq!class:$config_class generated_by="parse-man.pl from systemd $systemd_version doc"!, qq!copyright:0="2010-2016 Lennart Poettering and others"!, qq!copyright:1="2016 Dominique Dumont"!, qq!license="LGPLv2.1+"!, qq!accept:".*" type=leaf value_type=uniline warn="Unknown parameter"!, ]); } foreach my $cdata ($data->{element}->@*) { my ($config_class, $element, $desc, $extra_info, $supersedes) = $cdata->@*; my $obj = setup_element ($meta_root, $config_class, $element, $desc, $extra_info, $supersedes); $desc =~ s/ +$//gm; $obj->fetch_element("description")->store($desc); } say "Tweaking systemd model..."; $meta_root->load( 'class:Systemd::Section::Service generated_by="parse-man.pl from systemd doc" include:=Systemd::Common::ResourceControl,Systemd::Common::Exec,Systemd::Common::Kill' ); # doc for IOSchedulingClass is too complicated to parse, $meta_root->load( '! class:Systemd::Common::Exec element:IOSchedulingClass value_type=enum choice=0,1,2,3,none,realtime,best-effort,idle' ); # these warping instructions are used for most services. Serives are # disables when a service file is a symlink to /dev/null my $common_warp = qq!warp follow:disable="- disable" rules:\$disable level=hidden - - !; foreach my $service (@service_list) { my $name = ucfirst($service); my $class = 'Systemd::'.( $map{$name} || 'Section::'.ucfirst($name)); my $unit_class = $name.'Unit'; # make sure that the unit class exists (and fill it later when needed) $meta_root->load("class:Systemd::Section::$unit_class"); # create class that hold the service created by parsing man page $meta_root->load(qq! class:Systemd::$name generated_by="parse-man.pl from systemd doc" element:disable type=leaf value_type=boolean upstream_default=0 summary="disable configuration file supplied by the vendor" description="When true, cme will disable a configuration file supplied by the vendor by placing place a symlink to /dev/null with the same filename as the vendor configuration file. See L for details." - element:$name type=warped_node config_class_name=$class $common_warp - element:Unit type=warped_node config_class_name=Systemd::Section::$unit_class $common_warp - element:Install type=warped_node config_class_name=Systemd::Section::Install $common_warp - rw_config backend=Systemd::Unit file=&index.$service auto_delete=1 auto_create=1 - accept:".*" type=leaf value_type=uniline warn="Unknown parameter" - -! ); # Link the class above to base Systemd class $meta_root->load( qq! class:Systemd generated_by="parse-man.pl from systemd doc" element:$service type=hash index_type=string cargo type=node config_class_name=Systemd::$name - - rw_config backend=Systemd auto_create=1 auto_delete=1 - ! ); } my @moved = qw/FailureAction SuccessAction StartLimitBurst StartLimitInterval RebootArgument/; my %move_target = qw/StartLimitInterval StartLimitIntervalSec/; # check also src/core/load-fragment-gperf.gperf.m4 is systemd source # for "compatibility" elements foreach my $from (@moved) { my $to = $move_target{$from} || $from; move_deprecated_element($meta_root, $from, $to); } # StartLimitInterval is also deprecated in Unit say "Handling move of StartLimitInterval to StartLimitIntervalSec in unit"; $meta_root->load( steps => [ 'class:Systemd::Section::Unit', qq!element:StartLimitInterval type=leaf value_type=uniline status=deprecated!, qq!warn="StartLimitInterval is now StartLimitIntervalSec."! ]); # handle migration from both service and unit $meta_root->load( steps => [ qq!class:Systemd::Section::ServiceUnit element:StartLimitIntervalSec!, qq!migrate_from variables:unit="- StartLimitInterval"!, # $service variable is defined in move_deprecated element function q!use_eval=1 formula="$unit || $service"! ]); # renamed element in Unit say "Handling move of OnFailureIsolate to OnFailureJobMode in unit"; $meta_root->load( steps => [ 'class:Systemd::Section::Unit', q!element:OnFailureIsolate type=leaf value_type=uniline status=deprecated!, q!warn="OnFailureIsolate is now OnFailureJobMode." -!, q!element:OnFailureJobMode!, q!migrate_from variables:unit="- OnFailureIsolate"!, q!formula="$unit"! ]); say "Saving systemd model..."; $rw_obj->write_all; say "Done."; Config-Model-Systemd-0.244.1/META.yml0000644000175000017500000000215113575500330015466 0ustar domidomi--- abstract: 'Editor and validator for systemd configuration files' author: - 'Dominique Dumont' build_requires: Config::Model: '2.133' Config::Model::Tester: '4.005' Config::Model::Tester::Setup: '0' Module::Build: '0.34' Test::File::Contents: '0' Test::More: '0' Test::Pod: '1.00' configure_requires: Module::Build: '0.34' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Config-Model-Systemd recommends: App::Cme: '0' Config::Model::TkUI: '0' requires: Config::Model: '2.133' Config::Model::Backend::Any: '0' Config::Model::Backend::IniFile: '0' Log::Log4perl: '0' Mouse: '0' Mouse::Role: '0' Path::Tiny: '0.086' perl: '5.010' resources: bugtracker: https://github.com/dod38fr/config-model-systemd/issues homepage: https://github.com/dod38fr/config-model/wiki repository: git://github.com/dod38fr/config-model-systemd.git version: 0.244.1 x_generated_by_perl: v5.30.0 x_serialization_backend: 'YAML::Tiny version 1.73' Config-Model-Systemd-0.244.1/CONTRIBUTING.md0000644000175000017500000000634213575500330016454 0ustar domidomi# How to contribute # ## Ask questions ## Yes, asking a question is a form of contribution that helps the author to improve documentation. Feel free to ask questions by sending a mail to the [author](mailto:ddumont@cpan.org) ## Log a bug ## Please report issue on https://github.com/dod38fr/config-model-systemd/issues ## Source code structure ## The main parts of this modules are: * `contrib/parse-man.pl`: analyses Systemd documentation generates Systemd model. * `lib/Config/Model/system.d/`: declares the applications that `cme` can configure with this package. The name collision between Systemd and this directory is unfortunate. * `lib/Config/Model/Systemd.pm`: the "main" file of the Perl package. Mostly contains docuementation. * `lib/Config/Model/models/*.pl`: Main classes of Systemd model (not generated) * `lib/Config/Model/models/[Common|Section]/*.pl`: Systemd model generated by `contrib/parse-man.pl` from Systemd doc. These files can be viewed with `cme meta edit` command. See the end of [parse-man.pl](parse-man.pl) to tweak the generated model. The model structure can be viewed with `cme meta gen-dot` and `dot -Tps model.dot > model.ps` * `lib/Config/Model/models/**.pod`: the doc of the above models. Can be re-generated with `cme gen_class_pod` * `t`: test files. Run the tests with `prove -l t` * `t/model_tests.d` test the application delivered with this module using [Config::Model::Tester](http://search.cpan.org/dist/Config-Model-Tester/lib/Config/Model/Tester.pm). Use `prove -l t/model_test.t` command to run only model tests. ## Edit source code from github ## If you have a github account, you can clone a repo and prepare a pull-request. You can: * run `git clone https://github.com/dod38fr/config-model-systemd/` * edit files * run `prove -l t` to run non-regression tests There's no need to worry about `dzil`, `Dist::Zilla` or `dist.ini` files. These are useful to prepare a new release, but not to fix bugs. ## Edit source code from Debian source package ## You can also prepare a patch using Debian source package: For instance: * download and unpack `apt-get source libconfig-model-systemd-perl` * jump in `cd libconfig-model-systemd-perl-0.xxx` * useful to create a patch later: `git init` * commit all files: `git add -A ; git commit -m"committed all"` * edit files * run `prove -l t` to run non-regression tests * run `git diff` and send the output to the [author](mailto:ddumont@cpan.org) ## Edit source code from Debian source package or CPAN tarball ## Non Debian users can also prepare a patch using CPAN tarball: * Download tar file from http://search.cpan.org * unpack tar file with something like `tar axvf Config-Model-Systemd-2.xxx.tar.gz` * jump in `cd Config-Model-Systemd-2.xxx` * useful to create a patch later: `git init` * commit all files: `git add -A ; git commit -m"committed all"` * edit files * run `prove -l t` to run non-regression tests * run `git diff` and send the output to the [author](mailto:ddumont@cpan.org) ## Provide feedback ## Feedback is important. Please take a moment to rate, comment or add stars to this project: * [config-model github](https://github.com/dod38fr/config-model-systemd) or [config-model cpan ratings](http://cpanratings.perl.org/rate/?distribution=Config::Model::Systemd) Config-Model-Systemd-0.244.1/Build.PL0000644000175000017500000000277413575500330015524 0ustar domidomi# # This file is part of Config-Model-Systemd # # This software is Copyright (c) 2015-2018 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Module::Build; use warnings; use strict; require 5.010001 ; my @version_info = @ARGV ? ( dist_version => $ARGV[0] ) : (); my %appli_files = map { ( $_, $_ ) } glob("lib/Config/Model/*.d/*"); my $build = Module::Build->new( module_name => 'Config::Model::Systemd', @version_info, license => 'lgpl', appli_files => \%appli_files, dist_abstract => 'configuration editor for systemd', dist_author => 'Dominique Dumont (ddumont at cpan dot org)', 'build_requires' => { 'Config::Model' => '2.133', 'Config::Model::Tester' => '4.005', 'Config::Model::Tester::Setup' => '0', 'Module::Build' => '0.34', 'Test::File::Contents' => '0', 'Test::More' => '0', 'Test::Pod' => '1.00' }, 'configure_requires' => { 'Module::Build' => '0.34' }, 'recommends' => { 'App::Cme' => '0', 'Config::Model::TkUI' => '0' }, 'requires' => { 'Config::Model' => '2.133', 'Config::Model::Backend::Any' => '0', 'Config::Model::Backend::IniFile' => '0', 'Log::Log4perl' => '0', 'Mouse' => '0', 'Mouse::Role' => '0', 'Path::Tiny' => '0.086', 'perl' => '5.010' }, add_to_cleanup => [ qw/wr_root/ ], ); $build->add_build_element('pl'); $build->add_build_element('appli'); $build->create_build_script;