pax_global_header00006660000000000000000000000064150021776140014515gustar00rootroot0000000000000052 comment=2c2114172248c2330c595549a113b4cd5e888135 libconfig-model-systemd-perl-0.257.2/000077500000000000000000000000001500217761400173525ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/.gitignore000066400000000000000000000004031500217761400213370ustar00rootroot00000000000000/blib/ /.build/ _build/ cover_db/ inc/ Build !Build/ Build.bat .last_cover_stats /Makefile /Makefile.old /MANIFEST.bak /META.yml /META.json /MYMETA.* nytprof.out /pm_to_blib *.o *.bs /_eumm/ *~ Config-Model-Systemd-* lib/Config/Model/models/**/*.pod wr_root/ libconfig-model-systemd-perl-0.257.2/.travis.yml000066400000000000000000000005751500217761400214720ustar00rootroot00000000000000# see https://travis-ci.community/t/older-perl-version-stopped-working/4294 dist: trusty language: perl perl: - "5.28" - "5.24" - "5.22" - "5.20" - "5.18" - "5.16" - "5.14" install: - cpanm --quiet --notest Dist::Zilla - "dzil authordeps --missing | cpanm --notest " - "dzil listdeps --missing | cpanm --notest " script: - dzil smoke --release --author libconfig-model-systemd-perl-0.257.2/Build.PL000066400000000000000000000012231500217761400206440ustar00rootroot00000000000000 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)', ##{ $plugin->get_prereqs ##} add_to_cleanup => [ qw/wr_root/ ], ); $build->add_build_element('pl'); $build->add_build_element('appli'); $build->create_build_script; libconfig-model-systemd-perl-0.257.2/CONTRIBUTING.md000066400000000000000000000063421500217761400216100ustar00rootroot00000000000000# 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) libconfig-model-systemd-perl-0.257.2/Changes000066400000000000000000000247361500217761400206610ustar00rootroot00000000000000{{$NEXT}} 0.257.2 2025-04-23 Bug fix: * read timer file when loading a service by name * change some logs from warn to info 0.257.1 2025-04-07 Model update: * generate model from systemd 257 doc Model generator (parse-man.pl) changes: * handle desc with "Takes a boolean argument or ..." * fix variable assignment in description Other Changes: * dist.ini: update copyright year 0.256.1 2024-09-15 Model update: * generate model from systemd 256 doc Model generator (parse-man.pl) changes: * parse-man: sanitize L<> links Other Changes: * dist.ini: update copyright year 0.254.1 2023-11-24 Model update: * generate model from systemd 254 doc Model generator (parse-man.pl) changes: * parse-man: include tag in description * parse-man: extract more default values from documentation * parse-man: sort enum choices 0.252.2 2023-02-04 Bug fix: * correctly write systemd-user override unit file Model generator (parse-man.pl) changes: * parse-man: avoid very long lines in descriptions 0.252.1 2022-11-06 Model update: * update model from systemd 252 documentation 0.251.1 2022-05-28 Model update: * update model from systemd 251 documentation 0.250.1 2022-03-26 Model update: * update model from systemd 250 documentation Other Changes: * dist.ini: update copyright year 0.249.1 2021-11-12 For this release, I've reorganised the cme applications provided by this module. I.e, some of the app names passed to cme command (like systemd or systemd-service) have changed. Here are the cme applications now provided by this module. * For system administrators: - systemd: applies to all system service: e.g. "cme edit systemd transmission.*" - systemd-service: applies to one system service e.g. "cme edit systemd transmission-daemon.service" - systemd-timer: applies to one system timer - systemd-socket: applies to one system socket * For service developers: - systemd-service-file: applies to one system service file. e.g. "cme edit systemd ./src/transmission-daemon.service" - systemd-timer-file: applies to one system timer file - systemd-socket-file: applies to one system socket file * For users: - systemd-user: applies to all user service Model update: * updated Systemd models for version 249 Bug fixes * Unit backend: allow on/off as boolean values * improve user msg about unknown parameter * fix (Unit): warn when no unit files were found * fix (Unit): improve warning message to user * systemd backend: rm empty *.d dir when needed * systemd backend: create *.d dir when needed Other Changes: * requires Config::Model 2.143 * tests requires Config::Model::Tester 4.007 0.247.1 2020-12-17 Model update: * update model from systemd 247 documentation Other Changes: * skip tests on Solaris 0.246.1 2020-11-08 Model update: * update parameters from systemd 246 source * model doc now provides URL links from systemd doc Model generator (parse-man.pl) changes: * parse-man: fix doc parsing * parse-man: translate URL in pod links 0.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 libconfig-model-systemd-perl-0.257.2/README-build-from-git.md000066400000000000000000000033211500217761400234470ustar00rootroot00000000000000# 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. libconfig-model-systemd-perl-0.257.2/README.md000066400000000000000000000045461500217761400206420ustar00rootroot00000000000000[![](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) libconfig-model-systemd-perl-0.257.2/contrib/000077500000000000000000000000001500217761400210125ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/contrib/parse-man.pl000066400000000000000000000516521500217761400232430ustar00rootroot00000000000000#!/usr/bin/perl 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 Text::Wrap; $Text::Wrap::columns = 120; use experimental qw/postderef signatures/ ; no warnings qw/experimental::postderef experimental::signatures/; # default class name is Systemd::Section::ucfirst($item) my @service_list = qw/service socket timer/; my @list = qw/exec kill resource-control unit/; my $unknown_param_msg = "Unexpected systemd parameter. Please contact cme author to update systemd model."; # 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(qr/para|programlisting/); 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 # But C=C must be kept, hence the 2 regexps with negative and positive lookahead $desc =~ s/C<([A-Z]\w+)=>(?!C<)/C<$1>/g; $desc =~ s/C<([A-Z]\w+)=>(?=C<)/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 $var_elt = $term_elt->first_child('varname'); next unless $var_elt; my $varname = $var_elt->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(); # takes care of constant embedded in literal blocks return if $t =~ /^Cset_text($t =~ /[<>]/ ? "C<< $t >>" : "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, ulink => sub { my $url = $_->{att}{url}; my $t = $_->text(); $t =~ s/^[\s\n]+//; $t =~ s/[\s\n]+$//; $_->set_text("L<$t|$url>"); }, # 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_param_msg"! ]); } 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\s)?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("', '", sort @choices)."'"; push @load_extra, 'choice='.join(',',sort @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? (?:value )?(?: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_param_msg"' ]); } # 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"; # detect verbatim parts setup with programlisting tag $desc_text =~ s/^\+-\+/ /gm; 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_param_msg"!, ]); } 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(wrap('','',$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. Services are # disabled 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 $sub_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"); foreach my $class_name ("Systemd::$name", "Systemd::StandAlone::$name") { # create class that hold the service created by parsing man page $meta_root->load( qq! class:$class_name generated_by="parse-man.pl from systemd doc" accept:".*" type=leaf value_type=uniline warn="$unknown_param_msg" - -! ); } $meta_root->load( qq! class:Systemd::$name 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=$sub_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 ! ); $meta_root->load( qq! class:Systemd::StandAlone::$name element:$name type=node config_class_name=$sub_class - element:Unit type=node config_class_name=Systemd::Section::$unit_class - element:Install type=node config_class_name=Systemd::Section::Install - rw_config backend=Systemd::Unit auto_delete=1 auto_create=1 ! ); # 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."; libconfig-model-systemd-perl-0.257.2/dist.ini000066400000000000000000000041071500217761400210200ustar00rootroot00000000000000name = Config-Model-Systemd author = Dominique Dumont license = LGPL_2_1 copyright_holder = Dominique Dumont copyright_year = 2008-2025 [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] signed = 1 [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 -remove = GatherDir [ModuleBuild::Custom] mb_version = 0.34 [GatherDir] exclude_match = ^wr_root ; 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 [Signature] libconfig-model-systemd-perl-0.257.2/lib/000077500000000000000000000000001500217761400201205ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/000077500000000000000000000000001500217761400213255ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/000077500000000000000000000000001500217761400223655ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Backend/000077500000000000000000000000001500217761400237145ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Backend/Systemd.pm000066400000000000000000000200111500217761400256740ustar00rootroot00000000000000package Config::Model::Backend::Systemd ; use strict; use warnings; use 5.020; 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'; use feature qw/postderef signatures/; no warnings qw/experimental::postderef experimental::signatures/; 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 timer/; 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; } ## no critic (Subroutines::ProhibitBuiltinHomonyms) sub read ($self, @args) { my $app = $self->instance->application; if ($app =~ /file/) { return $self->read_systemd_files(@args); } else { return $self->read_systemd_units(@args); } } sub read_systemd_files ($self, %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->info( "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} ) ; } return 1; } sub read_systemd_units ($self, %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 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 must be passed as 3rd argument to cme", ); } if ($app ne 'systemd-user' and $select_unit =~ $filter) { my $unit_type = $1; if ($app eq 'systemd') { Config::Model::Exception::User->throw( objet => $self->node, error => "With 'systemd' app, unit name should not specify '$unit_type'. " ." Use 'systemd-$unit_type' app if you want to act only on $select_unit", ); } elsif ($app ne 'systemd-$unit_type') { Config::Model::Exception::User->throw( objet => $self->node, error => "Unit name $select_unit does not match app $app" ); } } if ($select_unit ne '*') { $user_logger->info( "Loading unit matching '$select_unit'"); } else { $user_logger->info("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) ) { $logger->trace("Scanning unit dir $dir with filter $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->info("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->info("registering unit $unit_type name $unit_name from override file"); $self->node->load(step => qq!$unit_type:"$unit_name"!, check => $args{check} ) ; } else { $logger->info("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->info( "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 ($self, %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; } no Mouse ; __PACKAGE__->meta->make_immutable ; 1; # ABSTRACT: R/W backend for systemd configurations files __END__ =pod =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. =cut libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Backend/Systemd/000077500000000000000000000000001500217761400253445ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Backend/Systemd/Layers.pm000066400000000000000000000027761500217761400271550ustar00rootroot00000000000000package Config::Model::Backend::Systemd::Layers; 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 !~ /file$/) { @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 =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. =cut libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Backend/Systemd/Unit.pm000066400000000000000000000240751500217761400266310ustar00rootroot00000000000000package Config::Model::Backend::Systemd::Unit ; use strict; use warnings; use 5.020; use Mouse ; use Log::Log4perl qw(get_logger :levels); use Path::Tiny; use feature qw/postderef signatures/; no warnings qw/experimental::postderef experimental::signatures/; extends 'Config::Model::Backend::IniFile'; with 'Config::Model::Backend::Systemd::Layers'; has _has_system_file => ( is => 'rw', isa => 'Bool', default => 0, ); my $logger = get_logger("Backend::Systemd::Unit"); my $user_logger = get_logger("User"); sub get_unit_info ($self, $file_path) { # get info from tree when Unit is children of systemd (app is systemd) my $unit_type = $self->node->element_name; my $unit_name = $self->node->index_value; my $app = $self->instance->application; my ($trash, $app_type) = split /-/, $app; # get info from file name (app is systemd-* not -user) if (my $fp = $file_path->basename) { my ($n,$t) = split /\./, $fp; $unit_type ||= $t; $unit_name ||= $n; } # fallback to app type when file is name without unit type $unit_type ||= $app_type if ($app_type and $app_type ne 'user'); Config::Model::Exception::User->throw( object => $self, error => "Unknown unit type. Please add type to file name. e.g. " . $file_path->basename.".service or socket..." ) unless $unit_type; # safety check if ($app !~ /^systemd(-user)?$/ and $app !~ /^systemd-$unit_type/) { Config::Model::Exception::User->throw( objet => $self->node, error => "Unit type $unit_type does not match app $app" ); } return ($unit_name, $unit_type); } around read => sub ($orig, $self, %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 if ($self->instance->application =~ /-file$/) { # allow non-existent file to let user start from scratch return 1 unless $args{file_path}->exists; return $self->load_ini_file($orig, %args); } my ($unit_name, $unit_type) = $self->get_unit_info($args{file_path}); my $app = $self->instance->application; my @default_directories; if ($app !~ /-user$/ or not $args{file_path}->exists) { # this user file may overrides an existing service file # so we don't read these default files @default_directories = $self->default_directories; } $self->node->instance->layered_start; my $root = $args{root} || path('/'); my $cwd = $args{root} || path('.'); # load layers for this service my $found_unit = 0; foreach my $layer (@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; $user_logger->info("Reading unit '$unit_type' '$unit_name' from '$layer_file'."); $self->load_ini_file($orig, %args, file_path => $layer_file); $found_unit++; # 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; if ($found_unit) { $self->_has_system_file(1); } else { $user_logger->info("Could not find unit files for $unit_type name $unit_name"); } # 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} my $service_path; if ($app =~ /-user$/ and $args{file_path}->exists) { # this use file may override an existing service file $service_path = $args{file_path} ; } else { $service_path = $args{file_path}->parent->child("$unit_name.$unit_type.d/override.conf"); } 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($orig, %args, file_path => $service_path); } return 1; }; sub load_ini_file ($self, $orig_read, %args) { $logger->debug("opening file '".$args{file_path}."' to read"); my $res = $self->$orig_read( %args ); die "failed ". $args{file_path}." read" unless $res; return; }; # overrides call to node->load_data sub load_data ($self, %args) { 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]; } # remove this translation after Config::Model 2.146 if ($leaf_object->value_type eq 'boolean') { $data = 'yes' if $data eq 'on'; $data = 'no' if $data eq 'off'; } $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 $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) ; return; } around 'write' => sub ($orig, $self, %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->info("symlinking file $fp to /dev/null"); $fp->remove; symlink ('/dev/null', $fp->stringify); } return 1; } my ($unit_name, $unit_type) = $self->get_unit_info($args{file_path}); my $app = $self->instance->application; my $service_path; # check if service has files in $self->default_directories # yes -> use a a file on $unit_name.$unit_type.d directry # no -> create a $args{file_path} file if ($app =~ /-(user|file)$/ and not $self->_has_system_file) { $service_path = $args{file_path}; $logger->debug("writing unit to $service_path"); $self->$orig(%args, file_path => $service_path); } else { my $dir = $args{file_path}->parent->child("$unit_name.$unit_type.d"); $dir->mkpath({ mode => oct(755) }); $service_path = $dir->child('override.conf'); $logger->debug("writing unit to $service_path"); $self->$orig(%args, file_path => $service_path); if (scalar $dir->children == 0) { # remove empty dir $logger->info("Removing empty dir $dir"); rmdir $dir; } } return 1; }; around _write_leaf => sub ($orig, $self, $args, $node, $elt) { # must skip disable element which cannot be hidden :-( if ($elt eq 'disable') { return ''; } else { return $self->$orig($args, $node, $elt); } }; no Mouse ; __PACKAGE__->meta->make_immutable ; 1; # ABSTRACT: R/W backend for systemd unit files __END__ =pod =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 LIMITATIONS Unit backend cannot read or write arbitrary files in C and C< ~/.config/systemd/user/unit.type.d/*.conf>. =cut libconfig-model-systemd-perl-0.257.2/lib/Config/Model/Systemd.pm000066400000000000000000000156671500217761400243720ustar00rootroot00000000000000package Config::Model::Systemd; use strict; use warnings; use 5.10.1; use Config::Model 2.143; 1; # ABSTRACT: Editor and validator for systemd configuration files __END__ =pod =encoding utf-8 =head1 SYNOPSIS # run on one service: $ sudo cme systemd-service # run command on name.service $ sudo cme systemd-socket # run command on name.socket $ sudo cme systemd-timer # run command on name.timer # run on several user units: # Run on several units: $ sudo cme systemd * # run command on all units $ sudo cme systemd # run command on all units matching pattern $ sudo cme systemd # run command on all units matching pattern $ cme systemd-user # run command on all user units matching pattern # run on one service file (for unit development): $ sudo cme systemd-service-file $ sudo cme systemd-socket-file $ sudo cme systemd-timer-file =head1 Command line example The examples below require L Dump override content of a specific service: $ cme dump systemd-service transmission-daemon Reading unit 'service' 'transmission-daemon' from '/lib/systemd/system/transmission-daemon.service'. --- Unit: After: - network-online.target - remote-fs.target Before: - umount.target Conflicts: - umount.target Dump the whole service (like C): $ cme dump systemd-service transmission-daemon --dumptype full Reading unit 'service' 'transmission-daemon' from '/lib/systemd/system/transmission-daemon.service'. --- Install: WantedBy: - multi-user.target Service: CPUShares: 1024 CPUWeight: 100 ExecReload: - /bin/kill -s HUP $MAINPID ExecStart: - /usr/bin/transmission-daemon -f --log-error [etc...] Edit the service override with a GUI: $ cme edit systemd-service transmission-daemon.service Edit the service override with a Shell UI: $ cme shell systemd-service transmission-daemon.service >:$ ls Service Unit Install >:$ cd Unit >: Unit $ ll -nz name │ type │ value ──────────┼──────┼─────────────────────────────────────── Conflicts │ list │ umount.target Before │ list │ umount.target After │ list │ network-online.target,remote-fs.target >: Unit $ set After:.push(foo.target) >: Unit $ ll -nz name │ type │ value ──────────┼──────┼────────────────────────────────────────────────── Conflicts │ list │ umount.target Before │ list │ umount.target After │ list │ network-online.target,remote-fs.target,foo.target Run command all user units: $ cme edit systemd-user '*' $ cme check systemd-user '*' Run command all user units that match 'foo': $ cme edit systemd-user foo $ cme check systemd-user foo Check all root units (can be quite long on small systems): # cme check systemd '*' Check all root units that match 'foo': # cme check systemd foo Edit override file of C: # cme edit systemd foo.service Run command on 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-imap-tunnel') ->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 (with L) 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-file 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 foo cme check systemd-service-file 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 libconfig-model-systemd-perl-0.257.2/lib/Config/Model/application.d/000077500000000000000000000000001500217761400251125ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/application.d/systemd-service-file000066400000000000000000000001671500217761400311040ustar00rootroot00000000000000model = Systemd::Service require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/application.d/systemd-socket-file000066400000000000000000000001661500217761400307330ustar00rootroot00000000000000model = Systemd::Socket require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/application.d/systemd-timer-file000066400000000000000000000001651500217761400305620ustar00rootroot00000000000000model = Systemd::Timer require_config_file = 1 support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/000077500000000000000000000000001500217761400236505ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd.pl000066400000000000000000000015531500217761400256410ustar00rootroot00000000000000use 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' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/000077500000000000000000000000001500217761400253005ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Common/000077500000000000000000000000001500217761400265305ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Common/Exec.pl000066400000000000000000011056341500217761400277630ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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 L. 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' => [ 'ExecSearchPath', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Takes a colon separated list of absolute paths relative to which the executable used by the C (e.g. C, C, etc.) properties can be found. C overrides C<$PATH> if C<$PATH> is not supplied by the user through C, C or C. Assigning an empty string removes previous assignments and setting C to a value multiple times will append to the previous setting. ', 'type' => 'list' }, '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 or L system call. If this is used, it must be ensured that the process binary and all its auxiliary files are available in the new root. 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. If C/C are used together with C the notification socket is automatically mounted from the host into the root environment, to ensure the notification interface can work correctly. Note that services using C/C will not be able to log via the syslog or journal protocols to the host logging infrastructure, unless the relevant sockets are mounted from the host, specifically: The host\'s L file will be made available for the service (read-only) as C. It will be updated automatically on soft reboot (see: L), in case the service is configured to survive it.', '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 L. 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. Units making use of C automatically gain an C dependency on C. The host\'s L file will be made available for the service (read-only) as C. It will be updated automatically on soft reboot (see: L), in case the service is configured to survive it.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootImageOptions', { 'description' => 'Takes a comma-separated list of mount options that will be used on disk images specified by C. Optionally a partition name can be prefixed, followed by colon, in case the image has multiple partitions, otherwise partition name C is implied. Options for multiple partitions can be specified in a single line with space separators. Assigning an empty string removes previous assignments. Duplicated options are ignored. For a list of valid mount options, please refer to L. Valid partition names follow the L: C, C, C, C, C, C, C, C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootEphemeral', { 'description' => 'Takes a boolean argument. If enabled, executed processes will run in an ephemeral copy of the root directory or root image. The ephemeral copy is placed in C while the service is active and is cleaned up when the service is stopped or restarted. If C is used and the root directory is a subvolume, the ephemeral copy will be created by making a snapshot of the subvolume. To make sure making ephemeral copies can be made efficiently, the root directory or root image should be located on the same filesystem as C. When using C with root directories, L should be used as the filesystem and the root directory should ideally be a subvolume which systemd can snapshot to make the ephemeral copy. For root images, a filesystem with support for reflinks should be used to ensure an efficient ephemeral copy.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RootHash', { 'description' => 'Takes a data integrity (dm-verity) root hash specified in hexadecimal, or the path to a file containing a root hash in ASCII hexadecimal format. This option enables data integrity checks using dm-verity, if the used image contains the appropriate integrity data (see above) or if C is used. The specified hash must match the root hash of integrity data, and is usually at least 256 bits (and hence 64 formatted hexadecimal characters) long (in case of SHA256 for example). If this option is not specified, but the image file carries the C extended file attribute (see L), then the root hash is read from it, also as formatted hexadecimal characters. If the extended file attribute is not found (or is not supported by the underlying file system), but a file with the C<.roothash> suffix is found next to the image file, bearing otherwise the same name (except if the image has the C<.raw> suffix, in which case the root hash file must not have it in its name), the root hash is read from it and automatically used, also as formatted hexadecimal characters. If the disk image contains a separate C partition it may also be Verity protected, in which case the root hash may configured via an extended attribute C or a C<.usrhash> file adjacent to the disk image. There\'s currently no option to configure the root hash for the C file system via the unit file directly.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootHashSignature', { 'description' => 'Takes a PKCS7 signature of the C option as a path to a DER-encoded signature file, or as an ASCII base64 string encoding of a DER-encoded signature prefixed by C. The dm-verity volume will only be opened if the signature of the root hash is valid and signed by a public key present in the kernel keyring. If this option is not specified, but a file with the C<.roothash.p7s> suffix is found next to the image file, bearing otherwise the same name (except if the image has the C<.raw> suffix, in which case the signature file must not have it in its name), the signature is read from it and automatically used. If the disk image contains a separate C partition it may also be Verity protected, in which case the signature for the root hash may configured via a C<.usrhash.p7s> file adjacent to the disk image. There\'s currently no option to configure the root hash signature for the C via the unit file directly.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootVerity', { 'description' => 'Takes the path to a data integrity (dm-verity) file. This option enables data integrity checks using dm-verity, if C is used and a root-hash is passed and if the used image itself does not contain the integrity data. The integrity data must be matched by the root hash. If this option is not specified, but a file with the C<.verity> suffix is found next to the image file, bearing otherwise the same name (except if the image has the C<.raw> suffix, in which case the verity data file must not have it in its name), the verity data is read from it and automatically used. This option is supported only for disk images that contain a single file system, without an enveloping partition table. Images that contain a GPT partition table should instead include both root file system and matching Verity data in the same image, implementing the L.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RootImagePolicy', { 'description' => 'Takes an image policy string as per L to use when mounting the disk images (DDI) specified in C, C, C, respectively. If not specified the following policy string is the default for C and C: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent: \\ home=encrypted+unprotected+absent: \\ srv=encrypted+unprotected+absent: \\ tmp=encrypted+unprotected+absent: \\ var=encrypted+unprotected+absent The default policy for C is: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MountImagePolicy', { 'description' => 'Takes an image policy string as per L to use when mounting the disk images (DDI) specified in C, C, C, respectively. If not specified the following policy string is the default for C and C: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent: \\ home=encrypted+unprotected+absent: \\ srv=encrypted+unprotected+absent: \\ tmp=encrypted+unprotected+absent: \\ var=encrypted+unprotected+absent The default policy for C is: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ExtensionImagePolicy', { 'description' => 'Takes an image policy string as per L to use when mounting the disk images (DDI) specified in C, C, C, respectively. If not specified the following policy string is the default for C and C: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent: \\ home=encrypted+unprotected+absent: \\ srv=encrypted+unprotected+absent: \\ tmp=encrypted+unprotected+absent: \\ var=encrypted+unprotected+absent The default policy for C is: root=verity+signed+encrypted+unprotected+absent: \\ usr=verity+signed+encrypted+unprotected+absent ', '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, C and C (as an empty 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 four 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 four 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. In order to allow propagating mounts at runtime in a safe manner, C on the host will be used to set up new mounts, and C in the private namespace will be used as an intermediate step to store them before being moved to the final mount point.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'BindLogSockets', { 'description' => 'Takes a boolean argument. If true, sockets from L will be bind mounted into the mount namespace. This is particularly useful when a different instance of C is employed, to make sure processes running in the namespace can still make use of L. This option is implied when C is used, when C, or when C is used in conjunction with either C or C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'ProtectProc', { 'choice' => [ 'default', 'invisible', 'noaccess', 'ptraceable' ], 'description' => 'Takes one of C, C, C or C (which it defaults to). When set, this controls the C mount option of the C instance for the unit that controls which directories with process metainformation (C) are visible and accessible: when set to C the ability to access most of other users\' process metadata in C is taken away for processes of the service. When set to C processes owned by other users are hidden from C. If C all processes that cannot be ptrace()\'ed by a process are hidden to it. If C no restrictions on C access or visibility are made. For further details see L. It is generally recommended to run most system services with this option set to C. This option is implemented via file system namespacing, and thus cannot be used with services that shall be able to install mount points in the host file system hierarchy. Note that the root user is unaffected by this option, so to be effective it has to be used together with C or C, and also without the C capability, which also allows a process to bypass this feature. It cannot be used for services that need to access metainformation about other users\' processes. This option implies C. If the kernel doesn\'t support per-mount point C mount options this setting remains without effect, and the unit\'s processes will be able to access and see other process as if the option was not used.', 'type' => 'leaf', 'value_type' => 'enum' }, 'ProcSubset', { 'choice' => [ 'all', 'pid' ], 'description' => 'Takes one of C (the default) and C. If C, all files and directories not directly associated with process management and introspection are made invisible in the C file system configured for the unit\'s processes. This controls the C mount option of the C instance for the unit. For further details see L. Note that Linux exposes various kernel APIs via C, which are made unavailable with this setting. Since these APIs are used frequently this option is useful only in a few, specific cases, and is not suitable for most non-trivial programs. Much like C above, this is implemented via file system mount namespacing, and hence the same restrictions apply: it is only available to system services, it disables mount propagation to the host mount table, and it implies C. Also, like C this setting is gracefully disabled if the used kernel does not support the C mount option of C.', 'type' => 'leaf', 'value_type' => 'enum' }, '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. Using this option implies that a mount namespace is allocated for the unit, i.e. it implies the effect of C (see below). 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. Using this option implies that a mount namespace is allocated for the unit, i.e. it implies the effect of C (see below). 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' }, 'MountImages', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'This setting is similar to C in that it mounts a file system hierarchy from a block device node or loopback file, but the destination directory can be specified as well as mount options. This option expects a whitespace separated list of mount definitions. Each definition consists of a colon-separated tuple of source path and destination definitions, optionally followed by another colon and a list of mount options. Mount options may be defined as a single comma-separated list of options, in which case they will be implicitly applied to the root partition on the image, or a series of colon-separated tuples of partition name and mount options. Valid partition names and mount options are the same as for C setting described above. Each mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. The source argument is a path to a block device node or regular file. If source or destination contain a C<:>, it needs to be escaped as C<\\:>. The device node or file system image file needs to follow the same rules as specified for C. Any mounts created with this option are specific to the unit, and are not visible in the host\'s mount table. These settings may be used more than once, each usage appends to the unit\'s list of mount paths. If the empty string is assigned, the entire list of mount paths defined prior to this is reset. 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. 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' => 'list' }, 'ExtensionImages', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'This setting is similar to C in that it mounts a file system hierarchy from a block device node or loopback file, but instead of providing a destination path, an overlay will be set up. This option expects a whitespace separated list of mount definitions. Each definition consists of a source path, optionally followed by a colon and a list of mount options. A read-only OverlayFS will be set up on top of C and C hierarchies for sysext images and C hierarchy for confext images. The order in which the images are listed will determine the order in which the overlay is laid down: images specified first to last will result in overlayfs layers bottom to top. Mount options may be defined as a single comma-separated list of options, in which case they will be implicitly applied to the root partition on the image, or a series of colon-separated tuples of partition name and mount options. Valid partition names and mount options are the same as for C setting described above. Each mount definition may be prefixed with C<->, in which case it will be ignored when its source path does not exist. The source argument is a path to a block device node or regular file. If the source path contains a C<:>, it needs to be escaped as C<\\:>. The device node or file system image file needs to follow the same rules as specified for C. Any mounts created with this option are specific to the unit, and are not visible in the host\'s mount table. These settings may be used more than once, each usage appends to the unit\'s list of image paths. If the empty string is assigned, the entire list of mount paths defined prior to this is reset. Each sysext image must carry a C file while each confext image must carry a C file, with the appropriate metadata which matches C/C or the host. See: L. To disable the safety check that the extension-release file name matches the image file name, the C mount option may be appended. 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' => 'list' }, 'ExtensionDirectories', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'This setting is similar to C in that it mounts a file system hierarchy from a directory, but instead of providing a destination path, an overlay will be set up. This option expects a whitespace separated list of source directories. A read-only OverlayFS will be set up on top of C and C hierarchies for sysext images and C hierarchy for confext images. The order in which the directories are listed will determine the order in which the overlay is laid down: directories specified first to last will result in overlayfs layers bottom to top. Each directory listed in C may be prefixed with C<->, in which case it will be ignored when its source path does not exist. Any mounts created with this option are specific to the unit, and are not visible in the host\'s mount table. These settings may be used more than once, each usage appends to the unit\'s list of directories paths. If the empty string is assigned, the entire list of mount paths defined prior to this is reset. Each sysext directory must contain a C file while each confext directory must carry a C file, with the appropriate metadata which matches C/C or the host. See: L. Note that usage from user units requires overlayfs support in unprivileged user namespaces, which was first introduced in kernel v5.11.', '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 this enforces only weak restrictions on the user/group name syntax, but will generate warnings in many cases where user/group names do not adhere to the following rules: the specified name should 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 and C<_> (i.e. digits 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 made in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. For further details on the names accepted and the names warned about see L. 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 user does not exist by then program invocation will fail. 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 this enforces only weak restrictions on the user/group name syntax, but will generate warnings in many cases where user/group names do not adhere to the following rules: the specified name should 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 and C<_> (i.e. digits 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 made in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. For further details on the names accepted and the names warned about see L. 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 user does not exist by then program invocation will fail. 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 is 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, unless C is manually set to C, C would be implied. 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 allow-listed 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. Note that this option is currently incompatible with D-Bus policies, thus a service using this option may currently not allocate a D-Bus service name (note that this does not affect calling into other D-Bus services). 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' }, 'SetLoginEnvironment', { 'description' => 'Takes a boolean parameter that controls whether to set the C<$HOME>, C<$LOGNAME>, and C<$SHELL> environment variables. If not set, this defaults to true if C, C or C are set, false otherwise. If set to true, the variables will always be set for system services, i.e. even when the default user C is used. If set to false, the mentioned variables are not set by the service manager, no matter whether C, C, or C are used or not. This option normally has no effect on services of the per-user service manager, since in that case these variables are typically inherited from user manager\'s own environment anyway.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, '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 C=C, 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 C=C.', '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<+>. Use L\'s capability command to retrieve a list of capabilities defined on the local system. 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 the 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. In case the service will be run in a new mount namespace anyway and SELinux is disabled, all file systems are mounted with C flag. Also see L. Note that this setting only has an effect on the unit\'s processes themselves (or any processes directly or indirectly forked off them). It has no effect on processes potentially invoked on request of them through tools such as L, L, L, or arbitrary IPC services.', '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<->, failing to set the SELinux security context will be ignored, but it\'s still possible that the subsequent execve() may fail if the policy doesn\'t allow the transition for the non-overridden context. 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. If prefixed by C<->, all errors will be ignored. This setting has no effect if AppArmor is not enabled. This setting 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 process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitFSIZE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitDATA', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitSTACK', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitCORE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRSS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNOFILE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitAS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNPROC', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitMEMLOCK', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitLOCKS', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitSIGPENDING', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitMSGQUEUE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitNICE', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRTPRIO', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LimitRTTIME', { 'description' => "Set soft and hard limits on various resources for executed processes. See L for details on the process resource limit concept. Process 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. C). 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\x{2026}19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\x{2026}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. Note that C will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service. Therefore the limit is cumulative for all processes running under the same UID. Please also note that the C will not be enforced if the service is running as root (and not dropping privileges). Due to these limitations, C (see L) is typically a better choice than C. 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 below). For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of C. After making such changes, make sure to restart the user's service manager.", '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 for system units. For user units the default value is inherited from the per-user service manager (whose default is in turn inherited from the system service manager, and thus typically also is 0022 \x{2014} unless overridden by a PAM module). In order to change the per-user mask for all user services, consider setting the C setting of the user's C system service instance. The per-user umask may also be set via the C field of a user's L (for users managed by L this field may be controlled via homectl --umask=). It may also be set via a PAM module, such as L.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'CoredumpFilter', { 'description' => 'Controls which types of memory mappings will be saved if the process dumps core (using the C file). Takes a whitespace-separated combination of mapping type names or numbers (with the default base 16). Mapping type names are C, C, C, C, C, C, C, C, C, and the special values C (all types) and C (the kernel default of CC CC). See L for the meaning of the mapping types. When specified multiple times, all specified masks are ORed. When not set, or if the empty value is assigned, the inherited value is not changed.', '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 mode 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 L 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 or systemd-oomd 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' => [ 'arm', 'arm-be', 'arm64', 'arm64-be', 'ppc', 'ppc-le', 'ppc64', 'ppc64-le', 's390', 's390x', 'x86', 'x86-64' ], '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, C, C, C, C or C. Which personality architectures are supported depends on the kernel\'s native architecture. Usually the 64-bit versions of the various system architectures support their immediate 32-bit 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. This option is not useful on architectures for which only one native word width was ever available, such as C (32-bit only) or C (64-bit only).', 'type' => 'leaf', 'value_type' => 'enum' }, 'IgnoreSIGPIPE', { 'description' => 'Takes a boolean argument. If true, C is ignored in the executed process. Defaults to true since C is generally only useful 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). In case of resource contention, smaller values mean more resources will be made available to the unit\'s processes, larger values mean less resources will be made available. See L for details.', 'max' => '19', 'min' => '-20', 'type' => 'leaf', 'value_type' => 'integer' }, 'CPUSchedulingPolicy', { 'choice' => [ 'batch', 'fifo', 'idle', 'other', '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. In case of CPU resource contention, smaller values mean less CPU time is made available to the service, larger values mean more. 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 call L, 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. Alternatively, takes a special "numa" value in which case systemd automatically derives allowed CPU range based on the value of C option. 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 or special "all" value which will include all available NUMA nodes in the mask. 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 one of the strings C, C or C. The kernel\'s default scheduling class is C at a priority of 4. 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). In case of I/O contention, smaller values mean more I/O bandwidth is made available to the unit\'s processes, larger values mean less bandwidth. 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. For the kernel\'s default scheduling class (C) this defaults to 4. See L for details.', 'max' => '7', 'min' => '0', 'type' => 'leaf', 'upstream_default' => '4', 'value_type' => 'integer' }, 'ProtectSystem', { 'choice' => [ 'full', 'no', 'strict', 'yes' ], 'description' => "Takes a boolean argument or the special values C or C. If true, mounts the C and the boot loader directories (C and C) 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. Similar, C, C, \x{2026} and related directory settings (see below) also exclude the specific directories from the effect of C. 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. Note that if C is set to C and C is enabled, then C and C will be writable.", 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'ProtectHome', { 'choice' => [ 'no', 'read-only', 'tmpfs', 'yes' ], '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 setting 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, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). If C is used, and if the kernel version supports L, the specified directories will be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped mounts will be kept untouched. 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, the logic for 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. C, C, C and C optionally support two more parameters, separated by C<:>. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory. The symlinks will be created after any C or C options have been set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter. The third parameter is a flags field, and since v257 can take a value of C to make the directory read only for the service. This is also supported for C. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only. To pass a flag without a destination symlink, the second parameter can be empty, for example: ConfigurationDirectory=foo::ro 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. Example: if a system service unit has the following, RuntimeDirectory=foo:bar foo:baz the service manager creates C (if it does not exist), and C plus C as symlinks to 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, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). If C is used, and if the kernel version supports L, the specified directories will be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped mounts will be kept untouched. 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, the logic for 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. C, C, C and C optionally support two more parameters, separated by C<:>. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory. The symlinks will be created after any C or C options have been set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter. The third parameter is a flags field, and since v257 can take a value of C to make the directory read only for the service. This is also supported for C. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only. To pass a flag without a destination symlink, the second parameter can be empty, for example: ConfigurationDirectory=foo::ro 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. Example: if a system service unit has the following, RuntimeDirectory=foo:bar foo:baz the service manager creates C (if it does not exist), and C plus C as symlinks to 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, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). If C is used, and if the kernel version supports L, the specified directories will be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped mounts will be kept untouched. 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, the logic for 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. C, C, C and C optionally support two more parameters, separated by C<:>. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory. The symlinks will be created after any C or C options have been set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter. The third parameter is a flags field, and since v257 can take a value of C to make the directory read only for the service. This is also supported for C. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only. To pass a flag without a destination symlink, the second parameter can be empty, for example: ConfigurationDirectory=foo::ro 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. Example: if a system service unit has the following, RuntimeDirectory=foo:bar foo:baz the service manager creates C (if it does not exist), and C plus C as symlinks to 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, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). If C is used, and if the kernel version supports L, the specified directories will be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped mounts will be kept untouched. 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, the logic for 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. C, C, C and C optionally support two more parameters, separated by C<:>. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory. The symlinks will be created after any C or C options have been set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter. The third parameter is a flags field, and since v257 can take a value of C to make the directory read only for the service. This is also supported for C. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only. To pass a flag without a destination symlink, the second parameter can be empty, for example: ConfigurationDirectory=foo::ro 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. Example: if a system service unit has the following, RuntimeDirectory=foo:bar foo:baz the service manager creates C (if it does not exist), and C plus C as symlinks to 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, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (C<:>). If C is used, and if the kernel version supports L, the specified directories will be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped mounts will be kept untouched. 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, the logic for 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. C, C, C and C optionally support two more parameters, separated by C<:>. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory. The symlinks will be created after any C or C options have been set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter. The third parameter is a flags field, and since v257 can take a value of C to make the directory read only for the service. This is also supported for C. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only. To pass a flag without a destination symlink, the second parameter can be empty, for example: ConfigurationDirectory=foo::ro 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. Example: if a system service unit has the following, RuntimeDirectory=foo:bar foo:baz the service manager creates C (if it does not exist), and C plus C as symlinks to 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', 'restart', 'yes' ], '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 timeout is applied. If a timeout is configured the clean operation will be aborted forcibly when the timeout 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 has to the file system. 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 allow-list specific paths for write access if C is used. Note that C cannot be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for each mount point write access is granted only if the mount point itself and the file system superblock backing it are not marked read-only. C only controls the former, not the latter, hence a read-only file system superblock remains protected. 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. Content in paths listed in C are not executable even if the usual file access controls would permit this. Nest C inside of C in order to provide executable content within non-executable directories. 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, 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. Please be extra careful when applying these options to API file systems (a list of them could be found in C), since they may be required for basic system functionalities. Moreover, C needs to be writable for setting up mount namespace and propagation. Simple allow-list example using these directives: [Service] ReadOnlyPaths=/ ReadWritePaths=/var /run InaccessiblePaths=-/lost+found NoExecPaths=/ ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 ', '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 has to the file system. 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 allow-list specific paths for write access if C is used. Note that C cannot be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for each mount point write access is granted only if the mount point itself and the file system superblock backing it are not marked read-only. C only controls the former, not the latter, hence a read-only file system superblock remains protected. 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. Content in paths listed in C are not executable even if the usual file access controls would permit this. Nest C inside of C in order to provide executable content within non-executable directories. 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, 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. Please be extra careful when applying these options to API file systems (a list of them could be found in C), since they may be required for basic system functionalities. Moreover, C needs to be writable for setting up mount namespace and propagation. Simple allow-list example using these directives: [Service] ReadOnlyPaths=/ ReadWritePaths=/var /run InaccessiblePaths=-/lost+found NoExecPaths=/ ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 ', '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 has to the file system. 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 allow-list specific paths for write access if C is used. Note that C cannot be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for each mount point write access is granted only if the mount point itself and the file system superblock backing it are not marked read-only. C only controls the former, not the latter, hence a read-only file system superblock remains protected. 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. Content in paths listed in C are not executable even if the usual file access controls would permit this. Nest C inside of C in order to provide executable content within non-executable directories. 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, 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. Please be extra careful when applying these options to API file systems (a list of them could be found in C), since they may be required for basic system functionalities. Moreover, C needs to be writable for setting up mount namespace and propagation. Simple allow-list example using these directives: [Service] ReadOnlyPaths=/ ReadWritePaths=/var /run InaccessiblePaths=-/lost+found NoExecPaths=/ ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 ', 'type' => 'list' }, 'ExecPaths', { '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 has to the file system. 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 allow-list specific paths for write access if C is used. Note that C cannot be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for each mount point write access is granted only if the mount point itself and the file system superblock backing it are not marked read-only. C only controls the former, not the latter, hence a read-only file system superblock remains protected. 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. Content in paths listed in C are not executable even if the usual file access controls would permit this. Nest C inside of C in order to provide executable content within non-executable directories. 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, 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. Please be extra careful when applying these options to API file systems (a list of them could be found in C), since they may be required for basic system functionalities. Moreover, C needs to be writable for setting up mount namespace and propagation. Simple allow-list example using these directives: [Service] ReadOnlyPaths=/ ReadWritePaths=/var /run InaccessiblePaths=-/lost+found NoExecPaths=/ ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 ', 'type' => 'list' }, 'NoExecPaths', { '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 has to the file system. 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 allow-list specific paths for write access if C is used. Note that C cannot be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for each mount point write access is granted only if the mount point itself and the file system superblock backing it are not marked read-only. C only controls the former, not the latter, hence a read-only file system superblock remains protected. 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. Content in paths listed in C are not executable even if the usual file access controls would permit this. Nest C inside of C in order to provide executable content within non-executable directories. 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, 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. Please be extra careful when applying these options to API file systems (a list of them could be found in C), since they may be required for basic system functionalities. Moreover, C needs to be writable for setting up mount namespace and propagation. Simple allow-list example using these directives: [Service] ReadOnlyPaths=/ ReadWritePaths=/var /run InaccessiblePaths=-/lost+found NoExecPaths=/ ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 ', '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, or C. If enabled, a new file system namespace will be set up for the executed processes, and C and C directories inside it are not shared with processes outside of the namespace, plus all temporary files created by a service in these directories will be removed after the service is stopped. If C, the backing storage of the private temporary directories will remain on the host\'s C and C directories. If C, the directories will be backed by a completely new tmpfs instance, meaning that the storage is fully disconnected from the host namespace. Defaults to false. This setting is useful to secure access to temporary files of the process, but makes sharing between processes via C or C impossible. If not set to C, 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. If set to C (as opposed to C), this has the side effect of adding C and C dependencies on all mount units necessary to access C and C on the host. 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 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, remove C and C from the capability bounding set for the unit, 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. 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. When access to some but not all devices must be possible, the C setting might be used instead. See L. ', '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 enabled, C is implied unless it is explicitly disabled, and C will be remounted to associate it with the new network namespace. 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 referring 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 enabled, C is implied unless it is explicitly disabled, and C will be remounted to associate it with the new network namespace. 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' }, 'PrivateIPC', { 'description' => 'Takes a boolean argument. If true, sets up a new IPC namespace for the executed processes. Each IPC namespace has its own set of System V IPC identifiers and its own POSIX message queue file system. This is useful to avoid name clash of IPC identifiers. Defaults to false. It is possible to run two or more units within the same private IPC namespace by using the C directive, see L for details. Note that IPC namespacing does not have an effect on C sockets, which are the most common form of IPC used on Linux. Instead, C sockets in the file system are subject to mount namespacing, and those in the abstract namespace are subject to network namespacing. IPC namespacing only has an effect on SysV IPC (which is mostly legacy) as well as POSIX message queues (for which C/C sockets are typically a better replacement). IPC namespacing also has no effect on POSIX shared memory (which is subject to mount namespacing) either. See L for the details. Note that the implementation of this setting might be impossible (for example if IPC 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' ] }, 'IPCNamespacePath', { 'description' => 'Takes an absolute file system path referring to a Linux IPC 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.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryKSM', { 'description' => 'Takes a boolean argument. When set, it enables KSM (kernel samepage merging) for the processes. KSM is a memory-saving de-duplication feature. Anonymous memory pages with identical content can be replaced by a single write-protected page. This feature should only be enabled for jobs that share the same security domain. For details, see L in the kernel documentation. Note that this functionality might not be available, for example if KSM is disabled in the kernel, or the kernel doesn\'t support controlling KSM at the process level through L.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PrivatePIDs', { 'description' => 'Takes a boolean argument. Defaults to false. If enabled, sets up a new PID namespace for the executed processes. Each executed process is now PID 1 - the init process - in the new namespace. C is mounted such that only processes in the PID namespace are visible. If C is set, C is implied. C is only supported for service units. This setting is not supported with C since the kernel will kill all processes in the PID namespace if the init process terminates. This setting will be ignored if the kernel does not support PID namespaces. Note unprivileged user services (i.e. a service run by the per-user instance of the service manager) will fail with C if C is masked (i.e. C is over-mounted with C like L does). This is due to a kernel restriction not allowing unprivileged user namespaces to mount a less restrictive instance of C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'PrivateUsers', { 'choice' => [ 'identity', 'no', 'self', 'yes' ], 'description' => 'Takes a boolean argument or one of C or C. Defaults to false. If enabled, sets up a new user namespace for the executed processes and configures a user and group mapping. If set to a true value or C, a minimal user and group mapping is configured 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 the parameter is C, user namespacing is set up with an identity mapping for the first 65536 UIDs/GIDs. Any UIDs/GIDs above 65536 will be mapped to the C user and group, respectively. While this does not provide UID/GID isolation, since all UIDs/GIDs are chosen identically it does provide process capability isolation, and hence is often a good choice if proper user namespacing with distinct UID maps is not appropriate. 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. When this setting is set up by a per-user instance of the service manager, the mapping of the C user and group to itself is omitted (unless the user manager is root). Additionally, in the per-user instance manager case, the user namespace will be set up before most other namespaces. This means that combining C=C with other namespaces will enable use of features not normally supported by the per-user instances of the service manager. 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.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, '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' ] }, 'ProtectClock', { 'description' => 'Takes a boolean argument. If set, writes to the hardware clock or system clock will be denied. Defaults to off. Enabling this option removes C and C from the capability bounding set for this unit, installs a system call filter to block calls that can set the clock, and C is implied. Note that the system calls are blocked altogether, the filter does not take into account that some of the calls can be used to read the clock state with some parameter combinations. Effectively, C, C, etc. are made read-only to the service. See L for the details about C. It is recommended to turn this on for most services that do not need modify the clock or check its state.', '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 and C as well as C will be inaccessible 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. 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.', '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', { 'choice' => [ 'no', 'private', 'strict', 'yes' ], 'description' => 'Takes a boolean argument or the special values C or C. If true, the Linux Control Groups (L) hierarchies accessible through C will be made read-only to all processes of the unit. If set to C, the unit will run in a cgroup namespace with a private writable mount of C. If set to C, the unit will run in a cgroup namespace with a private read-only mount of C. Defaults to off. If C is set, C is implied. Note C and C are downgraded to false and true respectively unless the system is using the unified control group hierarchy and the kernel supports cgroup namespaces. Except for container managers no services should require write access to the control groups hierarchies; it is hence recommended to set C to true or C for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for C and related settings, see above.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'RestrictAddressFamilies', { 'description' => 'Restricts the set of socket address families accessible to the processes of this unit. Takes C, or a space-separated list of address family names to allow-list, such as C, C or C. When C is specified, then all address families will be denied. When prefixed with C<~> the listed address families will be applied as deny list, otherwise as allow list. 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, ppc64, 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. 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 allow list as it is frequently used for local communication, including for L logging.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestrictFileSystems', { 'description' => 'Restricts the set of filesystems processes of this unit can open files on. Takes a space-separated list of filesystem names. Any filesystem listed is made accessible to the unit\'s processes, access to filesystem types not listed is prohibited (allow-listing). If the first character of the list is C<~>, the effect is inverted: access to the filesystems listed is prohibited (deny-listing). If the empty string is assigned, access to filesystems is not restricted. If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered will take precedence and will dictate the default action (allow access to the filesystem or deny it). Then the next occurrences of this option will add or delete the listed filesystems from the set of the restricted filesystems, depending on its type and the default action. Example: if a unit has the following, RestrictFileSystems=ext4 tmpfs RestrictFileSystems=ext2 ext4 then access to C, C, and C is allowed and access to other filesystems is denied. Example: if a unit has the following, RestrictFileSystems=ext4 tmpfs RestrictFileSystems=~ext4 then only access C is allowed. Example: if a unit has the following, RestrictFileSystems=~ext4 tmpfs RestrictFileSystems=ext4 then only access to C is denied. As the number of possible filesystems is large, predefined sets of filesystems are provided. A set starts with C<@> character, followed by name of the set. Use L\'s filesystems command to retrieve a list of filesystems defined on the local system. Note that this setting might not be supported on some systems (for example if the LSM eBPF hook is not enabled in the underlying kernel or if not using the unified control group hierarchy). In that case this setting has no effect.', '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 (allow-listing). 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 (deny-listing). 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. 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.', '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 (or preferably, an equivalent kernel check is enabled with L) 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.', '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. 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). As the SUID/SGID bits are mechanisms to elevate privileges, and allow 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, 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 namespace 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 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 (allow-listing). (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 (deny-listing). Deny-listed 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 deny-listed system call is triggered, instead of terminating the processes immediately. Special setting C can be used to explicitly specify killing. This value takes precedence over the one given in C, see below. 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 allow-listed 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. allow-listing and deny-listing), 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 an allow list rule for read() and write(), and right after it add a deny list rule for 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 in 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})\@pkeySystem calls that deal with memory protection keys (L)\@privilegedAll system calls which need super-user capabilities (L)\@processProcess control, execution, namespacing 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})\@sandboxSystem calls for sandboxing programs (L, Landlock system calls, \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 allow-listing 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})\@knownAll system calls defined by the kernel. This list is defined statically in systemd based on a kernel version that was available when this systemd version was released. It will become progressively more out-of-date as the kernel is updated. 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, allow-listing system calls (rather than deny-listing) is the safer mode of operation. It is recommended to enforce system call allow lists for all long-running system services. Specifically, the following lines are a relatively safe basic choice for the majority of system services: [Service] SystemCallFilter=\@system-service SystemCallErrorNumber=EPERM 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 deny lists comprehensive requires constant work. It is thus recommended to use allow-listing instead, which offers the benefit that new system calls are by default implicitly blocked until the allow list 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, 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 or the special setting C 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). By default, this option is set to the empty list, i.e. no 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' }, 'SystemCallLog', { '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 for the listed ones will be logged. If the first character of the list is C<~>, the effect is inverted: all system calls except the listed system calls will be logged. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel (\'seccomp filtering\') and is useful for auditing or setting up a minimal sandboxing environment. 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<+>.', 'type' => 'list' }, 'Environment', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "Sets environment variables for executed processes. Each line is unquoted using the rules described in \"Quoting\" section in L and becomes a list of variable assignments. If you need to assign a value containing spaces or the equals sign to a variable, put quotes around the whole assignment. Variable expansion is not performed inside the strings and the C<\$> character has no special meaning. Specifier expansion is performed, see the \"Specifiers\" section in L. This option may be specified more than once, in which case all listed variables will be set. If the same variable is listed 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. The names of the variables can contain ASCII letters, digits, and the underscore character. Variable names cannot be empty or start with a digit. In variable values, most characters are allowed, but non-printable characters are currently rejected. 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. Use C, C or C (see below) to pass data to unit processes securely.", '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 newline-separated variable assignments. Empty lines, lines without an C<=> separator, or lines starting with C<;> or C<#> will be ignored, which may be used for commenting. The file must be encoded with UTF-8. Valid characters are L other than L, C C, and CL. Control codes other than C are allowed. In the file, an unquoted value after the C<=> is parsed with the same backslash-escape rules as L, but unlike in a shell, interior whitespace is preserved and quotes after the first non-whitespace character are preserved. Leading and trailing whitespace (space, tab, carriage return) is discarded, but interior whitespace within the line is preserved verbatim. A line ending with a backslash will be continued to the following one, with the newline itself discarded. A backslash C<\\> followed by any character other than newline will preserve the following character, so that C<\\\\> will become the value C<\\>. In the file, a C<\'>-quoted value after the C<=> can span multiple lines and contain any character verbatim other than single quote, like L. No backslash-escape sequences are recognized. Leading and trailing whitespace outside of the single quotes is discarded. In the file, a C<">-quoted value after the C<=> can span multiple lines, and the same escape sequences are recognized as in L. Backslash (C<\\>) followed by any of C<"\\`$> will preserve that character. A backslash followed by newline is a line continuation, and the newline itself is discarded. A backslash followed by any other character is ignored; both the backslash and the following character are preserved verbatim. Leading and trailing whitespace outside of the double quotes is discarded. 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. The files are read from the file system of the service manager, before any file system changes like bind mounts take place). 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. 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 "Environment Variables in Spawned Processes" below for a description of how those settings combine to form the inherited environment. See L for general information about environment variables.', 'type' => 'list' }, 'StandardInput', { 'choice' => [ 'data', 'null', 'socket', 'tty', 'tty-fail', 'tty-force' ], '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 (C<\$LISTEN_FDS> (and related) environment variables are not passed when C value is configured). 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, unless C/C are set, in which case it defaults to C.", 'type' => 'leaf', 'value_type' => 'enum' }, 'StandardOutput', { 'choice' => [ 'inherit', 'journal', 'journal+console', 'kmsg', 'kmsg+console', 'null', 'socket', 'tty' ], '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, 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. Note: if a unit tries to print multiple lines to a TTY during bootup or shutdown, then there's a chance that those lines will be broken up by status messages. SetShowStatus() can be used to prevent this problem. See L for details. 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 using privileges of the user executing the systemd process) 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 \x{2014} for reading as well as writing \x{2014} 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 is similar to C above, but it truncates the file when opening it. For units with multiple command lines, e.g. C services with multiple C, or services with C, C or C, the output file is reopened and therefore re-truncated for each command line. If the output file is truncated while another process still has the file open, e.g. by an C running concurrently with an C, and the other process continues writing to the file without adjusting its offset, then the space between the file pointers of the two processes may be filled with C bytes, producing a sparse file. Thus, C is typically only useful for units where only one process runs at a time, such as services with a single C and no C, C, C or similar. 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 reopened. 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. If C is set to one of C, C, C, C, or C, this setting defaults to C. In other cases, 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 (which is the default if C is not set otherwise, but C/C is). 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 L. 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: \x{2026} StandardInput=data StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZXMgYW5kIHNvIGRv \\ IEkKQSBmdWxsIGNvbW1pdG1lbnQncyB3aGF0IEnigLJtIHRoaW5raW5nIG9mCllvdSB3b3VsZG4n \\ dCBnZXQgdGhpcyBmcm9tIGFueSBvdGhlciBndXkKSSBqdXN0IHdhbm5hIHRlbGwgeW91IGhvdyBJ \\ J20gZmVlbGluZwpHb3R0YSBtYWtlIHlvdSB1bmRlcnN0YW5kCgpOZXZlciBnb25uYSBnaXZlIHlv \\ dSB1cApOZXZlciBnb25uYSBsZXQgeW91IGRvd24KTmV2ZXIgZ29ubmEgcnVuIGFyb3VuZCBhbmQg \\ ZGVzZXJ0IHlvdQpOZXZlciBnb25uYSBtYWtlIHlvdSBjcnkKTmV2ZXIgZ29ubmEgc2F5IGdvb2Ri \\ eWUKTmV2ZXIgZ29ubmEgdGVsbCBhIGxpZSBhbmQgaHVydCB5b3UK \x{2026} ", '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 (which is the default if C is not set otherwise, but C/C is). 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 L. 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: \x{2026} StandardInput=data StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZXMgYW5kIHNvIGRv \\ IEkKQSBmdWxsIGNvbW1pdG1lbnQncyB3aGF0IEnigLJtIHRoaW5raW5nIG9mCllvdSB3b3VsZG4n \\ dCBnZXQgdGhpcyBmcm9tIGFueSBvdGhlciBndXkKSSBqdXN0IHdhbm5hIHRlbGwgeW91IGhvdyBJ \\ J20gZmVlbGluZwpHb3R0YSBtYWtlIHlvdSB1bmRlcnN0YW5kCgpOZXZlciBnb25uYSBnaXZlIHlv \\ dSB1cApOZXZlciBnb25uYSBsZXQgeW91IGRvd24KTmV2ZXIgZ29ubmEgcnVuIGFyb3VuZCBhbmQg \\ ZGVzZXJ0IHlvdQpOZXZlciBnb25uYSBtYWtlIHlvdSBjcnkKTmV2ZXIgZ29ubmEgc2F5IGdvb2Ri \\ eWUKTmV2ZXIgZ29ubmEgdGVsbCBhIGxpZSBhbmQgaHVydCB5b3UK \x{2026} ", '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 C=C 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, as well as any log messages written by the system manager process (PID 1) in reference 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, including systemd. 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. Note that this functionality is currently only available in system services, not in per-user services.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogRateLimitIntervalSec', { 'description' => "Configures the rate limiting that is applied to log 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. Note that this only applies to log messages that are processed by the logging subsystem, i.e. by L. This means that if you connect a service's stderr directly to a file via C or a similar setting, the rate limiting will not be applied to messages written that way (but it will be enforced for messages generated via L and similar functions).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogRateLimitBurst', { 'description' => "Configures the rate limiting that is applied to log 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. Note that this only applies to log messages that are processed by the logging subsystem, i.e. by L. This means that if you connect a service's stderr directly to a file via C or a similar setting, the rate limiting will not be applied to messages written that way (but it will be enforced for messages generated via L and similar functions).", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogFilterPatterns', { 'description' => 'Define an extended regular expression to filter log messages based on the C field of the structured message. If the first character of the pattern is C<~>, log entries matching the pattern should be discarded. This option takes a single pattern as an argument but can be used multiple times to create a list of allowed and denied patterns. If the empty string is assigned, the filter is reset, and all prior assignments will have no effect. Because the C<~> character is used to define denied patterns, it must be replaced with C<\\x7e> to allow a message starting with C<~>. For example, C<~foobar> would add a pattern matching C to the deny list, while C<\\x7efoobar> would add a pattern matching C<~foobar> to the allow list. Log messages are tested against denied patterns (if any), then against allowed patterns (if any). If a log message matches any of the denied patterns, it is discarded immediately without considering allowed patterns. Remaining log messages are tested against allowed patterns. Messages matching against none of the allowed pattern are discarded. If no allowed patterns are defined, then all messages are processed directly after going through denied filters. Filtering is based on the unit for which C is defined, meaning log messages coming from L about the unit are not taken into account. Filtered log messages won\'t be forwarded to traditional syslog daemons, the kernel log buffer (kmsg), the systemd console, or sent as wall messages to all logged-in users. Note that this functionality is currently only available in system services, not in per-user services.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LogNamespace', { 'description' => 'Run the unit\'s processes in the specified journal namespace. Expects a short user-defined string identifying the namespace. If not used the processes of the service are run in the default journal namespace, i.e. their log stream is collected and processed by C. If this option is used any log data generated by processes of this unit (regardless if via the syslog(), journal native logging or stdout/stderr logging) is collected and processed by an instance of the C template unit, which manages the specified namespace. The log data is stored in a data store independent from the default log namespace\'s data store. See L for details about journal namespaces. Internally, journal namespaces are implemented through Linux mount namespacing and over-mounting the directory that contains the relevant C sockets used for logging in the unit\'s mount namespace. Since mount namespaces are used this setting disconnects propagation of mounts from the unit\'s processes to the host, similarly to how C and similar settings describe above work. Journal namespaces may hence not be used for services that need to establish mount points on the host. When this option is used the unit will automatically gain ordering and requirement dependencies on the two socket units associated with the C instance so that they are automatically established prior to the unit starting up. Note that when this option is used log output of this service does not appear in the regular L output, unless the C<--namespace=> option is used.', '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. This does not erase the screen (see C below for that). 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' }, 'TTYColumns', { 'description' => 'Configure the size of the TTY specified with C. If unset or set to the empty string, it is attempted to retrieve the dimensions of the terminal screen via ANSI sequences, and if that fails the kernel defaults (typically 80x24) are used.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TTYRows', { 'description' => 'Configure the size of the TTY specified with C. If unset or set to the empty string, it is attempted to retrieve the dimensions of the terminal screen via ANSI sequences, and if that fails the kernel defaults (typically 80x24) are used.', '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. If the terminal device is of any other type of TTY an attempt is made to clear the screen via ANSI sequences. Defaults to C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'LoadCredential', { 'description' => "Pass a credential to the unit. Credentials are limited-size binary or textual objects that may be passed to unit processes. They are primarily used for passing cryptographic keys (both public and private) or certificates, user account information or identity information from host to services. The data is accessible from the unit's processes via the file system, at a read-only location that (if possible and permitted) is backed by non-swappable memory. The data is only accessible to the user associated with the unit, via the C/C settings (as well as the superuser). When available, the location of credentials is exported as the C<\$CREDENTIALS_DIRECTORY> environment variable to the unit's processes. The C setting takes a textual ID to use as name for a credential plus a file system path, separated by a colon. The ID must be a short ASCII string suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path is absolute it is opened as regular file and the credential data is read from it. If the absolute path refers to an C stream socket in the file system a connection is made to it (only once at unit start-up) and the credential data read from the connection, providing an easy IPC integration point for dynamically transferring credentials from other services. If the specified path is not absolute and itself qualifies as valid credential identifier it is attempted to find a credential that the service manager itself received under the specified name \x{2014} which may be used to propagate credentials from an invoking environment (e.g. a container manager that invoked the service manager) into a service. If no matching system credential is found, the directories C, C and C are searched for files under the credential's name \x{2014} which hence are recommended locations for credential data on disk. If C is used C, C, and C are searched as well. If the file system path is omitted it is chosen identical to the credential name, i.e. this is a terse way to declare credentials to inherit from the service manager into a service. This option may be used multiple times, each time defining an additional credential to pass to the unit. Note that if the path is not specified or a valid credential identifier is given, i.e. in the above two cases, a missing credential is not considered fatal. If an absolute path referring to a directory is specified, every file in that directory (recursively) will be loaded as a separate credential. The ID for each credential will be the provided ID suffixed with C<_\$FILENAME> (e.g., C). When loading from a directory, symlinks will be ignored. The contents of the file/socket may be arbitrary binary or textual data, including newline characters and C bytes. The C setting is identical to C, except that the credential data is decrypted and authenticated before being passed on to the executed processes. Specifically, the referenced path should refer to a file or socket with an encrypted credential, as implemented by L. This credential is loaded, decrypted, authenticated and then passed to the application in plaintext form, in the same way a regular credential specified via C would be. A credential configured this way may be symmetrically encrypted/authenticated with a secret key derived from the system's TPM2 security chip, or with a secret key stored in C, or with both. Using encrypted and authenticated credentials improves security as credentials are not stored in plaintext and only authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover, credentials may be bound to the local hardware and installations, so that they cannot easily be analyzed offline, or be generated externally. When C is set to C or C, or set to C and C is set, or C is set, then this setting adds C with C mode to C. See L for the details about C or C. Note that encrypted credentials targeted for services of the per-user service manager must be encrypted with systemd-creds encrypt --user, and those for the system service manager without the C<--user> switch. Encrypted credentials are always targeted to a specific user or the system as a whole, and it is ensured that per-user service managers cannot decrypt secrets intended for the system or for other users. The credential files/IPC sockets must be accessible to the service manager, but don't have to be directly accessible to the unit's processes: the credential data is read and copied into separate, read-only copies for the unit that are accessible to appropriately privileged processes. This is particularly useful in combination with C as this way privileged data can be made available to processes running under a dynamic UID (i.e. not a previously known one) without having to open up access to all users. In order to reference the path a credential may be read from within a C command line use C<\${CREDENTIALS_DIRECTORY}/mycred>, e.g. C. In order to reference the path a credential may be read from within a C line use C<%d/mycred>, e.g. C. For system services the path may also be referenced as C in cases where no interpolation is possible, e.g. configuration files of software that does not yet support credentials natively. C<\$CREDENTIALS_DIRECTORY> is considered the primary interface to look for credentials, though, since it also works for user services. Currently, an accumulated credential size limit of 1 MB per unit is enforced. The service manager itself may receive system credentials that can be propagated to services from a hosting container manager or VM hypervisor. See the L documentation for details about the former. For the latter, pass L OEM string table entries (field type 11) with a prefix of C or C. In both cases a key/value pair separated by C<=> is expected, in the latter case the right-hand side is Base64 decoded when parsed (thus permitting binary data to be passed in). Example L switch: C<-smbios type=11,value=io.systemd.credential:xx=yy>, or C<-smbios type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=>. Alternatively, use the qemu C node C. Example qemu switch: C<-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret>. They may also be passed from the UEFI firmware environment via L, from the initrd (see L), or be specified on the kernel command line using the C and C switches (see L \x{2013} this is not recommended since unprivileged userspace can read the kernel command line). If referencing an C stream socket to connect to, the connection will originate from an abstract namespace socket, that includes information about the unit and the credential ID in its socket name. Use L to query this information. The returned socket name is formatted as CRANDOM C UNITC ID, i.e. a C byte (as required for abstract namespace socket names), followed by a random string (consisting of alphadecimal characters), followed by the literal string C, followed by the requesting unit name, followed by the literal character C, followed by the textual credential ID requested. Example: C<\\0adf9d86b6eda275e/unit/foobar.service/credx> in case the credential C is requested for a unit C. This functionality is useful for using a single listening socket to serve credentials to multiple consumers. For further information see L documentation.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'LoadCredentialEncrypted', { 'description' => "Pass a credential to the unit. Credentials are limited-size binary or textual objects that may be passed to unit processes. They are primarily used for passing cryptographic keys (both public and private) or certificates, user account information or identity information from host to services. The data is accessible from the unit's processes via the file system, at a read-only location that (if possible and permitted) is backed by non-swappable memory. The data is only accessible to the user associated with the unit, via the C/C settings (as well as the superuser). When available, the location of credentials is exported as the C<\$CREDENTIALS_DIRECTORY> environment variable to the unit's processes. The C setting takes a textual ID to use as name for a credential plus a file system path, separated by a colon. The ID must be a short ASCII string suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path is absolute it is opened as regular file and the credential data is read from it. If the absolute path refers to an C stream socket in the file system a connection is made to it (only once at unit start-up) and the credential data read from the connection, providing an easy IPC integration point for dynamically transferring credentials from other services. If the specified path is not absolute and itself qualifies as valid credential identifier it is attempted to find a credential that the service manager itself received under the specified name \x{2014} which may be used to propagate credentials from an invoking environment (e.g. a container manager that invoked the service manager) into a service. If no matching system credential is found, the directories C, C and C are searched for files under the credential's name \x{2014} which hence are recommended locations for credential data on disk. If C is used C, C, and C are searched as well. If the file system path is omitted it is chosen identical to the credential name, i.e. this is a terse way to declare credentials to inherit from the service manager into a service. This option may be used multiple times, each time defining an additional credential to pass to the unit. Note that if the path is not specified or a valid credential identifier is given, i.e. in the above two cases, a missing credential is not considered fatal. If an absolute path referring to a directory is specified, every file in that directory (recursively) will be loaded as a separate credential. The ID for each credential will be the provided ID suffixed with C<_\$FILENAME> (e.g., C). When loading from a directory, symlinks will be ignored. The contents of the file/socket may be arbitrary binary or textual data, including newline characters and C bytes. The C setting is identical to C, except that the credential data is decrypted and authenticated before being passed on to the executed processes. Specifically, the referenced path should refer to a file or socket with an encrypted credential, as implemented by L. This credential is loaded, decrypted, authenticated and then passed to the application in plaintext form, in the same way a regular credential specified via C would be. A credential configured this way may be symmetrically encrypted/authenticated with a secret key derived from the system's TPM2 security chip, or with a secret key stored in C, or with both. Using encrypted and authenticated credentials improves security as credentials are not stored in plaintext and only authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover, credentials may be bound to the local hardware and installations, so that they cannot easily be analyzed offline, or be generated externally. When C is set to C or C, or set to C and C is set, or C is set, then this setting adds C with C mode to C. See L for the details about C or C. Note that encrypted credentials targeted for services of the per-user service manager must be encrypted with systemd-creds encrypt --user, and those for the system service manager without the C<--user> switch. Encrypted credentials are always targeted to a specific user or the system as a whole, and it is ensured that per-user service managers cannot decrypt secrets intended for the system or for other users. The credential files/IPC sockets must be accessible to the service manager, but don't have to be directly accessible to the unit's processes: the credential data is read and copied into separate, read-only copies for the unit that are accessible to appropriately privileged processes. This is particularly useful in combination with C as this way privileged data can be made available to processes running under a dynamic UID (i.e. not a previously known one) without having to open up access to all users. In order to reference the path a credential may be read from within a C command line use C<\${CREDENTIALS_DIRECTORY}/mycred>, e.g. C. In order to reference the path a credential may be read from within a C line use C<%d/mycred>, e.g. C. For system services the path may also be referenced as C in cases where no interpolation is possible, e.g. configuration files of software that does not yet support credentials natively. C<\$CREDENTIALS_DIRECTORY> is considered the primary interface to look for credentials, though, since it also works for user services. Currently, an accumulated credential size limit of 1 MB per unit is enforced. The service manager itself may receive system credentials that can be propagated to services from a hosting container manager or VM hypervisor. See the L documentation for details about the former. For the latter, pass L OEM string table entries (field type 11) with a prefix of C or C. In both cases a key/value pair separated by C<=> is expected, in the latter case the right-hand side is Base64 decoded when parsed (thus permitting binary data to be passed in). Example L switch: C<-smbios type=11,value=io.systemd.credential:xx=yy>, or C<-smbios type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=>. Alternatively, use the qemu C node C. Example qemu switch: C<-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret>. They may also be passed from the UEFI firmware environment via L, from the initrd (see L), or be specified on the kernel command line using the C and C switches (see L \x{2013} this is not recommended since unprivileged userspace can read the kernel command line). If referencing an C stream socket to connect to, the connection will originate from an abstract namespace socket, that includes information about the unit and the credential ID in its socket name. Use L to query this information. The returned socket name is formatted as CRANDOM C UNITC ID, i.e. a C byte (as required for abstract namespace socket names), followed by a random string (consisting of alphadecimal characters), followed by the literal string C, followed by the requesting unit name, followed by the literal character C, followed by the textual credential ID requested. Example: C<\\0adf9d86b6eda275e/unit/foobar.service/credx> in case the credential C is requested for a unit C. This functionality is useful for using a single listening socket to serve credentials to multiple consumers. For further information see L documentation.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'ImportCredential', { 'description' => "Pass one or more credentials to the unit. Takes a credential name for which we'll attempt to find a credential that the service manager itself received under the specified name \x{2014} which may be used to propagate credentials from an invoking environment (e.g. a container manager that invoked the service manager) into a service. If the credential name is a glob, all credentials matching the glob are passed to the unit. Matching credentials are searched for in the system credentials, the encrypted system credentials, and under C, C, C, C, C, and C in that order. When multiple credentials of the same name are found, the first one found is used. The globbing expression implements a restrictive subset of L: only a single trailing C<*> wildcard may be specified. Both C and C<[]> wildcards are not permitted, nor are C<*> wildcards anywhere except at the end of the glob expression. Optionally, the credential name or glob may be followed by a colon followed by a rename pattern. If specified, all credentials matching the credential name or glob are renamed according to the given pattern. For example, if C is specified, the service manager will read the C credential and make it available as the C credential to the service. Similarly, if C is specified, the service manager will read all credentials starting with C and make them available as C to the service. If C is specified multiple times and multiple credentials end up with the same name after renaming, the first one is kept and later ones are dropped. When multiple credentials of the same name are found, credentials found by C and C take priority over credentials found by C.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'SetCredential', { 'description' => 'The C setting is similar to C but accepts a literal value to use as data for the credential, instead of a file system path to read the data from. Do not use this option for data that is supposed to be secret, as it is accessible to unprivileged processes via IPC. It\'s only safe to use this for user IDs, public key material and similar non-sensitive data. For everything else use C. In order to embed binary data into the credential data use C-style escaping (i.e. C<\\n> to embed a newline, or C<\\x00> to embed a C byte). The C setting is identical to C but expects an encrypted credential in literal form as value. This allows embedding confidential credentials securely directly in unit files. Use L\' C<-p> switch to generate suitable C lines directly from plaintext credentials. For further details see C above. When multiple credentials of the same name are found, credentials found by C, C and C take priority over credentials found by C. As such, C will act as default if no credentials are found by any of the former. In this case not being able to retrieve the credential from the path specified in C or C is not considered fatal.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'SetCredentialEncrypted', { 'description' => 'The C setting is similar to C but accepts a literal value to use as data for the credential, instead of a file system path to read the data from. Do not use this option for data that is supposed to be secret, as it is accessible to unprivileged processes via IPC. It\'s only safe to use this for user IDs, public key material and similar non-sensitive data. For everything else use C. In order to embed binary data into the credential data use C-style escaping (i.e. C<\\n> to embed a newline, or C<\\x00> to embed a C byte). The C setting is identical to C but expects an encrypted credential in literal form as value. This allows embedding confidential credentials securely directly in unit files. Use L\' C<-p> switch to generate suitable C lines directly from plaintext credentials. For further details see C above. When multiple credentials of the same name are found, credentials found by C, C and C take priority over credentials found by C. As such, C will act as default if no credentials are found by any of the former. In this case not being able to retrieve the credential from the path specified in C or C is not considered fatal.', '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 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::Exec' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Common/Kill.pl000066400000000000000000000142551500217761400277670ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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, 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, only the main process itself is killed (not recommended!). If set to C, no process is killed (strongly recommended against!). 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 empty. Note that it is not recommended to set C to C or even C, as this allows processes to escape the service manager\'s lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources. 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 (applies to C: C)the delay configured via the C has passed (applies to C: C, C, C) 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 C. ', '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 C. ', '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 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::Kill' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Common/ResourceControl.pl000066400000000000000000002421311500217761400322200ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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. 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. Under the unified cgroup hierarchy, CPU accounting is available for all units and this setting has no effect.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'CPUWeight', { 'description' => 'These settings control the C controller in the unified hierarchy. These options accept an integer value or the special string "idle": While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. In addition to the resource allocation performed by the C controller, the kernel may automatically divide resources based on session-id grouping, see "The autogroup feature" in L. The effect of this feature is similar to the C controller with no explicit configuration, so users should be careful to not mistake one for the other.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupCPUWeight', { 'description' => 'These settings control the C controller in the unified hierarchy. These options accept an integer value or the special string "idle": While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. In addition to the resource allocation performed by the C controller, the kernel may automatically divide resources based on session-id grouping, see "The autogroup feature" in L. The effect of this feature is similar to the C controller with no explicit configuration, so users should be careful to not mistake one for the other.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'CPUQuota', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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 L and L. Setting C to an empty value unsets the quota. 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' => 'This setting controls the C controller in the unified hierarchy. 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 L and L. Example: C to request that the CPU quota is measured in periods of 10ms.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'AllowedCPUs', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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 or 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. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupAllowedCPUs', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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 or 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. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryAccounting', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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' => 'These settings control the C controller in the unified hierarchy. Specify the memory usage protection of the executed processes in this unit. When reclaiming memory, the unit is treated as if it was using less memory resulting in memory to be preferentially reclaimed from unprotected units. Using C results in a weaker protection where memory may still be reclaimed to avoid invoking the OOM killer in case there is no other reclaimable memory. For a protection to be effective, it is generally required to set a corresponding allocation on all ancestors, which is then distributed between children (with the exception of the root slice). Any C or C allocation that is not explicitly distributed to specific children is used to create a shared protection for all children. As this is a shared protection, the children will freely compete for the memory. 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 or C control group attribute. For details about this control group attribute, see L. Units may have their children use a default C or C value by specifying C or C, which has the same semantics as C and C, or C which has the same semantics as C. This setting does not affect C or C in the unit itself. Using it to set a default child allocation is only useful on kernels older than 5.7, which do not support the C cgroup2 mount option. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupMemoryLow', { 'description' => 'These settings control the C controller in the unified hierarchy. Specify the memory usage protection of the executed processes in this unit. When reclaiming memory, the unit is treated as if it was using less memory resulting in memory to be preferentially reclaimed from unprotected units. Using C results in a weaker protection where memory may still be reclaimed to avoid invoking the OOM killer in case there is no other reclaimable memory. For a protection to be effective, it is generally required to set a corresponding allocation on all ancestors, which is then distributed between children (with the exception of the root slice). Any C or C allocation that is not explicitly distributed to specific children is used to create a shared protection for all children. As this is a shared protection, the children will freely compete for the memory. 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 or C control group attribute. For details about this control group attribute, see L. Units may have their children use a default C or C value by specifying C or C, which has the same semantics as C and C, or C which has the same semantics as C. This setting does not affect C or C in the unit itself. Using it to set a default child allocation is only useful on kernels older than 5.7, which do not support the C cgroup2 mount option. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryHigh', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The effective configuration is reported as C (see also C). While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupMemoryHigh', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The effective configuration is reported as C (see also C). While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The effective configuration is reported as C (the value is the most stringent limit of the unit and parent slices and it is capped by physical memory). While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupMemoryMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The effective configuration is reported as C (the value is the most stringent limit of the unit and parent slices and it is capped by physical memory). While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemorySwapMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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. Alternatively, a percentage value may be specified, which is taken relative to the specified swap size on the system. If assigned the special value C, no swap limit is applied. These settings control the C control group attribute. For details about this control group attribute, see L. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupMemorySwapMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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. Alternatively, a percentage value may be specified, which is taken relative to the specified swap size on the system. If assigned the special value C, no swap limit is applied. These settings control the C control group attribute. For details about this control group attribute, see L. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryZSwapMax', { 'description' => 'These settings control the C controller in the unified hierarchy. Specify the absolute limit on zswap usage of the processes in this unit. Zswap is a lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. If the limit specified is hit, no entries from this unit will be stored in the pool until existing entries are faulted back or written out to disk. See the kernel\'s L documentation for more details. Takes a size in bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value C, no limit is applied. These settings control the C control group attribute. For details about this control group attribute, see L. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupMemoryZSwapMax', { 'description' => 'These settings control the C controller in the unified hierarchy. Specify the absolute limit on zswap usage of the processes in this unit. Zswap is a lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. If the limit specified is hit, no entries from this unit will be stored in the pool until existing entries are faulted back or written out to disk. See the kernel\'s L documentation for more details. Takes a size in bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value C, no limit is applied. These settings control the C control group attribute. For details about this control group attribute, see L. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'MemoryZSwapWriteback', { 'description' => 'This setting controls the C controller in the unified hierarchy. Takes a boolean argument. When true, pages stored in the Zswap cache are permitted to be written to the backing storage, false otherwise. Defaults to true. This allows disabling writeback of swap pages for IO-intensive applications, while retaining the ability to store compressed pages in Zswap. See the kernel\'s L documentation for more details.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'AllowedMemoryNodes', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 NUMA nodes indices separated by a dash. Setting C or 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. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupAllowedMemoryNodes', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 NUMA nodes indices separated by a dash. Setting C or 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. While C applies to the startup and shutdown phases of the system, C applies to normal runtime of the system, and if the former is not set also to the startup and shutdown phases. Using C allows prioritizing specific services at boot-up and shutdown differently than during normal runtime. This setting is supported only with the unified control group hierarchy.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TasksAccounting', { 'description' => 'This setting controls the C controller in the unified hierarchy. Turn on task accounting for this unit. Takes a boolean argument. If enabled, the kernel will keep track of the total number of tasks in the unit and its children. This number includes both kernel threads and userspace processes, with each thread counted 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' => 'This setting controls the C controller in the unified hierarchy. 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, the L. The effective configuration is reported as C. The system default for this setting may be controlled with C in L.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOAccounting', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'IOWeight', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. A higher weight means more I/O bandwidth, a lower weight means less. While C applies to the startup and shutdown phases of the system, C applies to the later runtime of the system, and if the former is not set also to the startup and shutdown phases. This allows prioritizing specific services at boot-up and shutdown differently than during runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartupIOWeight', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. A higher weight means more I/O bandwidth, a lower weight means less. While C applies to the startup and shutdown phases of the system, C applies to the later runtime of the system, and if the former is not set also to the startup and shutdown phases. This allows prioritizing specific services at boot-up and shutdown differently than during runtime.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IODeviceWeight', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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 L. The specified device node should reference a block device that has an I/O scheduler associated, i.e. should not refer to partition or loopback block devices, but to the originating, physical device. When a path to a regular file or directory is specified it is attempted to discover the correct originating device backing the file system of the specified path. This works correctly only for simpler cases, where the file system is directly placed on a partition or physical block device, or where simple 1:1 encryption using dm-crypt/LUKS is used. This discovery does not cover complex storage and in particular RAID and volume management storage devices.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOReadBandwidthMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. Similar restrictions on block device discovery as for C apply, see above.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOWriteBandwidthMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. Similar restrictions on block device discovery as for C apply, see above.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOReadIOPSMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. Similar restrictions on block device discovery as for C apply, see above.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IOWriteIOPSMax', { 'description' => 'These settings control the C controller in the unified hierarchy. 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 L. Similar restrictions on block device discovery as for C apply, see above.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'IODeviceLatencyTargetSec', { 'description' => 'This setting controls the C controller in the unified hierarchy. 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 L. Implies C. These settings are supported only if the unified control group hierarchy is used. Similar restrictions on block device discovery as for C apply, see above.', '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. Note that this functionality is currently only available for system services, not for per-user services.", 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'IPAddressAllow', { 'description' => "Turn on 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 after a C character. If the suffix is omitted, the address is considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits 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 both 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. The following rules are applied in turn: In order to implement an allow-listing IP firewall, it is recommended to use a C=C 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. Nevertheless, it may make sense to maintain one list more open and the other one more restricted, depending on the use case. 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 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 after a C character. If the suffix is omitted, the address is considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits 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 both 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. The following rules are applied in turn: In order to implement an allow-listing IP firewall, it is recommended to use a C=C 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. Nevertheless, it may make sense to maintain one list more open and the other one more restricted, depending on the use case. 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' }, 'SocketBindAllow', { 'description' => "Configures restrictions on the ability of unit processes to invoke L on a socket. Both allow and deny rules to be defined that restrict which addresses a socket may be bound to. bind-rule describes socket properties such as address-family, transport-protocol and ip-ports. bind-rule := { [address-familyC<:>][transport-protocolC<:>][ip-ports] | C } address-family := { C | C } transport-protocol := { C | C } ip-ports := { ip-port | ip-port-range } An optional address-family expects C or C values. If not specified, a rule will be matched for both IPv4 and IPv6 addresses and applied depending on other socket fields, e.g. transport-protocol, ip-port. An optional transport-protocol expects C or C transport protocol names. If not specified, a rule will be matched for any transport protocol. An optional ip-port value must lie within 1\x{2026}65535 interval inclusively, i.e. dynamic port C<0> is not allowed. A range of sequential ports is described by ip-port-range := ip-port-lowC<->ip-port-high, where ip-port-low is smaller than or equal to ip-port-high and both are within 1\x{2026}65535 inclusively. A special value C can be used to apply a rule to any address family, transport protocol and any port with a positive value. To allow multiple rules assign C or C multiple times. To clear the existing assignments pass an empty C or C assignment. For each of C and C, maximum allowed number of assignments is C<128>. The feature is implemented with C and C cgroup-bpf hooks. Note that these settings apply to any L system call invocation by the unit processes, regardless in which network namespace they are placed. Or in other words: changing the network namespace is not a suitable mechanism for escaping these restrictions on bind(). Examples: \x{2026} # Allow binding IPv6 socket addresses with a port greater than or equal to 10000. [Service] SocketBindAllow=ipv6:10000-65535 SocketBindDeny=any \x{2026} # Allow binding IPv4 and IPv6 socket addresses with 1234 and 4321 ports. [Service] SocketBindAllow=1234 SocketBindAllow=4321 SocketBindDeny=any \x{2026} # Deny binding IPv6 socket addresses. [Service] SocketBindDeny=ipv6 \x{2026} # Deny binding IPv4 and IPv6 socket addresses. [Service] SocketBindDeny=any \x{2026} # Allow binding only over TCP [Service] SocketBindAllow=tcp SocketBindDeny=any \x{2026} # Allow binding only over IPv6/TCP [Service] SocketBindAllow=ipv6:tcp SocketBindDeny=any \x{2026} # Allow binding ports within 10000-65535 range over IPv4/UDP. [Service] SocketBindAllow=ipv4:udp:10000-65535 SocketBindDeny=any \x{2026} ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'SocketBindDeny', { 'description' => "Configures restrictions on the ability of unit processes to invoke L on a socket. Both allow and deny rules to be defined that restrict which addresses a socket may be bound to. bind-rule describes socket properties such as address-family, transport-protocol and ip-ports. bind-rule := { [address-familyC<:>][transport-protocolC<:>][ip-ports] | C } address-family := { C | C } transport-protocol := { C | C } ip-ports := { ip-port | ip-port-range } An optional address-family expects C or C values. If not specified, a rule will be matched for both IPv4 and IPv6 addresses and applied depending on other socket fields, e.g. transport-protocol, ip-port. An optional transport-protocol expects C or C transport protocol names. If not specified, a rule will be matched for any transport protocol. An optional ip-port value must lie within 1\x{2026}65535 interval inclusively, i.e. dynamic port C<0> is not allowed. A range of sequential ports is described by ip-port-range := ip-port-lowC<->ip-port-high, where ip-port-low is smaller than or equal to ip-port-high and both are within 1\x{2026}65535 inclusively. A special value C can be used to apply a rule to any address family, transport protocol and any port with a positive value. To allow multiple rules assign C or C multiple times. To clear the existing assignments pass an empty C or C assignment. For each of C and C, maximum allowed number of assignments is C<128>. The feature is implemented with C and C cgroup-bpf hooks. Note that these settings apply to any L system call invocation by the unit processes, regardless in which network namespace they are placed. Or in other words: changing the network namespace is not a suitable mechanism for escaping these restrictions on bind(). Examples: \x{2026} # Allow binding IPv6 socket addresses with a port greater than or equal to 10000. [Service] SocketBindAllow=ipv6:10000-65535 SocketBindDeny=any \x{2026} # Allow binding IPv4 and IPv6 socket addresses with 1234 and 4321 ports. [Service] SocketBindAllow=1234 SocketBindAllow=4321 SocketBindDeny=any \x{2026} # Deny binding IPv6 socket addresses. [Service] SocketBindDeny=ipv6 \x{2026} # Deny binding IPv4 and IPv6 socket addresses. [Service] SocketBindDeny=any \x{2026} # Allow binding only over TCP [Service] SocketBindAllow=tcp SocketBindDeny=any \x{2026} # Allow binding only over IPv6/TCP [Service] SocketBindAllow=ipv6:tcp SocketBindDeny=any \x{2026} # Allow binding ports within 10000-65535 range over IPv4/UDP. [Service] SocketBindAllow=ipv4:udp:10000-65535 SocketBindDeny=any \x{2026} ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestrictNetworkInterfaces', { 'description' => 'Takes a list of space-separated network interface names. This option restricts the network interfaces that processes of this unit can use. By default processes can only use the network interfaces listed (allow-list). If the first character of the rule is C<~>, the effect is inverted: the processes can only use network interfaces not listed (deny-list). This option can appear multiple times, in which case the network interface names are merged. If the empty string is assigned the set is reset, all prior assignments will have not effect. If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered will take precedence and will dictate the default action (allow vs deny). Then the next occurrences of this option will add or delete the listed network interface names from the set, depending of its type and the default action. The loopback interface ("lo") is not treated in any special way, you have to configure it explicitly in the unit file. Example 1: allow-list RestrictNetworkInterfaces=eth1 RestrictNetworkInterfaces=eth2 Programs in the unit will be only able to use the eth1 and eth2 network interfaces. Example 2: deny-list RestrictNetworkInterfaces=~eth1 eth2 Programs in the unit will be able to use any network interface but eth1 and eth2. Example 3: mixed RestrictNetworkInterfaces=eth1 eth2 RestrictNetworkInterfaces=~eth1 Programs in the unit will be only able to use the eth2 network interface. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'NFTSet', { 'description' => 'This setting provides a method for integrating dynamic cgroup, user and group IDs into firewall rules with L sets. The benefit of using this setting is to be able to use the IDs as selectors in firewall rules easily and this in turn allows more fine grained filtering. NFT rules for cgroup matching use numeric cgroup IDs, which change every time a service is restarted, making them hard to use in systemd environment otherwise. Dynamic and random IDs used by C can be also integrated with this setting. This option expects a whitespace separated list of NFT set definitions. Each definition consists of a colon-separated tuple of source type (one of C, C or C), NFT address family (one of C, C, C, C, C, or C), table name and set name. The names of tables and sets must conform to lexical restrictions of NFT table names. The type of the element used in the NFT filter must match the type implied by the directive (C, C or C) as shown in the table below. When a control group or a unit is realized, the corresponding ID will be appended to the NFT sets and it will be be removed when the control group or unit is removed. systemd only inserts elements to (or removes from) the sets, so the related NFT rules, tables and sets must be prepared elsewhere in advance. Failures to manage the sets will be ignored. If the firewall rules are reinstalled so that the contents of NFT sets are destroyed, command systemctl daemon-reload can be used to refill the sets. Example: [Unit] NFTSet=cgroup:inet:filter:my_service user:inet:filter:serviceuser Corresponding NFT rules: table inet filter { set my_service { type cgroupsv2 } set serviceuser { typeof meta skuid } chain x { socket cgroupv2 level 2 @my_service accept drop } chain y { meta skuid @serviceuser accept drop } } ', '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. If the path BPF_FS_PROGRAM_PATH in C assignment is already being handled by C ingress hook, e.g. C=C:BPF_FS_PROGRAM_PATH, the assignment will be still considered valid and the program will be attached to a cgroup. Same for C path and C hook. 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 use case. 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 C=C) 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. If the path BPF_FS_PROGRAM_PATH in C assignment is already being handled by C ingress hook, e.g. C=C:BPF_FS_PROGRAM_PATH, the assignment will be still considered valid and the program will be attached to a cgroup. Same for C path and C hook. 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 use case. 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 C=C) instead of using this setting.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BPFProgram', { 'description' => 'C allows attaching custom BPF programs to the cgroup of a unit. (This generalizes the functionality exposed via C and C for other hooks.) Cgroup-bpf hooks in the form of BPF programs loaded to the BPF filesystem are attached with cgroup-bpf attach flags determined by the unit. For details about attachment types and flags see L|https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/bpf.h>. Also refer to the general L. The specification of BPF program consists of a pair of BPF program type and program path in the file system, with C<:> as the separator: type:program-path. The BPF program type is equivalent to the BPF attach type used in L It may be one of C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, or C. The specified program path must be an absolute path referencing a BPF program inode in the bpffs file system (which generally means it must begin with C). If a specified program does not exist (i.e. has not been uploaded to the BPF subsystem of the kernel yet), it will not be installed but unit activation will continue (a warning will be printed to the logs). Setting C to an empty value makes previous assignments ineffective. Multiple assignments of the same program type/path pair have the same effect as a single assignment: the program will be attached just once. If BPF C pinned to program-path path is already being handled by C, C assignment will be considered valid and C will be attached to a cgroup. Similarly for C hook and C assignment. BPF programs passed with C are attached to the cgroup of a unit with BPF attach flag C, that allows further attachments of the same type within cgroup hierarchy topped by the unit cgroup. Examples: BPFProgram=egress:/sys/fs/bpf/egress-hook BPFProgram=bind6:/sys/fs/bpf/sock-addr-hook ', '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 nodes by the unit (mknod), respectively. This functionality is implemented using eBPF filtering. When access to all physical devices should be disallowed, C may be used instead. See L. 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 allow-list 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 allow lists 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 allow list. In order to work around this limitation, consider extending service units with a pair of After=modprobe\@xyz.service and Wants=modprobe\@xyz.service lines that load the necessary kernel module implementing the device group if missing. Example: \x{2026} [Unit] Wants=modprobe\@loop.service After=modprobe\@loop.service [Service] 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 at the level of the unit\'s control group and above (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 (possibly empty) 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. Assigning the empty string will enable delegation, but reset the list of controllers, and all assignments prior to this will have no effect. Note that additional controllers other than the ones specified might be made available as well, depending on configuration of the containing slice unit or other units contained in it. 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. 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. Note that because of the hierarchical nature of cgroup hierarchy, any controllers that are delegated will be enabled for the parent and sibling units of the unit with delegation. For further details on the delegation model consult L.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'DelegateSubgroup', { 'description' => 'Place unit processes in the specified subgroup of the unit\'s control group. Takes a valid control group name (not a path!) as parameter, or an empty string to turn this feature off. Defaults to off. The control group name must be usable as filename and avoid conflicts with the kernel\'s control group attribute files (i.e. C is not an acceptable name, since the kernel exposes a native control group attribute file by that name). This option has no effect unless control group delegation is turned on via C, see above. Note that this setting only applies to "main" processes of a unit, i.e. for services to C, but not for C and similar. If delegation is enabled, the latter are always placed inside a subgroup named C<.control>. The specified subgroup is automatically created (and potentially ownership is passed to the unit\'s configured user/group) when a process is started in it. This option is useful to avoid manually moving the invoked process into a subgroup after it has been started. Since no processes should live in inner nodes of the control group tree it\'s almost always necessary to run the main ("supervising") process of a unit that has delegation turned on in a subgroup.', '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 configuration in child units from being able to implicitly or explicitly enable a controller. Defaults to empty. 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. It may not be possible to disable a controller after units have been started, 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.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ManagedOOMSwap', { 'choice' => [ 'auto', 'kill' ], 'description' => 'Specifies how L will act on this unit\'s cgroups. Defaults to C. When set to C, the unit becomes a candidate for monitoring by systemd-oomd. If the cgroup passes the limits set by L or the unit configuration, systemd-oomd will select a descendant cgroup and send C to all of the processes under it. You can find more details on candidates and kill behavior at L and L. Setting either of these properties to C will also result in C and C dependencies on C unless C. When set to C, systemd-oomd will not actively use this cgroup\'s data for monitoring and detection. However, if an ancestor cgroup has one of these properties set to C, a unit with C can still be a candidate for systemd-oomd to terminate.', 'type' => 'leaf', 'value_type' => 'enum' }, 'ManagedOOMMemoryPressure', { 'choice' => [ 'auto', 'kill' ], 'description' => 'Specifies how L will act on this unit\'s cgroups. Defaults to C. When set to C, the unit becomes a candidate for monitoring by systemd-oomd. If the cgroup passes the limits set by L or the unit configuration, systemd-oomd will select a descendant cgroup and send C to all of the processes under it. You can find more details on candidates and kill behavior at L and L. Setting either of these properties to C will also result in C and C dependencies on C unless C. When set to C, systemd-oomd will not actively use this cgroup\'s data for monitoring and detection. However, if an ancestor cgroup has one of these properties set to C, a unit with C can still be a candidate for systemd-oomd to terminate.', 'type' => 'leaf', 'value_type' => 'enum' }, 'ManagedOOMMemoryPressureLimit', { 'description' => 'Overrides the default memory pressure limit set by L for the cgroup of this unit. Takes a percentage value between 0% and 100%, inclusive. Defaults to 0%, which means to use the default set by L. This property is ignored unless C=C. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ManagedOOMMemoryPressureDurationSec', { 'description' => "Overrides the default memory pressure duration set by L for the cgroup of this unit. The specified value supports a time unit such as C or C<\x{3bc}s>, see L for details on the permitted syntax. Must be set to either empty or a value of at least 1s. Defaults to empty, which means to use the default set by L. This property is ignored unless C=C. ", 'type' => 'leaf', 'value_type' => 'uniline' }, 'ManagedOOMPreference', { 'choice' => [ 'avoid', 'none', 'omit' ], 'description' => 'Allows deprioritizing or omitting this unit\'s cgroup as a candidate when systemd-oomd needs to act. Requires support for extended attributes (see L) in order to use C or C. When calculating candidates to relieve swap usage, systemd-oomd will only respect these extended attributes if the unit\'s cgroup is owned by root. When calculating candidates to relieve memory pressure, systemd-oomd will only respect these extended attributes if the unit\'s cgroup is owned by root, or if the unit\'s cgroup owner, and the owner of the monitored ancestor cgroup are the same. For example, if systemd-oomd is calculating candidates for C<-.slice>, then extended attributes set on descendants of C will be ignored because the descendants are owned by UID 1000, and C<-.slice> is owned by UID 0. But, if calculating candidates for C, then extended attributes set on the descendants would be respected. If this property is set to C, the service manager will convey this to systemd-oomd, which will only select this cgroup if there are no other viable candidates. If this property is set to C, the service manager will convey this to systemd-oomd, which will ignore this cgroup as a candidate and will not perform any actions on it. It is recommended to use C and C sparingly, as it can adversely affect systemd-oomd\'s kill behavior. Also note that these extended attributes are not applied recursively to cgroups under this unit\'s cgroup. Defaults to C which means systemd-oomd will rank this unit\'s cgroup as defined in L and L. ', 'type' => 'leaf', 'value_type' => 'enum' }, 'MemoryPressureWatch', { 'choice' => [ 'auto', 'no', 'skip', 'yes' ], 'description' => 'Controls memory pressure monitoring for invoked processes. Takes a boolean or one of C and C. If C, tells the service not to watch for memory pressure events, by setting the C<$MEMORY_PRESSURE_WATCH> environment variable to the literal string C. If C, tells the service to watch for memory pressure events. This enables memory accounting for the service, and ensures the C cgroup attribute file is accessible for reading and writing by the service\'s user. It then sets the C<$MEMORY_PRESSURE_WATCH> environment variable for processes invoked by the unit to the file system path to this file. The threshold information configured with C is encoded in the C<$MEMORY_PRESSURE_WRITE> environment variable. If the C value is set the protocol is enabled if memory accounting is anyway enabled for the unit, and disabled otherwise. If set to C the logic is neither enabled, nor disabled and the two environment variables are not set. Note that services are free to use the two environment variables, but it\'s unproblematic if they ignore them. Memory pressure handling must be implemented individually in each service, and usually means different things for different software. For further details on memory pressure handling see L. Services implemented using L may use L to watch for and handle memory pressure events. If not explicit set, defaults to the C setting in L.', 'replace' => { '0' => 'no', '1' => 'yes', 'false' => 'no', 'true' => 'yes' }, 'type' => 'leaf', 'value_type' => 'enum' }, 'MemoryPressureThresholdSec', { 'description' => "Sets the memory pressure threshold time for memory pressure monitor as configured via C. Specifies the maximum allocation latency before a memory pressure event is signalled to the service, per 2s window. If not specified defaults to the C setting in L (which in turn defaults to 200ms). The specified value expects a time unit such as C or C<\x{3bc}s>, see L for details on the permitted syntax.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'CoredumpReceive', { 'description' => 'Takes a boolean argument. This setting is used to enable coredump forwarding for containers that belong to this unit\'s cgroup. Units with C must also be configured with C. Defaults to false. When systemd-coredump is handling a coredump for a process from a container, if the container\'s leader process is a descendant of a cgroup with C and C, then systemd-coredump will attempt to forward the coredump to systemd-coredump within the container. See also L.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] } ], 'generated_by' => 'parse-man.pl from systemd 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Common::ResourceControl' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/000077500000000000000000000000001500217761400267045ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/Install.pl000066400000000000000000000162161500217761400306550ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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/>, C<.requires/>, or C<.upholds/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect of a dependency of type C, C, or C being added from the listed unit to the current unit. See the description of the mentioned dependency types in the [Unit] section for details. In case of template units listing non template units, the listing unit must have C set, or systemctl enable must be called with an instance name. The instance (default or specified) will be added to the C<.wants/>, C<.requires/>, or C<.upholds/> list of the listed unit. For example, WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. This also applies to listing specific instances of templated units: this specific instance will gain the dependency. A template unit may also list a template unit, in which case a generic dependency will be added where each instance of the listing unit will have a dependency on an instance of the listed template with the same instance value. For example, WantedBy=container@.target in a service C will result in systemctl enable monitor@.service creating a C link to C, which applies to all instances of 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/>, C<.requires/>, or C<.upholds/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect of a dependency of type C, C, or C being added from the listed unit to the current unit. See the description of the mentioned dependency types in the [Unit] section for details. In case of template units listing non template units, the listing unit must have C set, or systemctl enable must be called with an instance name. The instance (default or specified) will be added to the C<.wants/>, C<.requires/>, or C<.upholds/> list of the listed unit. For example, WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. This also applies to listing specific instances of templated units: this specific instance will gain the dependency. A template unit may also list a template unit, in which case a generic dependency will be added where each instance of the listing unit will have a dependency on an instance of the listed template with the same instance value. For example, WantedBy=container@.target in a service C will result in systemctl enable monitor@.service creating a C link to C, which applies to all instances of C.', 'type' => 'list' }, 'UpheldBy', { '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/>, C<.requires/>, or C<.upholds/> directory of each of the listed units when this unit is installed by systemctl enable. This has the effect of a dependency of type C, C, or C being added from the listed unit to the current unit. See the description of the mentioned dependency types in the [Unit] section for details. In case of template units listing non template units, the listing unit must have C set, or systemctl enable must be called with an instance name. The instance (default or specified) will be added to the C<.wants/>, C<.requires/>, or C<.upholds/> list of the listed unit. For example, WantedBy=getty.target in a service C will result in systemctl enable getty@tty2.service creating a C link to C. This also applies to listing specific instances of templated units: this specific instance will gain the dependency. A template unit may also list a template unit, in which case a generic dependency will be added where each instance of the listing unit will have a dependency on an instance of the listed template with the same instance value. For example, WantedBy=container@.target in a service C will result in systemctl enable monitor@.service creating a C link to C, which applies to all instances of 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' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/Service.pl000066400000000000000000001475201500217761400306520ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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 [Unit] and [Install] sections. The service specific configuration options are configured in the [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 SysV init compat is enabled, systemd automatically creates service units that wrap SysV init scripts (the service name is the same as the name of the script, with a C<.service> suffix added); see L. 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 mechanism via which the service notifies the manager that the service start-up has finished. One of C, C, C, C, C, C, C, or C: It is recommended to use C=C for long-running services, as it ensures that process setup errors (e.g. errors such as a missing service executable, or missing user) are properly tracked. However, as this service type won't propagate the failures in the service's own startup code (as opposed to failures in the preparatory steps the service manager executes before execve()) and doesn't allow ordering of other units against completion of initialization of the service code itself (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, 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/C service types require 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 heavy-weight UNIX service start-up protocol. Note that using any type other than C possibly delays the boot process, as the service manager needs to wait for at least some service initialization to complete. (Also note it is generally not recommended to use C or C for long-running services.) Note that various service settings (e.g. C, C through libc NSS) might result in \"hidden\" blocking IPC calls to other services when used. Sometimes it might be advisable to use the C service type to ensure that the service manager's transaction logic is not affected by such potentially slow operations and hidden dependencies, as this is the only service type where the service manager will not wait for such service execution setup operations to complete before proceeding.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'ExitType', { 'description' => 'Specifies when the manager should consider the service to be finished. One of C
or C: It is generally recommended to use C=C
when a service has a known forking model and a main process can reliably be determined. C=C is meant for applications whose forking model is not known ahead of time and which might not have a specific main process. It is well suited for transient or automatically generated services, such as graphical applications inside of a desktop environment.', '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. Note that PID files should be avoided in modern projects. Use C, C or C where possible, which does not require use of PID files to determine the main process of a service and avoids needless forking.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'BusName', { 'description' => 'Takes a D-Bus destination name that this service shall use. This option is mandatory for services where C is set to C. It is recommended to always set this property if known to make it easy to map the service name to the D-Bus destination. In particular, systemctl service-log-level/service-log-target verbs make use of this.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ExecStart', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Commands that are executed when this service is started. Unless C is C, exactly one command must be given. When C is used, this setting may be used multiple times to define multiple commands to execute. 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.) If more than one command is configured, 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. Multiple command lines are allowed, regardless of the service type (i.e. C), 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/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. Note that the execution of C is taken into account for the purpose of C/C ordering constraints.', '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. Multiple command lines are allowed, regardless of the service type (i.e. C), 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/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. Note that the execution of C is taken into account for the purpose of C/C ordering constraints.', 'type' => 'list' }, 'ExecCondition', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Optional commands that are executed before the commands in C. Syntax is the same as for C. Multiple command lines are allowed, regardless of the service type (i.e. C), 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 commands. 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: ExecReload=kill -HUP $MAINPID Note however that reloading a daemon by enqueuing a signal (as with the example line above) is usually not a good choice, because this is an asynchronous operation and hence not suitable when ordering reloads of multiple services against each other. It is thus strongly recommended to either use C=C in place of C, or to set C to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete. For example, L uses the following: ExecReload=busctl call org.freedesktop.DBus \\ /org/freedesktop/DBus org.freedesktop.DBus \\ ReloadConfig ', '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 likely exited 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. Note that the execution of C is taken into account for the purpose of C/C ordering constraints.", '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' }, 'RestartSteps', { 'description' => 'Configures the number of steps to take to increase the interval of auto-restarts from C to C. Takes a positive integer or 0 to disable it. Defaults to 0. This setting is effective only if C is also set.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'RestartMaxDelaySec', { 'description' => 'Configures the longest time to sleep before restarting a service as the interval goes up with C. Takes a value in the same format as C, or C to disable the setting. Defaults to C. This setting is effective only if C is also set.', '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. The precise action depends on the C option. 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 set in the manager, except when C is used, in which case the timeout is disabled by default (see L). If a service of C/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 extended 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). Note that the start timeout is also applied to service reloads, regardless if implemented through C or via the reload logic enabled via C. If the reload does not complete within the configured time, the reload will be considered failed and the service will continue running with the old configuration. This will not affect the running service, but will be logged and will cause e.g. systemctl reload to fail.", '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. This default behavior can be changed by the C option. 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/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 extended 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/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 extended 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' }, 'TimeoutStartFailureMode', { 'choice' => [ 'abort', 'kill', 'terminate' ], 'description' => 'These options configure the action that is taken in case a daemon service does not signal start-up within its configured C, respectively if it does not stop within C. Takes one of C, C and C. Both options default to C. If C is set the service will be gracefully terminated by sending the signal specified in C (defaults to C, see L). If the service does not terminate the C is sent after C. If C is set, C is sent instead and C applies before sending C. This setting may be used to analyze services that fail to start-up or shut-down intermittently. By using C the service is immediately terminated by sending C without any further timeout. This setting can be used to expedite the shutdown of failing services. ', 'type' => 'leaf', 'value_type' => 'enum' }, 'TimeoutStopFailureMode', { 'choice' => [ 'abort', 'kill', 'terminate' ], 'description' => 'These options configure the action that is taken in case a daemon service does not signal start-up within its configured C, respectively if it does not stop within C. Takes one of C, C and C. Both options default to C. If C is set the service will be gracefully terminated by sending the signal specified in C (defaults to C, see L). If the service does not terminate the C is sent after C. If C is set, C is sent instead and C applies before sending C. This setting may be used to analyze services that fail to start-up or shut-down intermittently. By using C the service is immediately terminated by sending C without any further timeout. This setting can be used to expedite the shutdown of failing services. ', 'type' => 'leaf', 'value_type' => 'enum' }, '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 (use C to limit their activation). Pass C (the default) to configure no runtime limit. If a service of C/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 extended 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' }, 'RuntimeRandomizedExtraSec', { 'description' => 'This option modifies C by increasing the maximum runtime by an evenly distributed duration between 0 and the specified value (in seconds). If C is unspecified, then this feature will be disabled. ', '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' => [ 'always', 'no', 'on-abnormal', 'on-abort', 'on-failure', 'on-success', 'on-watchdog' ], '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 any of the following: exit code of 0;for types other than C, one of the signals C, C, C, or C; 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. Note that C services will never be restarted on a clean exit status, i.e. C and C are rejected for them. 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. 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' }, 'RestartMode', { 'description' => 'Takes a string value that specifies how a service should restart: If set to C (the default), the service restarts by going through a failed/inactive state.If set to C, the service transitions to the activating state directly during auto-restart, skipping failed/inactive state. C is still invoked. C and C are skipped.This option is useful in cases where a dependency can fail temporarily but we don\'t want these temporary failures to make the dependent units fail. Dependent units are not notified of these temporary failures.If set to C, the service manager will log messages that are related to this unit at debug level while automated restarts are attempted, until either the service hits the rate limit or it succeeds, and the C<$DEBUG_INVOCATION=1> environment variable will be set for the unit. This is useful to be able to get additional information when a service fails to start, without needing to proactively or permanently enable debug level logging in systemd, which is very verbose. This is otherwise equivalent to C mode.', 'type' => 'leaf', 'value_type' => 'uniline' }, '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 status 0 and, except for C, the signals C, C, C, and C. Exit status definitions can be numeric termination statuses, termination status names, or termination signal names, separated by spaces. See the Process Exit Codes section in L for a list of termination status names (for this setting only the part without the C or C prefix should be used). See L for a list of signal names. Note that this setting does not change the mapping between numeric exit statuses and their names, i.e. regardless how this setting is used 0 will still be mapped to C (and thus typically shown as C<0/SUCCESS> in tool outputs) and 1 to C (and thus typically shown as C<1/FAILURE>), and so on. It only controls what happens as effect of these exit statuses, and how it propagates to the state of the service as a whole. 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-status may be used to list exit statuses and translate between numerical status 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 be numeric termination statuses, termination status names, or termination signal names, separated by spaces. Defaults to the empty list, so that, by default, no exit status is excluded from the configured restart logic. A service with the C setting RestartPreventExitStatus=TEMPFAIL 250 SIGKILL Exit status 75 (C), 250, 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. Note that for C services, a success exit status will prevent them from auto-restarting, no matter whether the corresponding exit statuses are listed in this option or not.', '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. Note that if the same socket unit is configured to be passed to multiple service units (via the C setting, see below), and these services have different C configurations, the precise state of C depends on the order in which these services are invoked, and will possibly change after service code already took possession of the socket file descriptor, simply because the C state of a socket is shared by all file descriptors referencing it. Hence it is essential that all services sharing the same socket use the same C configuration, and do not change the flag in service code either.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'NotifyAccess', { 'choice' => [ 'all', 'exec', 'main', 'none' ], '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/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 C=C is set for it. Hence, to eliminate all race conditions involving lookup of the client\'s unit and attribution of notifications to units correctly, sd_notify_barrier() may be used. This call acts as a synchronization point and ensures all notifications sent before this call have been picked up by the service manager when it returns successfully. Use of sd_notify_barrier() is needed for clients which are not invoked by the service manager, otherwise this synchronization mechanism is unnecessary for attribution of notifications to the unit.', '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 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 (see L for details about the precise protocol used and the order in which the file descriptors are passed). 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 (the latter can be tweaked with C, see below). 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
. The fdstore command of L may be used to list the current contents of a service\'s file descriptor store. Note that the service manager will only pass file descriptors contained in the file descriptor store to the service\'s own processes, never to other clients via IPC or similar. However, it does allow unprivileged clients to query the list of currently open file descriptors of a service. Sensitive data may hence be safely placed inside the referenced files, but should not be attached to the metadata (e.g. included in filenames) of the stored file descriptors. If this option is set to a non-zero value the C<$FDSTORE> environment variable will be set for processes invoked for this service. See L for details. For further information on the file descriptor store see the L overview.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FileDescriptorStorePreserve', { 'choice' => [ 'no', 'restart', 'yes' ], 'description' => "Takes one of C, C, C and controls when to release the service's file descriptor store (i.e. when to close the contained file descriptors, if any). If set to C the file descriptor store is automatically released when the service is stopped; if C (the default) it is kept around as long as the unit is neither inactive nor failed, or a job is queued for the service, or the service is expected to be restarted. If C the file descriptor store is kept around until the unit is removed from memory (i.e. is not referenced anymore and inactive). The latter is useful to keep entries in the file descriptor store pinned until the service manager exits. Use systemctl clean --what=fdstore \x{2026} to release the file descriptor store explicitly.", 'type' => 'leaf', 'value_type' => 'enum' }, 'USBFunctionDescriptors', { 'description' => 'Configure the location of a file containing L 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) killing policy for the kernel and the userspace OOM killer L. On Linux, when memory becomes scarce to the point that the kernel has trouble allocating memory for itself, it might decide to kill a running process in order to free up memory and reduce memory pressure. Note that C is a more flexible solution that aims to prevent out-of-memory situations for the userspace too, not just the kernel, by attempting to terminate services earlier, before the kernel would have to act. This setting takes one of C, C or C. If set to C and a process in the unit is killed by the OOM killer, this is logged but the unit continues running. If set to C the event is logged but the unit is terminated cleanly by the service manager. If set to C and one of the unit\'s processes is killed by the OOM killer the kernel is instructed to kill all remaining processes of the unit too, by setting the C attribute to C<1>; also see kernel page L. Defaults to the setting C in L is set to, except for units 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. This setting also applies to L. Similarly to the kernel OOM kills performed by the kernel, this setting determines the state of the unit after systemd-oomd kills a cgroup associated with it.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OpenFile', { 'description' => 'Takes an argument of the form C, where: C is a path to a file or an C socket in the file system;C is a name that will be associated with the file descriptor; the name may contain any ASCII character, but must exclude control characters and ":", and must be at most 255 characters in length; it is optional and, if not provided, defaults to the file name;C is a comma-separated list of access options; possible values are C, C, C, C; if not specified, files will be opened in C mode; if C is specified, errors during file/socket opening are ignored. Specifying the same option several times is treated as an error. The file or socket is opened by the service manager and the file descriptor is passed to the service. If the path is a socket, we call connect() on it. See L for more details on how to retrieve these file descriptors. This setting is useful to allow services to access files/sockets that they can\'t access themselves (due to running in a separate mount namespace, not having privileges, ...). This setting can be specified multiple times, in which case all the specified paths are opened and the file descriptors passed to the service. If the empty string is assigned, the entire list of open files defined prior to this is reset.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ReloadSignal', { 'description' => 'Configures the UNIX process signal to send to the service\'s main process when asked to reload the service\'s configuration. Defaults to C. This option has no effect unless C=C is used, see above.', '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' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/ServiceUnit.pl000066400000000000000000000247011500217761400315050ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => '$unknown_param_msg' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', 'migrate_from' => { 'formula' => '$service', 'variables' => { 'service' => '- - Service FailureAction' } }, 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', '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 span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', '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 span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', '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' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/Socket.pl000066400000000000000000001373571500217761400305110ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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 [Unit] and [Install] sections. The socket specific configuration options are configured in the [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 about the precise protocol used and the order in which the file descriptors are passed) or via 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 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 C, it is interpreted as IPv4 address v.w.x.y and port z. If the address string is a string in the format C<[x]:y>, it is interpreted as IPv6 address x and port y. An optional interface scope (interface name or number) may be specified after a C<%> symbol: C<[x]:y%dev>. Interface scopes are only useful with link-local addresses, because the kernel ignores them in other cases. Note that if an address is specified as IPv6, it might still 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 x on a port y 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. C may be replaced with C, C or C to force usage of the corresponding socket type. 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 C, it is interpreted as IPv4 address v.w.x.y and port z. If the address string is a string in the format C<[x]:y>, it is interpreted as IPv6 address x and port y. An optional interface scope (interface name or number) may be specified after a C<%> symbol: C<[x]:y%dev>. Interface scopes are only useful with link-local addresses, because the kernel ignores them in other cases. Note that if an address is specified as IPv6, it might still 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 x on a port y 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. C may be replaced with C, C or C to force usage of the corresponding socket type. 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 C, it is interpreted as IPv4 address v.w.x.y and port z. If the address string is a string in the format C<[x]:y>, it is interpreted as IPv6 address x and port y. An optional interface scope (interface name or number) may be specified after a C<%> symbol: C<[x]:y%dev>. Interface scopes are only useful with link-local addresses, because the kernel ignores them in other cases. Note that if an address is specified as IPv6, it might still 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 x on a port y 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. C may be replaced with C, C or C to force usage of the corresponding socket type. 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 (see L for details) 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 (see L for details). This expects a valid message queue name (i.e. beginning with C). 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 L endpoints location to listen on, for implementation of USB gadget functions. This expects an absolute file system path of a 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' => [ 'mptcp', 'sctp', 'udplite' ], 'description' => 'Takes one of C, C or C. The socket will use the UDP-Lite (C), SCTP (C) or MPTCP (C) protocol, respectively.', 'type' => 'leaf', 'value_type' => 'enum' }, 'BindIPv6Only', { 'choice' => [ 'both', 'default', '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 32-bit 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 4294967295. Note that this value is silently capped by the C sysctl, which typically defaults to 4096, so typically the sysctl is the setting that actually matters.', '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 C socket option (see L for details). If this option is used, an implicit dependency from this socket unit on the network interface device unit is created (see L). 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 C sockets, FIFO nodes, and message queues 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 C sockets, FIFO nodes, and message queues 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, FIFO, or message queue, 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 yes, a service instance is spawned for each incoming connection and only the connection socket is passed to it. If no, 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. Note that depending on this setting the services activated by units of this type are either regular services (in case of C=C) or instances of templated services (in case of C=C). See the Description section above for a more detailed discussion of the naming rules of triggered services. For IPv4 and IPv6 connections, the C<$REMOTE_ADDR> environment variable will contain the remote IP address, and C<$REMOTE_PORT> will contain the remote port. This is the same as the format used by CGI. For C, the port is the IP protocol. For C socket connections, the C<$REMOTE_ADDR> environment variable will contain either the remote socket\'s file system path starting with a slash (C) or its address in the abstract namespace starting with an at symbol (C<@>). If the socket is unnamed, C<$REMOTE_ADDR> won\'t be set. It is recommended to set C for service instances activated via C, to ensure that failed connection services are cleaned up and released from memory, and do not accumulate.', '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' ] }, 'FlushPending', { 'description' => 'Takes a boolean argument. May only be used when C. If yes, the socket\'s buffers are cleared after the triggered service exited. This causes any pending data to be flushed and any pending incoming connections to be rejected. If no, the socket\'s buffers won\'t be cleared, permitting the service to handle any pending connections after restart, which is the usually expected behaviour. Defaults to C. ', '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 (in case of IPv4/IPv6), per source CID (in case of C), or source UID (in case of C). This is very similar to the C directive above. Defaults to 0, i.e. disabled.', '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 C socket option (see L and the L 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 L for details.) Default value is 7200 seconds (2 hours).', 'type' => 'leaf', 'upstream_default' => '7200', 'value_type' => 'integer' }, 'KeepAliveIntervalSec', { 'description' => 'Takes time (in seconds) as argument between individual keepalive probes, if the socket option C has been set on this socket. This controls the C socket option (see L and the L for details.) Default value is 75 seconds.', 'type' => 'leaf', 'upstream_default' => '75', '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 L for details.) Default value is 9.', 'type' => 'leaf', 'upstream_default' => '9', '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 C 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 C and C 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 C and C 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 C 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 C/C 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 C 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 C 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 L 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 L 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 L 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 applies only when activated service is passed in single socket file descriptor, i.e. service instances that have standard input connected to a socket or services triggered by exactly one socket unit. 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 C/C 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 C/C socket option. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Broadcast', { 'description' => 'Takes a boolean value. This controls the C 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 C 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 C 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' ] }, 'PassPacketInfo', { 'description' => 'Takes a boolean value. This controls the C, C, C or C socket options, which enable reception of additional per-packet metadata as ancillary message, on C, C, C and C sockets. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'Timestamping', { 'choice' => [ 'ns', 'nsec', 'off', 'us', 'usec', "\x{3bc}s" ], 'description' => "Takes one of C, C (alias: C, C<\x{3bc}s>) or C (alias: C). This controls the C or C socket options, and enables whether ingress network traffic shall carry timestamping metadata. Defaults to C.", 'type' => 'leaf', 'value_type' => 'enum' }, 'TCPCongestion', { 'description' => 'Takes a string value. Controls the TCP congestion algorithm used by this socket. Should be one of C, C, C, C 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 C 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) when C, C otherwise.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'TriggerLimitIntervalSec', { 'description' => "Configures a limit on how often this socket unit may be activated within a specific time interval. The C setting 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. Compare with C/C described below, which implements a temporary slowdown if a socket unit is flooded with incoming traffic, as opposed to the permanent failure state C/C results in.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'TriggerLimitBurst', { 'description' => "Configures a limit on how often this socket unit may be activated within a specific time interval. The C setting 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. Compare with C/C described below, which implements a temporary slowdown if a socket unit is flooded with incoming traffic, as opposed to the permanent failure state C/C results in.", 'type' => 'leaf', 'value_type' => 'uniline' }, 'PollLimitIntervalSec', { 'description' => 'Configures a limit on how often polling events on the file descriptors backing this socket unit will be considered. This pair of settings is similar to C/C but instead of putting a (fatal) limit on the activation frequency puts a (transient) limit on the polling frequency. The expected parameter syntax and range are identical to that of the aforementioned options, and can be disabled the same way. If the polling limit is hit polling is temporarily disabled on it until the specified time window passes. The polling limit hence slows down connection attempts if hit, but unlike the trigger limit won\'t cause permanent failures. It\'s the recommended mechanism to deal with DoS attempts through packet flooding. The polling limit is enforced per file descriptor to listen on, as opposed to the trigger limit which is enforced for the entire socket unit. This distinction matters for socket units that listen on multiple file descriptors (i.e. have multiple C stanzas). These setting defaults to 150 (in case of C) and 15 (otherwise) polling events per 2s. This is considerably lower than the default values for the trigger limit (see above) and means that the polling limit should typically ensure the trigger limit is never hit, unless one of them is reconfigured or disabled.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PollLimitBurst', { 'description' => 'Configures a limit on how often polling events on the file descriptors backing this socket unit will be considered. This pair of settings is similar to C/C but instead of putting a (fatal) limit on the activation frequency puts a (transient) limit on the polling frequency. The expected parameter syntax and range are identical to that of the aforementioned options, and can be disabled the same way. If the polling limit is hit polling is temporarily disabled on it until the specified time window passes. The polling limit hence slows down connection attempts if hit, but unlike the trigger limit won\'t cause permanent failures. It\'s the recommended mechanism to deal with DoS attempts through packet flooding. The polling limit is enforced per file descriptor to listen on, as opposed to the trigger limit which is enforced for the entire socket unit. This distinction matters for socket units that listen on multiple file descriptors (i.e. have multiple C stanzas). These setting defaults to 150 (in case of C) and 15 (otherwise) polling events per 2s. This is considerably lower than the default values for the trigger limit (see above) and means that the polling limit should typically ensure the trigger limit is never hit, unless one of them is reconfigured or disabled.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PassFileDescriptorsToExec', { 'description' => 'Takes a boolean argument. Defaults to off. If enabled, file descriptors created by the socket unit are passed to C, C, and C commands from the socket unit. The passed file descriptors can be accessed with L as if the commands were invoked from the associated service units. Note that C command cannot access socket file descriptors.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] } ], 'generated_by' => 'parse-man.pl from systemd 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Socket' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/SocketUnit.pl000066400000000000000000000230461500217761400313360ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => '$unknown_param_msg' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', 'type' => 'leaf', 'value_type' => 'enum' }, 'StartLimitBurst', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitIntervalSec', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', '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' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/Timer.pl000066400000000000000000000555271500217761400303370ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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 [Unit] and [Install] sections. The timer specific configuration options are configured in the [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. Target units, which by default do not deactivate on their own, can be activated repeatedly by timers by setting C on them. This will cause a target unit to be stopped immediately after its activation, if it is not a dependency of another running unit. 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 generally pauses, too. Note that if C is used, a different monotonic clock is selected that continues to advance while the system is suspended and thus can be used as the trigger to resume the system. 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 generally pauses, too. Note that if C is used, a different monotonic clock is selected that continues to advance while the system is suspended and thus can be used as the trigger to resume the system. 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 generally pauses, too. Note that if C is used, a different monotonic clock is selected that continues to advance while the system is suspended and thus can be used as the trigger to resume the system. 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 generally pauses, too. Note that if C is used, a different monotonic clock is selected that continues to advance while the system is suspended and thus can be used as the trigger to resume the system. 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 generally pauses, too. Note that if C is used, a different monotonic clock is selected that continues to advance while the system is suspended and thus can be used as the trigger to resume the system. 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. Note that calendar timers might be triggered at unexpected times if the system\'s realtime clock is not set correctly. Specifically, on systems that lack a battery-buffered Realtime Clock (RTC) it might be wise to enable C to ensure the clock is adjusted to a network time source before the timer event is set up. Timer units with at least one C expression are automatically ordered after C, which C is ordered before. When a system is temporarily put to sleep (i.e. system suspend or hibernation) the realtime clock does not pause. When a calendar timer elapses while the system is sleeping it will not be acted on immediately, but once the system is later resumed it will catch up and process all timers that triggered while the system was sleeping. Note that if a calendar timer elapsed more than once while the system was continuously sleeping the timer will only result in a single service activation. If C (see below) is enabled a calendar time event elapsing while the system is suspended will cause the system to wake up (under the condition the system\'s hardware supports time-triggered wake-up functionality).', '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. Note that this setting is primarily a power saving option that allows coalescing CPU wake-ups. It should not be confused with C (see below) which adds a random value to the time the timer shall elapse next and whose purpose is the opposite: to stretch elapsing of timer events over a longer period to reduce workload spikes. For further details and explanations and how both settings play together, see below.', '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, unless modified with C, see below. This setting is useful to stretch dispatching of similarly configured timer events over a certain time interval, to prevent them from firing all 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, while this setting does the opposite: it stretches timer events over an interval, 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 1 minute and C to 0, thus encouraging coalescing of timer events. In order to optimally stretch timer events over a certain range of time, set C and C to some higher value. ', 'type' => 'leaf', 'value_type' => 'uniline' }, 'FixedRandomDelay', { 'description' => 'Takes a boolean argument. When enabled, the randomized offset specified by C is reused for all firings of the same timer. For a given timer unit, the offset depends on the machine ID, user identifier and timer name, which means that it is stable between restarts of the manager. This effectively creates a fixed offset for an individual timer, reducing the jitter in firings of this timer, while still avoiding firing at the same time as other similarly configured timers. This setting has no effect if C is set to 0. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'DeferReactivation', { 'description' => 'Takes a boolean argument. When enabled, the timer schedules the next elapse based on the trigger unit entering inactivity, instead of the last trigger time. This is most apparent in the case where the service unit takes longer to run than the timer interval. With this setting enabled, the timer will schedule the next elapse based on when the service finishes running, and so it will have to wait until the next realtime elapse time to trigger. Otherwise, the default behavior is for the timer unit to immediately trigger again once the service finishes running. This happens because the timer schedules the next elapse based on the previous trigger time, and since the interval is shorter than the service runtime, that elapse will be in the past, causing it to immediately trigger once done. This setting has no effect if a realtime timer has not been specified with C. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, '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 C.', '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 C.', '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. Such triggering is nonetheless subject to the delay imposed by C. 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. Note that behaviour of monotonic clock timers (as configured with C, C, C, C, C, see above) is altered depending on this option. If false, a monotonic clock is used that is paused during system suspend (C), if true a different monotonic clock is used that continues advancing during system suspend (C), see L for details.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] }, 'RemainAfterElapse', { 'description' => 'Takes a boolean argument. If true, a timer will stay loaded, and its state remains queryable even after it elapsed and the associated unit (as configured with C, see above) deactivated again. If false, an elapsed timer unit that cannot elapse anymore is unloaded once its associated unit deactivated again. Turning this off is particularly useful for transient timer units. Note that this setting has an effect when repeatedly starting a timer unit: if C is on, starting the timer a second time has no effect. However, if C is off and the timer unit was already unloaded, it can be started again, and thus the service can be triggered multiple times. Defaults to C.', 'type' => 'leaf', 'value_type' => 'boolean', 'write_as' => [ 'no', 'yes' ] } ], 'generated_by' => 'parse-man.pl from systemd 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Timer' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/TimerUnit.pl000066400000000000000000000230451500217761400311650ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => '$unknown_param_msg' } ], 'element' => [ 'FailureAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', 'type' => 'leaf', 'value_type' => 'enum' }, 'SuccessAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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, 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, C, C, C, C and C have the effect of powering down the system, executing kexec, and halting the system respectively 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. C will trigger a userspace reboot operation. C does that too, but does not go through the shutdown transaction beforehand.', 'type' => 'leaf', 'value_type' => 'enum' }, 'StartLimitBurst', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitIntervalSec', { 'description' => 'Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use C to configure the checking interval and C to configure how many starts per interval are allowed. interval is a time span with the default unit of seconds, but other units may be specified, see L. The special value C can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to C in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and 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 or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. 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. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit. 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. 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.', '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' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Section/Unit.pl000066400000000000000000003100231500217761400301570ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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 \"unit name prefix\", and a suffix specifying the unit type which begins with a dot. The \"unit name 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 255 characters. The unit 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>. Unit 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 unit name prefix (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. To access those options, applications need to parse the unit files on their own. 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. As another example, C \x{2014} the default system target started at boot \x{2014} is commonly aliased to either C or C to select what is started by default. 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. Aliases obey the following restrictions: a unit of a certain type (C<.service>, C<.socket>, \x{2026}) can only be aliased by a name with the same type suffix. A plain unit (not a template or an instance), may only be aliased by a plain name. A template instance may only be aliased by another template instance, and the instance part must be identical. A template may be aliased by another template (in which case the alias applies to all instances of the template). As a special case, a template instance (e.g. C) may be a symlink to different template (e.g. C). In that case, just this specific instance is aliased, while other instances of the template (e.g. C, C) are not aliased. Those rules preserve the requirement that the instance (if any) is always uniquely defined for a given unit and all its aliases. The target of alias symlink must point to a valid unit file location, i.e. the symlink target name must match the symlink source name as described, and the destination path must be in one of the unit search paths, see UNIT FILE LOAD PATH section below for more details. Note that the target file might not exist, i.e. the symlink may be dangling. 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 C, follow the symlink to C, and execute C as part of that target. 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 and C, see below. The preferred way to create symlinks in the C<.wants/> or C<.requires/> directories is by specifying 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. The target can be a normal unit (either plain or a specific instance of a template unit). In case when the source unit is a template, the target can also be a template, in which case the instance will be \"propagated\" to the target unit to form a valid unit instance. The target of symlinks in C<.wants/> or C<.requires/> must thus point to a valid unit file location, i.e. the symlink target name must satisfy the described requirements, and the destination path must be in one of the unit search paths, see UNIT FILE LOAD PATH section below for more details. Note that the target file might not exist, i.e. the symlink may be dangling. 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 merged in the alphanumeric order and parsed after the main unit file itself has been parsed. This is useful to alter or add configuration settings for a unit, without having to modify unit files. Each drop-in file 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 unit names containing dashes (C<->), the set of directories generated by repeatedly 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 cases of unit aliases (described above), dropins for the aliased name and all aliases are loaded. In the example of C aliasing C, C, C, C, C, C, C would all be read. For templates, dropins for the template, any template aliases, the template instance, and all alias instances are read. When just a specific template instance is aliased, then the dropins for the target template, the target template instance, and the alias template instance are read. 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. Files in C have lower precedence compared to files in name-specific override directories. The usual rules apply: multiple drop-in files with different names are applied in lexicographic order, regardless of which of the directories they reside in, so a file in C applies to a unit only if there are no drop-ins or masks with that name in directories with higher precedence. See Examples. 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 L. 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 from directories not on the unit load path by creating a symlink pointing to a unit file in the directories. You can use systemctl link for this; see L. The file system where the linked unit files are located must be accessible when systemd is started (e.g. anything underneath C or C is not allowed, unless those directories are located on the root file system). It is important to distinguish \"linked unit files\" from \"unit file aliases\": any symlink where the symlink target is within the unit load path becomes an alias: the source name and the target file name must satisfy specific constraints listed above in the discussion of aliases, but the symlink target doesn't have to exist, and in fact the symlink target path is not used, except to check whether the target is within the unit load path. In contrast, a symlink which goes outside of the unit load path signifies a linked unit file. The symlink is followed when loading the file, but the destination name is otherwise unused (and may even not be a valid unit file name). For example, symlinks C \x{2192} C, C \x{2192} C, C \x{2192} C are all valid aliases and C will have four names, even if the unit file is located at C. In contrast, a symlink C \x{2192} C<../link1_service_file> means that C is a \"linked unit\" and the contents of C provide its configuration. Unit files may also include a number of C and C settings. Before the unit is started, systemd will verify that the specified conditions and asserts are true. If not, the starting of the unit will be (mostly silently) skipped (in case of conditions), or aborted with an error message (in case of asserts). Failing conditions or asserts will not result in the unit being moved into the C state. The conditions and asserts 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, and the conditions and asserts are executed the precise moment the unit would normally start and thus can validate system state after the units ordered before completed initialization. Use condition expressions for skipping 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 to become a triggering condition. If at least one triggering condition is defined for a unit, then the unit will be started if at least one of the triggering conditions of the unit applies and all of the regular (i.e. non-triggering) conditions apply. 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 are similar to conditions but cause the start job to fail (instead of being skipped). The failed check is logged. Units with unmet 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 short human readable title of the unit. This may be used by systemd (and other UIs) as a user-visible label for the unit, so this string should identify the unit rather than describe it, despite the name. This string also shouldn\'t just repeat the unit name. C is a good example. Bad examples are C (too generic) or C (meaningless for people who do not know Apache, duplicates the unit name). systemd may 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 (weak) 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 the 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 requirement 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 (or restarted) if one of the other units is explicitly stopped (or restarted). 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 an unmet 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' }, 'Upholds', { 'description' => 'Configures dependencies similar to C, but as long as this unit is up, all units listed in C are started whenever found to be inactive or failed, and no job is queued for them. While a C dependency on another unit has a one-time effect when this units started, a C dependency on it has a continuous effect, constantly restarting the unit if necessary. This is an alternative to the C setting of service units, to ensure they are kept running whatever happens. The restart happens without delay, and usual per-unit rate-limit applies. When C is used on C, this dependency will show as C in the property listing of C.', 'type' => 'leaf', 'value_type' => 'uniline' }, '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 settings 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 this includes C (or C for the shutdown case). 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. Note that C dependencies on device units have no effect and are not supported. Devices generally become available as a result of an external hotplug event, and systemd creates the corresponding device unit without delay.', '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 settings 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 this includes C (or C for the shutdown case). 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. Note that C dependencies on device units have no effect and are not supported. Devices generally become available as a result of an external hotplug event, and systemd creates the corresponding device unit without delay.', 'type' => 'list' }, 'OnFailure', { 'description' => 'A space-separated list of one or more units that are activated when this unit enters the C state.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnSuccess', { 'description' => 'A space-separated list of one or more units that are activated when this unit enters the C state.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PropagatesReloadTo', { 'description' => 'A space-separated list of one or more units to which reload requests from this unit shall be propagated to, or units from which reload requests shall be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue reload requests on all units that are linked to it using these two settings.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'ReloadPropagatedFrom', { 'description' => 'A space-separated list of one or more units to which reload requests from this unit shall be propagated to, or units from which reload requests shall be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue reload requests on all units that are linked to it using these two settings.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'PropagatesStopTo', { 'description' => 'A space-separated list of one or more units to which stop requests from this unit shall be propagated to, or units from which stop requests shall be propagated to this unit, respectively. Issuing a stop request on a unit will automatically also enqueue stop requests on all units that are linked to it using these two settings.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StopPropagatedFrom', { 'description' => 'A space-separated list of one or more units to which stop requests from this unit shall be propagated to, or units from which stop requests shall be propagated to this unit, respectively. Issuing a stop request on a unit will automatically also enqueue stop requests on all units that are linked to it using 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. If this is specified on a unit (say, C has C), then the inverse dependency (C for b.service) is implied. This only applies to unit types which support the C, C, 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, IPC namespace and network namespace as one listed unit that is started. If multiple listed units are already started and these do not share their namespace, then it is not defined which namespace is joined. Note that this setting only has an effect if C/C, 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' }, 'WantsMountsFor', { 'description' => 'Same as C, but adds dependencies of type C instead of C.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'OnSuccessJobMode', { 'description' => 'Takes a value of C, C, C, C, C, C or C. Defaults to C. Specifies how the units listed in C/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/C.', '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/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/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, 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' ] }, 'SurviveFinalKillSignal', { 'description' => 'Takes a boolean argument. Defaults to C. If C, processes belonging to this unit will not be sent the final C and C signals during the final phase of the system shutdown process. This functionality replaces the older mechanism that allowed a program to set C as described at L, which however continues to be supported.', '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' => 'C specifies a timeout for the whole job that starts running when the job is queued. C specifies a timeout that starts running when the queued job is actually started. If either limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. Both settings take a time span with the default unit of seconds, but other units may be specified, see L. The default is C (job timeouts disabled), except for device units where C defaults to C. Note: these timeouts are independent from any unit-specific timeouts (for example, the timeout set with C in service units). The job timeout has no effect on the unit itself. 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' => 'C specifies a timeout for the whole job that starts running when the job is queued. C specifies a timeout that starts running when the queued job is actually started. If either limit is reached, the job will be cancelled, the unit however will not change state or even enter the C mode. Both settings take a time span with the default unit of seconds, but other units may be specified, see L. The default is C (job timeouts disabled), except for device units where C defaults to C. Note: these timeouts are independent from any unit-specific timeouts (for example, the timeout set with C in service units). The job timeout has no effect on the unit itself. 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/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/C. Defaults to C. C configures an optional reboot string to pass to the L system call.', 'type' => 'leaf', 'value_type' => 'uniline' }, 'StartLimitAction', { 'choice' => [ 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-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 C/C settings. If C is set, hitting the rate limit will trigger no action except 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' => [ 'alpha', 'arc', 'arc-be', 'arm', 'arm-be', 'arm64', 'arm64-be', 'cris', 'ia64', 'm68k', 'mips', 'mips-le', 'mips64', 'mips64-le', 'native', 'parisc', 'parisc64', 'ppc', 'ppc-le', 'ppc64', 'ppc64-le', 's390', 's390x', 'sh', 'sh64', 'sparc', 'sparc64', 'tilegx', 'x86', 'x86-64' ], '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. Use L for the complete list of known architectures. 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' }, 'ConditionFirmware', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check whether the system\'s firmware is of a certain type. The following values are possible:', '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, 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. This operates on the kernel command line communicated to userspace via C, except when the service manager is invoked as payload of a container manager, in which case the command line of C is used instead (i.e. C).", '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. The argument must be a list of (potentially quoted) expressions. Each expression starts with one of C<=> or C for string comparisons, C<< < >>, C<< <= >>, C<==>, C<< <> >>, C<< >= >>, C<< > >> for version comparisons, or C<$=>, C for a shell-style glob match. If no operator is specified, C<$=> is implied. 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' }, 'ConditionCredential', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C may be used to check whether a credential by the specified name was passed into the service manager. See L for details about credentials. If used in services for the system service manager this may be used to conditionalize services based on system credentials passed in. If used in services for the per-user service manager this may be used to conditionalize services based on credentials passed into the C service instance belonging to the user. The argument must be a valid credential name.', 'type' => 'list' }, 'ConditionEnvironment', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => "C may be used to check whether a specific environment variable is set (or if prefixed with the exclamation mark \x{2014} unset) in the service manager's environment block. The argument may be a single word, to check if the variable with this name is defined in the environment block, or an assignment (C), to check if the variable with this exact value is defined. Note that the environment block of the service manager itself is checked, i.e. not any variables defined with C or C, as described above. This is particularly useful when the service manager runs inside a containerized environment or as per-user service manager, in order to check for variables passed in by the enclosing container manager or PAM.", '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 following values are recognized: 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' => [ '!/etc/', '!/var/', '/etc/', '/var/' ], 'type' => 'leaf', 'value_type' => 'enum' }, 'description' => 'Takes one of C or C as argument, possibly prefixed with a C (to invert 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. If the C option is specified on the kernel command line (taking a boolean), it will override the result of this condition check, taking precedence over any file modification time checks. If the kernel command line option is used, C will not have immediate effect on any following C checks, until the system is rebooted where the kernel command line option is not specified anymore. Note that to make this scheme effective, the timestamp of C should be explicitly updated after its contents are modified. The kernel will automatically update modification timestamp on a directory only when immediate children of a directory are modified; an modification of nested files will not automatically result in mtime of C being updated. Also note that if the update method includes a call to execute appropriate post-update steps itself, it should not touch the timestamp of C. In a typical distribution packaging scheme, packages will do any required update steps as part of the installation or upgrade, to make package contents immediately usable. C should be used with other update mechanisms where such an immediate update does not happen.', '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 for the first time. This roughly means that C was unpopulated when the system started booting (for details, see "First Boot Semantics" in L). First Boot is considered finished (this condition will evaluate as false) after the manager has finished the startup phase. This condition 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. Note that the service manager itself will perform setup steps during First Boot: it will initialize L and preset all units, enabling or disabling them according to the L settings. Additional setup may be performed via units with C. For robustness, units with C should order themselves before C and pull in this passive target with C. This ensures that in a case of an aborted first boot, these units will be re-run during the next system startup. If the C option is specified on the kernel command line (taking a boolean), it will override the result of this condition check, taking precedence over C existence checks.', 'type' => 'list' }, 'ConditionPathExists', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Check for the existence 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' }, 'ConditionPathIsEncrypted', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'C is similar to C but verifies that the underlying file system\'s backing block device is encrypted using dm-crypt/LUKS. Note that this check does not cover ext4 per-directory encryption, and only detects block level encryption. Moreover, if the specified path resides on a file system on top of a loopback block device, only encryption above the loopback device is detected. It is not detected whether the file system backing the loopback block device is encrypted.', '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' => 'Check whether given cgroup controllers (e.g. C) are available for use on the system or whether the legacy v1 cgroup or the modern v2 cgroup hierarchy is used. 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, and C. Even if available in the kernel, a particular controller may not be available if it was disabled on the kernel command line with C. Alternatively, two special strings C and C may be specified (without any controller names). C will pass if the unified v2 cgroup hierarchy is used, and C will pass if the legacy v1 hierarchy or the hybrid hierarchy are used. Note that legacy or hybrid hierarchies have been deprecated. See L for more information.', '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<=> (or C<==>), C (or 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<=> (or C<==>), C (or 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' }, 'ConditionCPUFeature', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that a given CPU feature is available via the C instruction. This condition only does something on i386 and x86-64 processors. On other processors it is assumed that the CPU does not support the given feature. It checks the leaves C<1>, C<7>, C<0x80000001>, and C<0x80000007>. Valid values are: 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, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C.', 'type' => 'list' }, 'ConditionOSRelease', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that a specific C pair is set in the host\'s L. Other than exact string matching (with C<=> and C), relative comparisons are supported for versioned parameters (e.g. C; with C<< < >>, C<< <= >>, C<==>, C<< <> >>, C<< >= >>, C<< > >>), and shell-style wildcard comparisons (C<*>, C, C<[]>) are supported with the C<$=> (match) and C (non-match). If the given key is not found in the file, the match is done against an empty value.', 'type' => 'list' }, 'ConditionMemoryPressure', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold. This setting takes a threshold value as argument. It can be specified as a simple percentage value, suffixed with C<%>, in which case the pressure will be measured as an average over the last five minutes before the attempt to start the unit is performed. Alternatively, the average timespan can also be specified using C as a separator, for example: C<10%/1min>. The supported timespans match what the kernel provides, and are limited to C<10sec>, C<1min> and C<5min>. The C PSI will be checked first, and if not found C will be checked. For more details, see the documentation on L. Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a C<:>. If the slice unit is not specified, the overall system pressure will be measured, instead of a particular cgroup\'s.', 'type' => 'list' }, 'ConditionCPUPressure', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold. This setting takes a threshold value as argument. It can be specified as a simple percentage value, suffixed with C<%>, in which case the pressure will be measured as an average over the last five minutes before the attempt to start the unit is performed. Alternatively, the average timespan can also be specified using C as a separator, for example: C<10%/1min>. The supported timespans match what the kernel provides, and are limited to C<10sec>, C<1min> and C<5min>. The C PSI will be checked first, and if not found C will be checked. For more details, see the documentation on L. Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a C<:>. If the slice unit is not specified, the overall system pressure will be measured, instead of a particular cgroup\'s.', 'type' => 'list' }, 'ConditionIOPressure', { 'cargo' => { 'type' => 'leaf', 'value_type' => 'uniline' }, 'description' => 'Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold. This setting takes a threshold value as argument. It can be specified as a simple percentage value, suffixed with C<%>, in which case the pressure will be measured as an average over the last five minutes before the attempt to start the unit is performed. Alternatively, the average timespan can also be specified using C as a separator, for example: C<10%/1min>. The supported timespans match what the kernel provides, and are limited to C<10sec>, C<1min> and C<5min>. The C PSI will be checked first, and if not found C will be checked. For more details, see the documentation on L. Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a C<:>. If the slice unit is not specified, the overall system pressure will be measured, instead of a particular cgroup\'s.', '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' }, 'AssertCredential', { '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' }, 'AssertEnvironment', { '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' }, 'AssertPathIsEncrypted', { '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' }, 'AssertMemory', { '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' }, 'AssertCPUs', { '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' }, 'AssertCPUFeature', { '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' }, 'AssertOSRelease', { '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' }, 'AssertMemoryPressure', { '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' }, 'AssertCPUPressure', { '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' }, 'AssertIOPressure', { '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 257 doc', 'license' => 'LGPLv2.1+', 'name' => 'Systemd::Section::Unit' } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Service.pl000066400000000000000000000037531500217761400272450ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Socket.pl000066400000000000000000000037461500217761400270770ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/StandAlone/000077500000000000000000000000001500217761400273305ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/StandAlone/Service.pl000066400000000000000000000015421500217761400312670ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], 'element' => [ 'Service', { 'config_class_name' => 'Systemd::Section::Service', 'type' => 'node' }, 'Unit', { 'config_class_name' => 'Systemd::Section::ServiceUnit', 'type' => 'node' }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'node' } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::StandAlone::Service', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/StandAlone/Socket.pl000066400000000000000000000015361500217761400311220ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], 'element' => [ 'Socket', { 'config_class_name' => 'Systemd::Section::Socket', 'type' => 'node' }, 'Unit', { 'config_class_name' => 'Systemd::Section::SocketUnit', 'type' => 'node' }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'node' } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::StandAlone::Socket', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/StandAlone/Timer.pl000066400000000000000000000015321500217761400307460ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], 'element' => [ 'Timer', { 'config_class_name' => 'Systemd::Section::Timer', 'type' => 'node' }, 'Unit', { 'config_class_name' => 'Systemd::Section::TimerUnit', 'type' => 'node' }, 'Install', { 'config_class_name' => 'Systemd::Section::Install', 'type' => 'node' } ], 'generated_by' => 'parse-man.pl from systemd doc', 'name' => 'Systemd::StandAlone::Timer', 'rw_config' => { 'auto_create' => '1', 'auto_delete' => '1', 'backend' => 'Systemd::Unit' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/models/Systemd/Timer.pl000066400000000000000000000037411500217761400267220ustar00rootroot00000000000000use strict; use warnings; return [ { 'accept' => [ '.*', { 'type' => 'leaf', 'value_type' => 'uniline', 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' } ], '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' } } ] ; libconfig-model-systemd-perl-0.257.2/lib/Config/Model/system.d/000077500000000000000000000000001500217761400241335ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/system.d/systemd000066400000000000000000000002251500217761400255450ustar00rootroot00000000000000model = Systemd require_backend_argument = 1 config_dir = /etc/systemd/system/ support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/system.d/systemd-service000066400000000000000000000003221500217761400272010ustar00rootroot00000000000000model = Systemd::StandAlone::Service require_backend_argument = 1 use_backend_argument_as_config_file = 1 config_dir = /etc/systemd/system/ support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/system.d/systemd-socket000066400000000000000000000003211500217761400270300ustar00rootroot00000000000000model = Systemd::StandAlone::Socket require_backend_argument = 1 use_backend_argument_as_config_file = 1 config_dir = /etc/systemd/system/ support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/system.d/systemd-timer000066400000000000000000000003201500217761400266570ustar00rootroot00000000000000model = Systemd::StandAlone::Timer require_backend_argument = 1 use_backend_argument_as_config_file = 1 config_dir = /etc/systemd/system/ support_info = https://github.com/dod38fr/config-model-systemd/issues libconfig-model-systemd-perl-0.257.2/lib/Config/Model/user.d/000077500000000000000000000000001500217761400235655ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/lib/Config/Model/user.d/systemd-user000066400000000000000000000003121500217761400261500ustar00rootroot00000000000000model = 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 libconfig-model-systemd-perl-0.257.2/t/000077500000000000000000000000001500217761400176155ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/README.md000066400000000000000000000017651500217761400211050ustar00rootroot00000000000000## 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 libconfig-model-systemd-perl-0.257.2/t/cme-function.t000066400000000000000000000031061500217761400223710ustar00rootroot00000000000000# -*- cperl -*- use strict; use warnings; use English; 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/; if ($OSNAME eq 'solaris' ) { plan skip_all => "Test irrelevant on $OSNAME"; exit; } 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-file', 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 with basename' => sub { my $instance = cme( application => 'systemd-service-file', config_file => $systemd_file->basename, root_dir => $wr_root->stringify ); is($instance->grab_value('Unit Description'),"test single unit","read file ok"); }; subtest 'read file with service suffix' => sub { my $instance = cme( application => 'systemd-service-file', config_file => $systemd_file, root_dir => $wr_root->stringify ); is($instance->grab_value('Unit Description'),"test single unit","read file ok"); }; done_testing(); libconfig-model-systemd-perl-0.257.2/t/model_tests.d/000077500000000000000000000000001500217761400223615ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/000077500000000000000000000000001500217761400256655ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/condition-list/000077500000000000000000000000001500217761400306245ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/condition-list/main-test000066400000000000000000000006211500217761400324470ustar00rootroot00000000000000[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/disable-service/000077500000000000000000000000001500217761400307265ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/disable-service/main-sshd000066400000000000000000000006011500217761400325310ustar00rootroot00000000000000[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service/000077500000000000000000000000001500217761400306205ustar00rootroot00000000000000default-alsa-state000066400000000000000000000007061500217761400341470ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service# # 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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service/default-sshd000066400000000000000000000006011500217761400331230ustar00rootroot00000000000000[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service/main-sshd000066400000000000000000000000551500217761400324260ustar00rootroot00000000000000[Unit] Description=serveur OpenBSD securisé libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service/mpd.service000066400000000000000000000005451500217761400327660ustar00rootroot00000000000000[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/remove-service/mpd.socket000066400000000000000000000002111500217761400326040ustar00rootroot00000000000000[Socket] ListenStream=/run/mpd/socket ListenStream=6600 Backlog=5 KeepAlive=true PassCredentials=true [Install] WantedBy=sockets.target libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/sshd-service/000077500000000000000000000000001500217761400302645ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/sshd-service/main-sshd000066400000000000000000000000771500217761400320760ustar00rootroot00000000000000[Unit] Description=OpenBSD Secure Shell server - test override libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/sshd-service/ssh.service000066400000000000000000000010321500217761400324370ustar00rootroot00000000000000[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/transmission/000077500000000000000000000000001500217761400304165ustar00rootroot00000000000000transmission-daemon.service000066400000000000000000000004611500217761400357140ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-examples/transmission[Unit] Description=Transmission BitTorrent Daemon After=network.target [Service] User=debian-transmission Type=notify ExecStart=/usr/bin/transmission-daemon -f --log-error ExecStop=/bin/kill -s STOP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID NoNewPrivileges=true [Install] WantedBy=multi-user.target libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/000077500000000000000000000000001500217761400302405ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/basic-service/000077500000000000000000000000001500217761400327575ustar00rootroot00000000000000gmail-imap-tunnel@.service000066400000000000000000000003631500217761400377040ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/basic-service[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/delete-service/000077500000000000000000000000001500217761400331405ustar00rootroot00000000000000main-obex000066400000000000000000000002461500217761400346650ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/delete-service[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service user-obex000066400000000000000000000000641500217761400347150ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/delete-service[Unit] Description=Le service Obex a la dent bleue libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/override-service/000077500000000000000000000000001500217761400335155ustar00rootroot00000000000000main-obex000066400000000000000000000002461500217761400352420ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/override-service[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service user-obex000066400000000000000000000000641500217761400352720ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-examples/override-service[Unit] Description=Le service Obex a la dent bleue libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-file-test-conf.pl000066400000000000000000000014061500217761400306620ustar00rootroot00000000000000# 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 } ; libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-service-test-conf.pl000066400000000000000000000037701500217761400277530ustar00rootroot00000000000000# systemd tests (system files) use strict; use warnings; my $conf_dir = '/etc/systemd/system/'; # list of tests. my @tests = ( { name => 'sshd-service', config_file => $conf_dir.'sshd.service', data_from_group => 'systemd', setup => { 'main-sshd' => $conf_dir.'sshd.service.d/override.conf', # create symlink from array elements to target file (the last of the array) 'ssh.service' => [ $conf_dir.'/sshd.service', '/lib/systemd/system/ssh.service' ] }, check => { 'Service ExecStartPre:0' => { mode => 'layered', value => '/usr/sbin/sshd -t'}, 'Service ExecReload:0' => { mode => 'layered', value => '/usr/sbin/sshd -t'}, 'Service ExecReload:1' => { mode => 'layered', value => '/bin/kill -HUP $MAINPID'}, 'Unit Description' => "OpenBSD Secure Shell server - test override", }, wr_check => { 'Unit Description' => { mode => 'custom', value => "OpenBSD Secure Shell server - test override"}, } }, { name => 'transmission', config_file => $conf_dir.'transmission-daemon.service', data_from_group => 'systemd', setup => { 'transmission-daemon.service' => '/lib/systemd/system/transmission-daemon.service' }, load => 'Unit After: { 'Unit After:0' => { mode => 'user', value => "network.target"}, 'Unit After:1' => "you", }, file_check_sub => sub { my $list_ref = shift ; push @$list_ref , '/etc/systemd/system/transmission-daemon.service.d/override.conf'; }, }, { name => 'condition-list', config_file => $conf_dir.'main-test.service', data_from_group => 'systemd', setup => { # Debian #850228 'main-test' => $conf_dir.'main-test.service.d/override.conf', } }, ); return { tests => \@tests, conf_dir => $conf_dir, } libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-socket-file-examples/000077500000000000000000000000001500217761400300705ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-socket-file-examples/basic-socket/000077500000000000000000000000001500217761400324375ustar00rootroot00000000000000gmail-imap-tunnel.socket000066400000000000000000000001701500217761400371100ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-socket-file-examples/basic-socket[Unit] Description=Socket for Gmail IMAP tunnel [Install] WantedBy=sockets.target [Socket] ListenStream=9995 Accept=1 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-socket-file-test-conf.pl000066400000000000000000000010411500217761400305050ustar00rootroot00000000000000# 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 } ; libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-test-conf.pl000066400000000000000000000065521500217761400263160ustar00rootroot00000000000000# 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) '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 => 'transmission', backend_arg => 'transmission-daemon', setup => { 'transmission-daemon.service' => '/lib/systemd/system/transmission-daemon.service' }, load => 'service:transmission-daemon Unit After: { 'service:transmission-daemon Unit After:0' => { mode => 'user', value => "network.target"}, 'service:transmission-daemon Unit After:1' => "you", }, file_check_sub => sub { my $list_ref = shift ; push @$list_ref , '/etc/systemd/system/transmission-daemon.service.d/override.conf'; }, }, { 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~", # when loading sshd, no service, timer or socket is found, so # the backend creates empty socket, timer and service so cme # edit can show them all both to users. Since these items are # not filled with data, no file is written. But dump tree test # shows the difference, so we remove the empty socket. load2 => "socket:.rm(sshd) timer:.rm(sshd)", # 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, } libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/000077500000000000000000000000001500217761400266415ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/basic-service/000077500000000000000000000000001500217761400313605ustar00rootroot00000000000000gmail-imap-tunnel@.service000066400000000000000000000003631500217761400363050ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/basic-service[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 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/basic-socket/000077500000000000000000000000001500217761400312105ustar00rootroot00000000000000gmail-imap-tunnel.socket000066400000000000000000000001701500217761400356610ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/basic-socket[Unit] Description=Socket for Gmail IMAP tunnel [Install] WantedBy=sockets.target [Socket] ListenStream=9995 Accept=1 libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/delete-service/000077500000000000000000000000001500217761400315415ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/delete-service/main-obex000066400000000000000000000002461500217761400333450ustar00rootroot00000000000000[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/delete-service/user-obex000066400000000000000000000000641500217761400333750ustar00rootroot00000000000000[Unit] Description=Le service Obex a la dent bleue libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/duplicity/000077500000000000000000000000001500217761400306475ustar00rootroot00000000000000duplicity.service000066400000000000000000000000401500217761400341520ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/duplicity[Service] ExecStart = my-backup libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/duplicity/duplicity.timer000066400000000000000000000000771500217761400337230ustar00rootroot00000000000000[Timer] OnCalendar = 13:00 [Unit] Description = Run duplicity libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/override-service/000077500000000000000000000000001500217761400321165ustar00rootroot00000000000000main-obex000066400000000000000000000002461500217761400336430ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/override-service[Unit] Description=Bluetooth OBEX service [Service] Type=dbus BusName=org.bluez.obex ExecStart=/usr/lib/bluetooth/obexd [Install] Alias=dbus-org.bluez.obex.service user-obex000066400000000000000000000000641500217761400336730ustar00rootroot00000000000000libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-examples/override-service[Unit] Description=Le service Obex a la dent bleue libconfig-model-systemd-perl-0.257.2/t/model_tests.d/systemd-user-test-conf.pl000066400000000000000000000062161500217761400272670ustar00rootroot00000000000000# 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', }, load => 'service:obex Service Environment:0="TEST=true"', file_contents_like => { "home/joe/.config/systemd/user/obex.service.d/override.conf" => qr/TEST=true/ , }, file_check_sub => sub { my $list_ref = shift ; # file added during tests push @$list_ref, "/home/joe/.config/systemd/user/obex.service.d/override.conf" ; } }, { name => 'overridden-service', backend_arg => 'obex', data_from => 'override-service', setup => { 'main-obex' => '/usr/lib/systemd/user/obex.service', 'user-obex' => '~/.config/systemd/user/obex.service.d/override.conf', }, 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.d/override.conf', }, 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/ , }, }, { name => 'duplicity', backend_arg => 'duplicity', check => [ 'service:duplicity Service ExecStart:0' => "my-backup", 'timer:duplicity Timer OnCalendar:0' => '13:00', 'timer:duplicity Unit Description'=>"Run duplicity", ] } ); return { tests => \@tests, home_for_test=>'/home/joe', conf_dir => '~/.config/systemd/user/', config_file_name => 'systemd-user', } libconfig-model-systemd-perl-0.257.2/t/model_tests.t000066400000000000000000000003541500217761400223260ustar00rootroot00000000000000# -*- cperl -*- use warnings; use strict; use English; use Test::More; use Config::Model::Tester 4.007; use ExtUtils::testlib; if ($OSNAME eq 'solaris' ) { plan skip_all => "Test irrelevant on $OSNAME"; exit; } run_tests() ; libconfig-model-systemd-perl-0.257.2/t/perl-critic.t000066400000000000000000000010221500217761400222120ustar00rootroot00000000000000 use strict; use warnings; use File::Spec; use Test::More; use English qw(-no_match_vars); if ( not $ENV{TEST_AUTHOR} ) { my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; plan( skip_all => $msg ); } eval { require Test::Perl::Critic; }; if ( $EVAL_ERROR ) { my $msg = 'Test::Perl::Critic required to criticise code'; plan( skip_all => $msg ); } my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' ); Test::Perl::Critic->import( -profile => $rcfile ); all_critic_ok(); libconfig-model-systemd-perl-0.257.2/t/perlcriticrc000066400000000000000000000007301500217761400222250ustar00rootroot00000000000000severity = 4 # remove when https://github.com/Perl-Critic/PPI/issues/194 is fixed [-Subroutines::ProhibitSubroutinePrototypes] [TestingAndDebugging::ProhibitNoWarnings] allow = experimental::postderef experimental::signatures # model files are not modules [-Modules::RequireExplicitPackage] # model files finish with a data structure: the model [-Modules::RequireEndWithOne] [RegularExpressions::RequireExtendedFormatting] minimum_regex_length_to_complain_about = 25 libconfig-model-systemd-perl-0.257.2/t/pod.t000066400000000000000000000003741500217761400205700ustar00rootroot00000000000000use 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( ); libconfig-model-systemd-perl-0.257.2/t/systemd-service.t000066400000000000000000000040331500217761400231300ustar00rootroot00000000000000# -*- cperl -*- use strict; use warnings; use English; use Path::Tiny; use Test::More; use Test::File::Contents; use Test::Log::Log4perl; 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 $lib_systemd = $wr_root->child('lib/systemd/system/'); $lib_systemd->mkpath({mode => oct(755)}); $lib_systemd->child('transmission-daemon.service')->spew(); my $inst = $model->instance ( application => 'systemd', instance_name => 'instance', root_dir => $wr_root, backend_arg => 'transmission-daemon', ); ok($inst,"Created instance") ; my $root = $inst -> config_root ; my $dump; { my $xp = Test::Log::Log4perl->expect( ignore_priority => "info", [ 'User', warn => qr/Unexpected systemd parameter/ ] ); $dump = $root->dump_tree (mode => 'full'); } ok($dump,"Created dump") ; print "First dump:\n",$dump if $trace ; $root -> load("service:transmission-daemon Unit After:write_back; ok(1,"wrote data back") ; my $service_dot_d = $wr_root->child('etc/systemd/system/transmission-daemon.service.d'); file_contents_like( $service_dot_d->child('override.conf')->stringify, qr/you/, "override file was written", ); $root -> load("service:transmission-daemon Unit After:-=you") ; $inst->write_back; ok(! $service_dot_d->child('override.conf')->exists, "unneeded file was removed"); ok(! $service_dot_d->exists, "unneeded dir was removed"); done_testing; __END__ __DATA__ [Unit] Description=Transmission BitTorrent Daemon After=network.target [Service] User=debian-transmission Type=notify ExecStart=/usr/bin/transmission-daemon -f --log-error ExecStop=/bin/kill -s STOP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID # test conversion of on to no NoNewPrivileges=on # test accepted parameters DummyParam=dummy [Install] WantedBy=multi-user.target libconfig-model-systemd-perl-0.257.2/weaver.ini000066400000000000000000000002201500217761400213360ustar00rootroot00000000000000[@Default] [-Transformer] transformer = List [Support] perldoc = 0 bugs = metadata websites = search,ratings,kwalitee,testers,testmatrix,deps