cgroups_rs/systemd/
consts.rs

1// Copyright (c) 2025 Ant Group
2//
3// SPDX-License-Identifier: Apache-2.0 or MIT
4//
5
6/// Who enum: all
7pub const WHO_ENUM_ALL: &str = "all";
8
9/// Unit mode: replace
10pub const UNIT_MODE_REPLACE: &str = "replace";
11
12/// No such unit error
13pub const NO_SUCH_UNIT: &str = "org.freedesktop.systemd1.NoSuchUnit";
14
15/// Default description for transient units.
16pub const DEFAULT_DESCRIPTION: &str = "cgroups-rs transient unit";
17
18/// Turn on CPU usage accounting for this unit.
19pub const CPU_ACCOUNTING: &str = "CPUAccounting";
20/// This setting controls the memory controller in the unified hierarchy.
21/// Added in version 208.
22pub const MEMORY_ACCOUNTING: &str = "MemoryAccounting";
23/// This setting controls the pids controller in the unified hierarchy.
24pub const TASKS_ACCOUNTING: &str = "TasksAccounting";
25/// This setting controls the io controller in the unified hierarchy.
26/// Added in version 230.
27pub const IO_ACCOUNTING: &str = "IOAccounting";
28/// This setting controls the block IO controller in the legacy hierarchy.
29/// Deprecated in version 252.
30pub const BLOCK_IO_ACCOUNTING: &str = "BlockIOAccounting";
31/// Description of the unit.
32pub const DESCRIPTION: &str = "Description";
33/// PIDs
34pub const PIDS: &str = "PIDs";
35/// Default dependencies for this unit.
36pub const DEFAULT_DEPENDENCIES: &str = "DefaultDependencies";
37/// Wants, expressing a weak dependency on other units.
38pub const WANTS: &str = "Wants";
39/// Slice, used to assign a unit to a specific slice.
40pub const SLICE: &str = "Slice";
41/// Turns on delegation of further resource control partitioning to
42/// processes of the unit.
43pub const DELEGATE: &str = "Delegate";
44/// Timeout for stopping the unit in microseconds.
45pub const TIMEOUT_STOP_USEC: &str = "TimeoutStopUSec";
46
47/// CPU shares in the legacy hierarchy.
48pub const CPU_SHARES: &str = "CPUShares";
49/// CPU shares in the unified hierarchy.
50pub const CPU_WEIGHT: &str = "CPUWeight";
51/// CPU quota period us.
52pub const CPU_QUOTA_PERIOD_US: &str = "CPUQuotaPeriodUSec";
53/// CPU quota us
54pub const CPU_QUOTA_PER_SEC_US: &str = "CPUQuotaPerSecUSec";
55/// Allowed CPUs
56pub const ALLOWED_CPUS: &str = "AllowedCPUs";
57/// Allowed memory nodes
58pub const ALLOWED_MEMORY_NODES: &str = "AllowedMemoryNodes";
59/// Memory limit in the legacy hierarchy.
60pub const MEMORY_LIMIT: &str = "MemoryLimit";
61/// Memory limit in the unified hierarchy.
62pub const MEMORY_MAX: &str = "MemoryMax";
63/// Memory low
64pub const MEMORY_LOW: &str = "MemoryLow";
65/// Memory swap max
66pub const MEMORY_SWAP_MAX: &str = "MemorySwapMax";
67/// Tasks max
68pub const TASKS_MAX: &str = "TasksMax";