Skip to content

Commit

Permalink
Merge pull request #51 from jburnham/feature/pidfile-support
Browse files Browse the repository at this point in the history
Add support for custom and disabling of pidfiles.
  • Loading branch information
saz committed Nov 19, 2014
2 parents 57fdf41 + 7066392 commit 5869cad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ If you find this module useful, send some bitcoins to 1Na3YFUmdxKxJLiuRXQYJU2kiN

* $package_ensure = 'present'
* $logfile = '/var/log/memcached.log'
* $pidfile = '/var/run/memcached.pid' (Debian family only, set to false to disable pidfile)
* $max_memory = false
* $item_size = false
* $lock_memory = false (WARNING: good if used intelligently, google for -k key)
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class memcached (
$package_ensure = 'present',
$logfile = '/var/log/memcached.log',
$pidfile = '/var/run/memcached.pid',
$manage_firewall = false,
$max_memory = false,
$item_size = false,
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/memcached_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
:install_dev => true,
:processorcount => 1
},
{
:pidfile => false,
},
{
:pidfile => '/var/log/memcached.pid',
},
{
:package_ensure => 'absent',
:install_dev => true
Expand Down Expand Up @@ -185,6 +191,9 @@
if(param_hash[:lock_memory])
expected_lines.push("-k")
end
if(param_hash[:pidfile])
expected_lines.push("-P #{param_hash[:pidfile]}")
end
if(param_hash[:verbosity])
expected_lines.push("-vvv")
end
Expand Down
4 changes: 3 additions & 1 deletion templates/memcached.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# Run memcached as a daemon.
-d

<% if @pidfile -%>
# pidfile
-P /var/run/memcached.pid
-P <%= @pidfile %>
<% end -%>

# Log memcached's output
logfile <%= @logfile -%>
Expand Down

0 comments on commit 5869cad

Please sign in to comment.