Skip to content

Commit 15e2421

Browse files
committed
Merge pull request #313 from deviantony/file-limit
Added ulimit support
2 parents eb3d546 + 741aa81 commit 15e2421

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

manifests/config.pp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@
9898
require => File['/etc/rabbitmq'],
9999
}
100100

101+
if $::osfamily == 'Debian' {
102+
file { '/etc/default/rabbitmq-server':
103+
ensure => file,
104+
content => template('rabbitmq/default.erb'),
105+
mode => '0644',
106+
owner => '0',
107+
group => '0',
108+
notify => Class['rabbitmq::service'],
109+
}
110+
}
111+
101112
if $config_cluster {
102113

103114
if $erlang_cookie == undef {
@@ -115,7 +126,4 @@
115126
}
116127
}
117128
}
118-
119-
120129
}
121-

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
$version = $rabbitmq::params::version,
5959
$wipe_db_on_cookie_change = $rabbitmq::params::wipe_db_on_cookie_change,
6060
$cluster_partition_handling = $rabbitmq::params::cluster_partition_handling,
61+
$file_limit = $rabbitmq::params::file_limit,
6162
$environment_variables = $rabbitmq::params::environment_variables,
6263
$config_variables = $rabbitmq::params::config_variables,
6364
$config_kernel_variables = $rabbitmq::params::config_kernel_variables,
@@ -93,6 +94,7 @@
9394
validate_re($stomp_port, '\d+')
9495
validate_bool($wipe_db_on_cookie_change)
9596
validate_bool($tcp_keepalive)
97+
validate_re($file_limit, '\d+')
9698
# Validate service parameters.
9799
validate_re($service_ensure, '^(running|stopped)$')
98100
validate_bool($service_manage)

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@
116116
$environment_variables = {}
117117
$config_variables = {}
118118
$config_kernel_variables = {}
119+
$file_limit = 16384
119120
}

templates/default.erb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# File managed by Puppet.
2+
3+
# This file is sourced by /etc/init.d/rabbitmq-server. Its primary
4+
# reason for existing is to allow adjustment of system limits for the
5+
# rabbitmq-server process.
6+
#
7+
# Maximum number of open file handles. This will need to be increased
8+
# to handle many simultaneous connections. Refer to the system
9+
# documentation for ulimit (in man bash) for more information.
10+
ulimit -n <%= @file_limit %>

0 commit comments

Comments
 (0)