]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #12030 from poettering/condition-memory
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Apr 2019 23:01:42 +0000 (08:01 +0900)
committerGitHub <noreply@github.com>
Mon, 1 Apr 2019 23:01:42 +0000 (08:01 +0900)
add ConditionCPUs= + ConditionMemory=

1  2 
man/systemd.unit.xml
src/basic/process-util.c
src/basic/process-util.h
src/shared/condition.c
src/shared/condition.h

index 9281c2c4ae0a469f91386311af03b37b9e758046,e9601569ff3b4b4f8cf1d51551d96e03fec03f64..6fee4c2faf190f9fee333237c48da4a85ed8b257
          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
 -        <option>cpu</option>, <option>cpuacct</option>, <option>io</option>,
 -        <option>blkio</option>, <option>memory</option>,
 -        <option>devices</option>, and <option>pids</option>.</para>
 +        <literal>cpu</literal>, <literal>cpuacct</literal>, <literal>io</literal>,
 +        <literal>blkio</literal>, <literal>memory</literal>,
 +        <literal>devices</literal>, and <literal>pids</literal>.</para>
  
+         <para><varname>ConditionMemory=</varname> verifies if 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 <literal>&lt;</literal>, <literal>&lt;=</literal>, <literal>=</literal>,
+         <literal>!=</literal>, <literal>&gt;=</literal>, <literal>&gt;</literal>. 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.</para>
+         <para><varname>ConditionCPUs=</varname> verifies if the specified number of CPUs is available to the
+         current system. Takes a number of CPUs as argument, optionally prefixed with a comparison operator
+         <literal>&lt;</literal>, <literal>&lt;=</literal>, <literal>=</literal>, <literal>!=</literal>,
+         <literal>&gt;=</literal>, <literal>&gt;</literal>. Compares the number of CPUs in the CPU affinity mask
+         configured of the service manager itself with the specified number, adhering to the specified
+         comparision 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.</para>
          <para>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 be prefixed with a pipe symbol (|) in
Simple merge
Simple merge
Simple merge
Simple merge