Skip to content

Commit a9feee1

Browse files
authored
Merge pull request #352 from traylenator/workingdir
Allow WorkingDirectory to be specified in [Service]
2 parents cb12fe8 + c785f4f commit a9feee1

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

REFERENCE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,7 @@ Struct[{
23162316
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
23172317
Optional['User'] => String[1],
23182318
Optional['Group'] => String[1],
2319+
Optional['WorkingDirectory'] => String[0],
23192320
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
23202321
Optional['ExitType'] => Enum['main', 'cgroup'],
23212322
Optional['RemainAfterExit'] => Boolean,

spec/type_aliases/systemd_unit_service_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@
4444
it { is_expected.to allow_value({ 'Group' => 'root' }) }
4545
it { is_expected.to allow_value({ 'StandardOutput' => 'null' }) }
4646
it { is_expected.to allow_value({ 'StandardError' => 'null' }) }
47+
48+
it { is_expected.to allow_value({ 'WorkingDirectory' => '/var/lib/here' }) }
49+
it { is_expected.to allow_value({ 'WorkingDirectory' => '-/var/lib/here' }) }
50+
it { is_expected.to allow_value({ 'WorkingDirectory' => '~' }) }
51+
it { is_expected.to allow_value({ 'WorkingDirectory' => '' }) }
4752
end

types/unit/service.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
88
Optional['User'] => String[1],
99
Optional['Group'] => String[1],
10+
Optional['WorkingDirectory'] => String[0],
1011
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
1112
Optional['ExitType'] => Enum['main', 'cgroup'],
1213
Optional['RemainAfterExit'] => Boolean,

0 commit comments

Comments
 (0)