Skip to content

Commit b3ee352

Browse files
authored
Merge pull request #120 from cschwede/feature/master/configurable_pidfile
Add option to change pid_file setting
2 parents 66ef64c + 6d26f1b commit b3ee352

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

README.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ Rsync comment.
266266

267267
File containing motd info.
268268

269+
##### `pid_file`
270+
271+
PID file. Defaults to /var/run/rsyncd.pid. The pid file parameter won't be applied if set to "UNSET"; rsyncd will not use a PID file in this case.
272+
269273
##### `read_only`
270274

271275
yes||no

manifests/server.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
$use_xinetd = true,
1111
$address = '0.0.0.0',
1212
$motd_file = 'UNSET',
13+
Variant[Enum['UNSET'], Stdlib::Absolutepath] $pid_file = '/var/run/rsyncd.pid',
1314
$use_chroot = 'yes',
1415
$uid = 'nobody',
1516
$gid = 'nobody',

spec/classes/server_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
})
1818
is_expected.to contain_concat__fragment('rsyncd_conf_header').with_content(/^use chroot\s*=\s*yes$/)
1919
is_expected.to contain_concat__fragment('rsyncd_conf_header').with_content(/^address\s*=\s*0.0.0.0$/)
20+
is_expected.to contain_concat__fragment('rsyncd_conf_header').with_content(/^pid file\s*=\s*\/var\/run\/rsyncd.pid$/)
2021
}
2122
end
2223

@@ -48,6 +49,16 @@
4849
}
4950
end
5051

52+
describe 'when unsetting pid file' do
53+
let :params do
54+
{ :pid_file => 'UNSET' }
55+
end
56+
57+
it {
58+
is_expected.not_to contain_concat__fragment('rsyncd_conf_header').with_content(/^pid file\s*=/)
59+
}
60+
end
61+
5162
describe 'when overriding use_chroot' do
5263
let :params do
5364
{ :use_chroot => 'no' }

templates/header.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# This file is being maintained by Puppet.
22
# DO NOT EDIT
33

4-
pid file = /var/run/rsyncd.pid
4+
<% if @pid_file != 'UNSET' -%>
5+
pid file = <%= @pid_file %>
6+
<% end -%>
57
uid = <%= @uid %>
68
gid = <%= @gid %>
79
use chroot = <%= @use_chroot %>

0 commit comments

Comments
 (0)