File Coverage

blib/lib/Config/Model/models/Systemd/Section/Install.pl
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 32 32 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of Config-Model-Systemd
3             #
4             # This software is Copyright (c) 2008-2022 by Dominique Dumont.
5             #
6             # This is free software, licensed under:
7             #
8             # The GNU Lesser General Public License, Version 2.1, February 1999
9             #
10 4     4   93958 use strict;
  4     1   9  
  4     1   105  
  1     1   17902  
  1         2  
  1         20  
  1         17998  
  1         2  
  1         19  
  1         21277  
  1         3  
  1         21  
11 4     4   16 use warnings;
  4     1   7  
  4     1   734  
  1     1   4  
  1         2  
  1         112  
  1         4  
  1         2  
  1         106  
  1         4  
  1         3  
  1         115  
12              
13             return [
14             {
15             'accept' => [
16             '.*',
17             {
18             'type' => 'leaf',
19             'value_type' => 'uniline',
20             'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.'
21             }
22             ],
23             'element' => [
24             'Alias',
25             {
26             'cargo' => {
27             'type' => 'leaf',
28             'value_type' => 'uniline'
29             },
30             'description' => 'A space-separated list of additional names this unit shall be installed under. The names listed
31             here must have the same suffix (i.e. type) as the unit filename. This option may be specified more than once,
32             in which case all listed names are used. At installation time, systemctl enable will create
33             symlinks from these names to the unit filename. Note that not all unit types support such alias names, and this
34             setting is not supported for them. Specifically, mount, slice, swap, and automount units do not support
35             aliasing.',
36             'type' => 'list'
37             },
38             'WantedBy',
39             {
40             'cargo' => {
41             'type' => 'leaf',
42             'value_type' => 'uniline'
43             },
44             'description' => 'This option may be used more than once, or a space-separated list of unit names may
45             be given. A symbolic link is created in the C<.wants/> or
46             C<.requires/> directory of each of the listed units when this unit is installed by
47             systemctl enable. This has the effect of a dependency of type
48             C<Wants> or C<Requires> being added from the listed unit to the
49             current unit. The primary result is that the current unit will be started when the listed unit is
50             started, see the description of C<Wants> and C<Requires> in the
51             [Unit] section for details.
52              
53             In case of template units listing non template units, the listing unit must have
54             C<DefaultInstance> set, or systemctl enable must be called with
55             an instance name. The instance (default or specified) will be added to the
56             C<.wants/> or C<.requires/> list of the listed unit. For example,
57             WantedBy=getty.target in a service C<getty@.service> will result
58             in systemctl enable getty@tty2.service creating a
59             C<getty.target.wants/getty@tty2.service> link to
60             C<getty@.service>. This also applies to listing specific instances of templated
61             units: this specific instance will gain the dependency. A template unit may also list a template
62             unit, in which case a generic dependency will be added where each instance of the listing unit will
63             have a dependency on an instance of the listed template with the same instance value. For example,
64             WantedBy=container@.target in a service C<monitor@.service> will
65             result in systemctl enable monitor@.service creating a
66             C<container@.target.wants/monitor@.service> link to
67             C<monitor@.service>, which applies to all instances of
68             C<container@.target>.',
69             'type' => 'list'
70             },
71             'RequiredBy',
72             {
73             'cargo' => {
74             'type' => 'leaf',
75             'value_type' => 'uniline'
76             },
77             'description' => 'This option may be used more than once, or a space-separated list of unit names may
78             be given. A symbolic link is created in the C<.wants/> or
79             C<.requires/> directory of each of the listed units when this unit is installed by
80             systemctl enable. This has the effect of a dependency of type
81             C<Wants> or C<Requires> being added from the listed unit to the
82             current unit. The primary result is that the current unit will be started when the listed unit is
83             started, see the description of C<Wants> and C<Requires> in the
84             [Unit] section for details.
85              
86             In case of template units listing non template units, the listing unit must have
87             C<DefaultInstance> set, or systemctl enable must be called with
88             an instance name. The instance (default or specified) will be added to the
89             C<.wants/> or C<.requires/> list of the listed unit. For example,
90             WantedBy=getty.target in a service C<getty@.service> will result
91             in systemctl enable getty@tty2.service creating a
92             C<getty.target.wants/getty@tty2.service> link to
93             C<getty@.service>. This also applies to listing specific instances of templated
94             units: this specific instance will gain the dependency. A template unit may also list a template
95             unit, in which case a generic dependency will be added where each instance of the listing unit will
96             have a dependency on an instance of the listed template with the same instance value. For example,
97             WantedBy=container@.target in a service C<monitor@.service> will
98             result in systemctl enable monitor@.service creating a
99             C<container@.target.wants/monitor@.service> link to
100             C<monitor@.service>, which applies to all instances of
101             C<container@.target>.',
102             'type' => 'list'
103             },
104             'Also',
105             {
106             'cargo' => {
107             'type' => 'leaf',
108             'value_type' => 'uniline'
109             },
110             'description' => 'Additional units to install/deinstall when
111             this unit is installed/deinstalled. If the user requests
112             installation/deinstallation of a unit with this option
113             configured, systemctl enable and
114             systemctl disable will automatically
115             install/uninstall units listed in this option as well.
116              
117             This option may be used more than once, or a
118             space-separated list of unit names may be
119             given.',
120             'type' => 'list'
121             },
122             'DefaultInstance',
123             {
124             'description' => 'In template unit files, this specifies for
125             which instance the unit shall be enabled if the template is
126             enabled without any explicitly set instance. This option has
127             no effect in non-template unit files. The specified string
128             must be usable as instance identifier.',
129             'type' => 'leaf',
130             'value_type' => 'uniline'
131             }
132             ],
133             'generated_by' => 'parseman.pl from systemd doc',
134             'name' => 'Systemd::Section::Install'
135             }
136             ]
137             ;
138