Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Our default inetd system, used by both Red Hat and Debian.
class base::xinetd {
package { 'xinetd': ensure => present }
# Ensure service is running. We have a custom restart action because we
# had problems with Puppet starting or restarting xinetd with a broken
# environment containing debconf environment variables and other things.
# The below ensures that it restarts with a clean environment.
$path = '/bin:/usr/bin:/sbin:/usr/sbin'
service { 'xinetd':
ensure => running,
name => 'xinetd',
enable => true,
hasstatus => false,
status => 'pidof xinetd',
restart => "/usr/bin/env - PATH=$path /etc/init.d/xinetd restart",
require => Package['xinetd'],
}
# Purge all configs not provided by puppet.
file { '/etc/xinetd.d':
ensure => directory,
purge => true,
recurse => true,
notify => Service['xinetd'],
require => Package['xinetd'],
}
# Point people looking at the wrong file to the right place.
if ($::operatingsystem == 'Debian') or ($::operatingsystem == 'Ubuntu') {
file { '/etc/inetd.conf':
content => "# Disabled, using xinetd instead\n",
}
}
# Install the filter-syslog rules.
file { '/etc/filter-syslog/xinetd':
source => 'puppet:///modules/base/xinetd/etc/filter-syslog/xinetd',
}
}
# Disable xinetd if don't want (x)inetd running
class base::xinetd::disabled {
service {'xinetd': ensure => stopped }
}