Skip to content

Commit

Permalink
Merge pull request voxpupuli#352 from traylenator/workingdir
Browse files Browse the repository at this point in the history
Allow WorkingDirectory to be specified in [Service]
  • Loading branch information
traylenator authored Jun 15, 2023
2 parents cb12fe8 + c785f4f commit a9feee1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,7 @@ Struct[{
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Optional['RemainAfterExit'] => Boolean,
Expand Down
5 changes: 5 additions & 0 deletions spec/type_aliases/systemd_unit_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@
it { is_expected.to allow_value({ 'Group' => 'root' }) }
it { is_expected.to allow_value({ 'StandardOutput' => 'null' }) }
it { is_expected.to allow_value({ 'StandardError' => 'null' }) }

it { is_expected.to allow_value({ 'WorkingDirectory' => '/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '-/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '~' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '' }) }
end
1 change: 1 addition & 0 deletions types/unit/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Optional['RemainAfterExit'] => Boolean,
Expand Down

0 comments on commit a9feee1

Please sign in to comment.