Skip to content

Commit

Permalink
Support StartLimitIntervalSec and StartLimitBurst
Browse files Browse the repository at this point in the history
Allow `StartLimitIntervalSec` and `StartLimitBurst` to be set
in the `[unit]` section of a managed drop or unit file.

https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#StartLimitIntervalSec=interval
  • Loading branch information
traylenator committed Feb 12, 2024
1 parent 18ac058 commit 3628f31
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,8 @@ Struct[{
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsMountPoint'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['StartLimitIntervalSec'] => String[1],
Optional['StartLimitBurst'] => Integer[1],
}]
```

5 changes: 5 additions & 0 deletions spec/type_aliases/systemd_unit_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => 'not/an/absolute/path' }) }
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => ['not/a/path'] }) }
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => [] }) }

it { is_expected.to allow_value({ 'StartLimitIntervalSec' => '12 hours' }) }
it { is_expected.to allow_value({ 'StartLimitIntervalSec' => 'infinity' }) }
it { is_expected.to allow_value({ 'StartLimitBurst' => 5 }) }
it { is_expected.not_to allow_value({ 'StartLimitBurst' => '5' }) }
end
2 changes: 2 additions & 0 deletions types/unit/unit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsMountPoint'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['StartLimitIntervalSec'] => String[1],
Optional['StartLimitBurst'] => Integer[1],
}
]

0 comments on commit 3628f31

Please sign in to comment.