1use crate::props::*;
3
4str_enum!(CgroupDevicePolicy { Auto => "auto", Closed => "closed", Strict => "strict" });
5str_enum!(CgroupPressureWatch { No => "no", Yes => "yes", Auto => "auto", Skip => "skip" });
6str_enum!(CollectMode { Inactive => "inactive", InactiveOrFailed => "inactive-or-failed" });
7str_enum!(CpusetPartition { Member => "member", Root => "root", Isolated => "isolated" });
8str_enum!(EmergencyAction { None => "none", Exit => "exit", ExitForce => "exit-force", Reboot => "reboot", RebootForce => "reboot-force", RebootImmediate => "reboot-immediate", Poweroff => "poweroff", PoweroffForce => "poweroff-force", PoweroffImmediate => "poweroff-immediate", SoftReboot => "soft-reboot", SoftRebootForce => "soft-reboot-force", Kexec => "kexec", KexecForce => "kexec-force", Halt => "halt", HaltForce => "halt-force", HaltImmediate => "halt-immediate" });
9str_enum!(ExecCommandFlag { IgnoreFailure => "ignore-failure", Privileged => "privileged", NoSetuid => "no-setuid", NoEnvExpand => "no-env-expand", ViaShell => "via-shell" });
10str_enum!(ExecKeyringMode { Inherit => "inherit", Private => "private", Shared => "shared" });
11str_enum!(ExecMemoryThp { Inherit => "inherit", Disable => "disable", Madvise => "madvise", System => "system" });
12str_enum!(ExecPreserveMode { No => "no", Yes => "yes", Restart => "restart", OnSuccess => "on-success" });
13str_enum!(ExecUtmpMode { Init => "init", Login => "login", User => "user" });
14str_enum!(JobMode { Fail => "fail", Lenient => "lenient", Replace => "replace", ReplaceIrreversibly => "replace-irreversibly", Isolate => "isolate", Flush => "flush", IgnoreDependencies => "ignore-dependencies", IgnoreRequirements => "ignore-requirements", Triggering => "triggering", RestartDependencies => "restart-dependencies" });
15str_enum!(KillMode { ControlGroup => "control-group", Process => "process", Mixed => "mixed", None => "none" });
16str_enum!(ManagedOomMode { Auto => "auto", Kill => "kill" });
17str_enum!(ManagedOomPreference { None => "none", Avoid => "avoid", Omit => "omit" });
18str_enum!(NotifyAccess { None => "none", Main => "main", Exec => "exec", All => "all" });
19str_enum!(OomPolicy { Continue => "continue", Stop => "stop", Kill => "kill" });
20str_enum!(PrivateBpf { No => "no", Yes => "yes" });
21str_enum!(PrivatePids { No => "no", Yes => "yes" });
22str_enum!(PrivateTmp { No => "no", Connected => "connected", Disconnected => "disconnected" });
23str_enum!(PrivateUsers { No => "no", Self_ => "self", Identity => "identity", Full => "full", Managed => "managed" });
24str_enum!(ProcSubset { All => "all", Pid => "pid" });
25str_enum!(ProtectControlGroups { No => "no", Yes => "yes", Private => "private", Strict => "strict" });
26str_enum!(ProtectHome { No => "no", Yes => "yes", ReadOnly => "read-only", Tmpfs => "tmpfs" });
27str_enum!(ProtectHostname { No => "no", Yes => "yes", Private => "private" });
28str_enum!(ProtectProc { Default => "default", Noaccess => "noaccess", Invisible => "invisible", Ptraceable => "ptraceable" });
29str_enum!(ProtectSystem { No => "no", Yes => "yes", Full => "full", Strict => "strict" });
30str_enum!(ServiceExitType { Main => "main", Cgroup => "cgroup" });
31str_enum!(ServiceRestart { No => "no", OnSuccess => "on-success", OnFailure => "on-failure", OnAbnormal => "on-abnormal", OnWatchdog => "on-watchdog", OnAbort => "on-abort", Always => "always" });
32str_enum!(ServiceRestartMode { Normal => "normal", Direct => "direct", Debug => "debug" });
33str_enum!(ServiceTimeoutFailureMode { Terminate => "terminate", Abort => "abort", Kill => "kill" });
34str_enum!(ServiceType { Simple => "simple", Forking => "forking", Oneshot => "oneshot", Dbus => "dbus", Notify => "notify", NotifyReload => "notify-reload", Idle => "idle", Exec => "exec" });
35
36unit_properties! {
37 AddRef: bool = "b",
38 After: Vec<String> = "as",
39 AllowIsolate: bool = "b",
40 AllowedCPUs: Vec<u8> = "ay",
41 AllowedMemoryNodes: Vec<u8> = "ay",
42 AmbientCapabilities: u64 = "t",
43 AppArmorProfile: SecurityLabel = "(bs)",
44 Asserts: Vec<Condition> = "a(sbbs)",
45 BPFDelegateAttachments: String = "s",
46 BPFDelegateCommands: String = "s",
47 BPFDelegateMaps: String = "s",
48 BPFDelegatePrograms: String = "s",
49 BPFProgram: Vec<BpfProgram> = "a(ss)",
50 Before: Vec<String> = "as",
51 BindLogSockets: bool = "b",
52 BindNetworkInterface: String = "s",
53 BindPaths: Vec<BindPath> = "a(ssbt)",
54 BindReadOnlyPaths: Vec<BindPath> = "a(ssbt)",
55 BindsTo: Vec<String> = "as",
56 BusName: String = "s",
57 CPUAffinity: Vec<u8> = "ay",
58 CPUAffinityFromNUMA: bool = "b",
59 CPUPressureThresholdUSec: Usec = "t",
60 CPUPressureWatch: CgroupPressureWatch = "s",
61 CPUQuotaPerSecUSec: Usec = "t",
62 CPUQuotaPeriodUSec: Usec = "t",
63 CPUSchedulingPolicy: i32 = "i",
64 CPUSchedulingPriority: i32 = "i",
65 CPUSchedulingResetOnFork: bool = "b",
66 CPUSetPartition: CpusetPartition = "s",
67 CPUWeight: u64 = "t",
68 CacheDirectory: Vec<String> = "as",
69 CacheDirectoryAccounting: bool = "b",
70 CacheDirectoryMode: u32 = "u",
71 CacheDirectoryQuota: DirectoryQuota = "(tus)",
72 CacheDirectorySymlink: Vec<DirectorySymlink> = "a(sst)",
73 CapabilityBoundingSet: u64 = "t",
74 CollectMode: CollectMode = "s",
75 Conditions: Vec<Condition> = "a(sbbs)",
76 ConfigurationDirectory: Vec<String> = "as",
77 ConfigurationDirectoryMode: u32 = "u",
78 Conflicts: Vec<String> = "as",
79 CoredumpFilter: u64 = "t",
80 CoredumpReceive: bool = "b",
81 DefaultDependencies: bool = "b",
82 Delegate: bool = "b",
83 DelegateControllers: Vec<String> = "as",
84 DelegateNamespaces: u64 = "t",
85 DelegateSubgroup: String = "s",
86 Description: String = "s",
87 DeviceAllow: Vec<DeviceAllow> = "a(ss)",
88 DevicePolicy: CgroupDevicePolicy = "s",
89 DisableControllers: Vec<String> = "as",
90 Documentation: Vec<String> = "as",
91 DynamicUser: bool = "b",
92 Environment: Vec<String> = "as",
93 EnvironmentFiles: Vec<EnvironmentFile> = "a(sb)",
94 ExecCondition: Vec<ExecCommand> = "a(sasb)",
95 ExecConditionEx: Vec<ExecCommandEx> = "a(sasas)",
96 ExecPaths: Vec<String> = "as",
97 ExecReload: Vec<ExecCommand> = "a(sasb)",
98 ExecReloadEx: Vec<ExecCommandEx> = "a(sasas)",
99 ExecReloadPost: Vec<ExecCommand> = "a(sasb)",
100 ExecReloadPostEx: Vec<ExecCommandEx> = "a(sasas)",
101 ExecSearchPath: Vec<String> = "as",
102 ExecStart: Vec<ExecCommand> = "a(sasb)",
103 ExecStartEx: Vec<ExecCommandEx> = "a(sasas)",
104 ExecStartPost: Vec<ExecCommand> = "a(sasb)",
105 ExecStartPostEx: Vec<ExecCommandEx> = "a(sasas)",
106 ExecStartPre: Vec<ExecCommand> = "a(sasb)",
107 ExecStartPreEx: Vec<ExecCommandEx> = "a(sasas)",
108 ExecStop: Vec<ExecCommand> = "a(sasb)",
109 ExecStopEx: Vec<ExecCommandEx> = "a(sasas)",
110 ExecStopPost: Vec<ExecCommand> = "a(sasb)",
111 ExecStopPostEx: Vec<ExecCommandEx> = "a(sasas)",
112 ExitType: ServiceExitType = "s",
113 ExtensionDirectories: Vec<String> = "as",
114 ExtensionImagePolicy: String = "s",
115 ExtensionImages: Vec<ExtensionImage> = "a(sba(ss))",
116 FailureAction: EmergencyAction = "s",
117 FailureActionExitStatus: i32 = "i",
118 FileDescriptorStoreMax: u32 = "u",
119 FileDescriptorStorePreserve: ExecPreserveMode = "s",
120 FinalKillSignal: i32 = "i",
121 Group: String = "s",
122 GuessMainPID: bool = "b",
123 IOAccounting: bool = "b",
124 IODeviceLatencyTargetUSec: Vec<DeviceValue> = "a(st)",
125 IODeviceWeight: Vec<DeviceValue> = "a(st)",
126 IOPressureThresholdUSec: Usec = "t",
127 IOPressureWatch: CgroupPressureWatch = "s",
128 IOReadBandwidthMax: Vec<DeviceValue> = "a(st)",
129 IOReadIOPSMax: Vec<DeviceValue> = "a(st)",
130 IOSchedulingClass: i32 = "i",
131 IOSchedulingPriority: i32 = "i",
132 IOWeight: u64 = "t",
133 IOWriteBandwidthMax: Vec<DeviceValue> = "a(st)",
134 IOWriteIOPSMax: Vec<DeviceValue> = "a(st)",
135 IPAccounting: bool = "b",
136 IPAddressAllow: Vec<IpPrefix> = "a(iayu)",
137 IPAddressDeny: Vec<IpPrefix> = "a(iayu)",
138 IPCNamespacePath: String = "s",
139 IPEgressFilterPath: Vec<String> = "as",
140 IPIngressFilterPath: Vec<String> = "as",
141 IgnoreOnIsolate: bool = "b",
142 IgnoreSIGPIPE: bool = "b",
143 ImportCredential: Vec<String> = "as",
144 ImportCredentialEx: Vec<ImportCredential> = "a(ss)",
145 InaccessibleDirectories: Vec<String> = "as",
146 InaccessiblePaths: Vec<String> = "as",
147 JobRunningTimeoutUSec: Usec = "t",
148 JobTimeoutAction: EmergencyAction = "s",
149 JobTimeoutRebootArgument: String = "s",
150 JobTimeoutUSec: Usec = "t",
151 JoinsNamespaceOf: Vec<String> = "as",
152 KeyringMode: ExecKeyringMode = "s",
153 KillMode: KillMode = "s",
154 KillSignal: i32 = "i",
155 LimitAS: u64 = "t",
156 LimitASSoft: u64 = "t",
157 LimitCORE: u64 = "t",
158 LimitCORESoft: u64 = "t",
159 LimitCPU: u64 = "t",
160 LimitCPUSoft: u64 = "t",
161 LimitDATA: u64 = "t",
162 LimitDATASoft: u64 = "t",
163 LimitFSIZE: u64 = "t",
164 LimitFSIZESoft: u64 = "t",
165 LimitLOCKS: u64 = "t",
166 LimitLOCKSSoft: u64 = "t",
167 LimitMEMLOCK: u64 = "t",
168 LimitMEMLOCKSoft: u64 = "t",
169 LimitMSGQUEUE: u64 = "t",
170 LimitMSGQUEUESoft: u64 = "t",
171 LimitNICE: u64 = "t",
172 LimitNICESoft: u64 = "t",
173 LimitNOFILE: u64 = "t",
174 LimitNOFILESoft: u64 = "t",
175 LimitNPROC: u64 = "t",
176 LimitNPROCSoft: u64 = "t",
177 LimitRSS: u64 = "t",
178 LimitRSSSoft: u64 = "t",
179 LimitRTPRIO: u64 = "t",
180 LimitRTPRIOSoft: u64 = "t",
181 LimitRTTIME: u64 = "t",
182 LimitRTTIMESoft: u64 = "t",
183 LimitSIGPENDING: u64 = "t",
184 LimitSIGPENDINGSoft: u64 = "t",
185 LimitSTACK: u64 = "t",
186 LimitSTACKSoft: u64 = "t",
187 LoadCredential: Vec<LoadCredential> = "a(ss)",
188 LoadCredentialEncrypted: Vec<LoadCredential> = "a(ss)",
189 LockPersonality: bool = "b",
190 LogExtraFields: Vec<Vec<u8>> = "aay",
191 LogFilterPatterns: Vec<LogFilterPattern> = "a(bs)",
192 LogLevelMax: i32 = "i",
193 LogNamespace: String = "s",
194 LogRateLimitBurst: u32 = "u",
195 LogRateLimitIntervalUSec: Usec = "t",
196 LogsDirectory: Vec<String> = "as",
197 LogsDirectoryAccounting: bool = "b",
198 LogsDirectoryMode: u32 = "u",
199 LogsDirectoryQuota: DirectoryQuota = "(tus)",
200 LogsDirectorySymlink: Vec<DirectorySymlink> = "a(sst)",
201 ManagedOOMMemoryPressure: ManagedOomMode = "s",
202 ManagedOOMMemoryPressureDurationUSec: Usec = "t",
203 ManagedOOMMemoryPressureLimit: u32 = "u",
204 ManagedOOMPreference: ManagedOomPreference = "s",
205 ManagedOOMSwap: ManagedOomMode = "s",
206 Markers: Vec<String> = "as",
207 MemoryAccounting: bool = "b",
208 MemoryDenyWriteExecute: bool = "b",
209 MemoryHigh: u64 = "t",
210 MemoryHighScale: u32 = "u",
211 MemoryKSM: bool = "b",
212 MemoryLow: u64 = "t",
213 MemoryLowScale: u32 = "u",
214 MemoryMax: u64 = "t",
215 MemoryMaxScale: u32 = "u",
216 MemoryMin: u64 = "t",
217 MemoryMinScale: u32 = "u",
218 MemoryPressureThresholdUSec: Usec = "t",
219 MemoryPressureWatch: CgroupPressureWatch = "s",
220 MemorySwapMax: u64 = "t",
221 MemorySwapMaxScale: u32 = "u",
222 MemoryTHP: ExecMemoryThp = "s",
223 MemoryZSwapMax: u64 = "t",
224 MemoryZSwapMaxScale: u32 = "u",
225 MemoryZSwapWriteback: bool = "b",
226 MountAPIVFS: bool = "b",
227 MountFlags: u64 = "t",
228 MountImagePolicy: String = "s",
229 MountImages: Vec<MountImage> = "a(ssba(ss))",
230 NFTSet: Vec<NftSet> = "a(iiss)",
231 NUMAMask: Vec<u8> = "ay",
232 NUMAPolicy: i32 = "i",
233 NetworkNamespacePath: String = "s",
234 Nice: i32 = "i",
235 NoExecPaths: Vec<String> = "as",
236 NoNewPrivileges: bool = "b",
237 NonBlocking: bool = "b",
238 NotifyAccess: NotifyAccess = "s",
239 OOMPolicy: OomPolicy = "s",
240 OOMRules: Vec<String> = "as",
241 OOMScoreAdjust: i32 = "i",
242 OnFailure: Vec<String> = "as",
243 OnFailureJobMode: JobMode = "s",
244 OnSuccess: Vec<String> = "as",
245 OnSuccessJobMode: JobMode = "s",
246 OpenFile: Vec<OpenFile> = "a(sst)",
247 PAMName: String = "s",
248 PIDFile: String = "s",
249 PartOf: Vec<String> = "as",
250 PassEnvironment: Vec<String> = "as",
251 PermissionsStartOnly: bool = "b",
252 Personality: String = "s",
253 PrivateBPF: PrivateBpf = "s",
254 PrivateDevices: bool = "b",
255 PrivateIPC: bool = "b",
256 PrivateMounts: bool = "b",
257 PrivateNetwork: bool = "b",
258 PrivatePIDs: PrivatePids = "s",
259 PrivateTmp: bool = "b",
260 PrivateTmpEx: PrivateTmp = "s",
261 PrivateUsers: bool = "b",
262 PrivateUsersEx: PrivateUsers = "s",
263 ProcSubset: ProcSubset = "s",
264 PropagatesReloadTo: Vec<String> = "as",
265 PropagatesStopTo: Vec<String> = "as",
266 ProtectClock: bool = "b",
267 ProtectControlGroups: bool = "b",
268 ProtectControlGroupsEx: ProtectControlGroups = "s",
269 ProtectHome: ProtectHome = "s",
270 ProtectHostname: bool = "b",
271 ProtectHostnameEx: ProtectHostnameEx = "(ss)",
272 ProtectKernelLogs: bool = "b",
273 ProtectKernelModules: bool = "b",
274 ProtectKernelTunables: bool = "b",
275 ProtectProc: ProtectProc = "s",
276 ProtectSystem: ProtectSystem = "s",
277 ReadOnlyDirectories: Vec<String> = "as",
278 ReadOnlyPaths: Vec<String> = "as",
279 ReadWriteDirectories: Vec<String> = "as",
280 ReadWritePaths: Vec<String> = "as",
281 RebootArgument: String = "s",
282 RefreshOnReload: Vec<RefreshOnReload> = "a(bs)",
283 RefuseManualStart: bool = "b",
284 RefuseManualStop: bool = "b",
285 ReloadPropagatedFrom: Vec<String> = "as",
286 ReloadSignal: i32 = "i",
287 RemainAfterExit: bool = "b",
288 RemoveIPC: bool = "b",
289 Requires: Vec<String> = "as",
290 RequiresMountsFor: Vec<String> = "as",
291 Requisite: Vec<String> = "as",
292 RequisiteOverridable: Vec<String> = "as",
293 Restart: ServiceRestart = "s",
294 RestartForceExitStatus: ExitStatusSet = "(aiai)",
295 RestartKillSignal: i32 = "i",
296 RestartMaxDelayUSec: Usec = "t",
297 RestartMode: ServiceRestartMode = "s",
298 RestartPreventExitStatus: ExitStatusSet = "(aiai)",
299 RestartSteps: u32 = "u",
300 RestartUSec: Usec = "t",
301 RestrictAddressFamilies: FilterList = "(bas)",
302 RestrictFileSystems: FilterList = "(bas)",
303 RestrictNamespaces: u64 = "t",
304 RestrictNetworkInterfaces: FilterList = "(bas)",
305 RestrictRealtime: bool = "b",
306 RestrictSUIDSGID: bool = "b",
307 RootDirectory: String = "s",
308 RootDirectoryStartOnly: bool = "b",
309 RootEphemeral: bool = "b",
310 RootHash: Vec<u8> = "ay",
311 RootHashPath: String = "s",
312 RootHashSignature: Vec<u8> = "ay",
313 RootHashSignaturePath: String = "s",
314 RootImage: String = "s",
315 RootImageOptions: Vec<MountOption> = "a(ss)",
316 RootImagePolicy: String = "s",
317 RootMStack: String = "s",
318 RootVerity: String = "s",
319 RuntimeDirectory: Vec<String> = "as",
320 RuntimeDirectoryMode: u32 = "u",
321 RuntimeDirectoryPreserve: ExecPreserveMode = "s",
322 RuntimeDirectorySymlink: Vec<DirectorySymlink> = "a(sst)",
323 RuntimeMaxUSec: Usec = "t",
324 RuntimeRandomizedExtraUSec: Usec = "t",
325 SELinuxContext: String = "s",
326 SecureBits: i32 = "i",
327 SendSIGHUP: bool = "b",
328 SendSIGKILL: bool = "b",
329 SetCredential: Vec<SetCredential> = "a(say)",
330 SetCredentialEncrypted: Vec<SetCredential> = "a(say)",
331 SetLoginEnvironment: bool = "b",
332 Slice: String = "s",
333 SmackProcessLabel: SecurityLabel = "(bs)",
334 SocketBindAllow: Vec<SocketBind> = "a(iiqq)",
335 SocketBindDeny: Vec<SocketBind> = "a(iiqq)",
336 SourcePath: String = "s",
337 StandardErrorFile: String = "s",
338 StandardErrorFileDescriptorName: String = "s",
339 StandardErrorFileToAppend: String = "s",
340 StandardErrorFileToTruncate: String = "s",
341 StandardInputData: Vec<u8> = "ay",
342 StandardInputFile: String = "s",
343 StandardInputFileDescriptorName: String = "s",
344 StandardOutputFile: String = "s",
345 StandardOutputFileDescriptorName: String = "s",
346 StandardOutputFileToAppend: String = "s",
347 StandardOutputFileToTruncate: String = "s",
348 StartLimitAction: EmergencyAction = "s",
349 StartLimitBurst: u32 = "u",
350 StartLimitIntervalUSec: Usec = "t",
351 StartupAllowedCPUs: Vec<u8> = "ay",
352 StartupAllowedMemoryNodes: Vec<u8> = "ay",
353 StartupCPUWeight: u64 = "t",
354 StartupIOWeight: u64 = "t",
355 StartupMemoryHigh: u64 = "t",
356 StartupMemoryLow: u64 = "t",
357 StartupMemoryMax: u64 = "t",
358 StartupMemorySwapMax: u64 = "t",
359 StartupMemoryZSwapMax: u64 = "t",
360 StateDirectory: Vec<String> = "as",
361 StateDirectoryAccounting: bool = "b",
362 StateDirectoryMode: u32 = "u",
363 StateDirectoryQuota: DirectoryQuota = "(tus)",
364 StateDirectorySymlink: Vec<DirectorySymlink> = "a(sst)",
365 StopPropagatedFrom: Vec<String> = "as",
366 StopWhenUnneeded: bool = "b",
367 SuccessAction: EmergencyAction = "s",
368 SuccessActionExitStatus: i32 = "i",
369 SuccessExitStatus: ExitStatusSet = "(aiai)",
370 SupplementaryGroups: Vec<String> = "as",
371 SurviveFinalKillSignal: bool = "b",
372 SyslogFacility: i32 = "i",
373 SyslogIdentifier: String = "s",
374 SyslogLevel: i32 = "i",
375 SyslogLevelPrefix: bool = "b",
376 SystemCallArchitectures: Vec<String> = "as",
377 SystemCallErrorNumber: i32 = "i",
378 SystemCallFilter: FilterList = "(bas)",
379 SystemCallLog: FilterList = "(bas)",
380 TTYColumns: u32 = "u",
381 TTYPath: String = "s",
382 TTYReset: bool = "b",
383 TTYRows: u32 = "u",
384 TTYVHangup: bool = "b",
385 TTYVTDisallocate: bool = "b",
386 TasksAccounting: bool = "b",
387 TasksMax: u64 = "t",
388 TasksMaxScale: u32 = "u",
389 TemporaryFileSystem: Vec<TmpFs> = "a(ss)",
390 TimeoutAbortUSec: Usec = "t",
391 TimeoutStartFailureMode: ServiceTimeoutFailureMode = "s",
392 TimeoutStartUSec: Usec = "t",
393 TimeoutStopFailureMode: ServiceTimeoutFailureMode = "s",
394 TimeoutStopUSec: Usec = "t",
395 TimerSlackNSec: u64 = "t",
396 Type: ServiceType = "s",
397 UMask: u32 = "u",
398 USBFunctionDescriptors: String = "s",
399 USBFunctionStrings: String = "s",
400 UnsetEnvironment: Vec<String> = "as",
401 Upholds: Vec<String> = "as",
402 User: String = "s",
403 UserNamespacePath: String = "s",
404 UtmpIdentifier: String = "s",
405 UtmpMode: ExecUtmpMode = "s",
406 Wants: Vec<String> = "as",
407 WantsMountsFor: Vec<String> = "as",
408 WatchdogSignal: i32 = "i",
409 WatchdogUSec: Usec = "t",
410 WorkingDirectory: String = "s",
411}