puppet: Create memcached PID file that systemd config file specifies.

The systemd config file installed by the `memcached` package assumes
there will be a PID written to `/run/memcached/memcached.pid`.  Since we
override `memcached.conf`, we have omitted the line that writes out the
PID to this file.

Systemd is smart enough to not _need_ the PID file to start up the
service correctly, but match the configuration.  We create the
directory since the package does not do so.  It is created as
`/run/memcached` and not `/var/run/memcached` because `/var/run` is a
symlink to `/run`.
This commit is contained in:
Alex Vandiver 2021-12-11 02:26:28 +00:00 committed by Tim Abbott
parent 16db496871
commit a6c2079502
2 changed files with 11 additions and 1 deletions

View File

@ -99,9 +99,16 @@ Environment=SASL_CONF_PATH=/etc/sasl2
mode => '0644', mode => '0644',
content => template('zulip/memcached.conf.template.erb'), content => template('zulip/memcached.conf.template.erb'),
} }
file { '/run/memcached':
ensure => 'directory',
owner => 'memcache',
group => 'memcache',
mode => '0755',
require => Package[$memcached_packages],
}
service { 'memcached': service { 'memcached':
ensure => running, ensure => running,
subscribe => File['/etc/memcached.conf'], subscribe => File['/etc/memcached.conf'],
require => Class['zulip::systemd_daemon_reload']; require => [File['/run/memcached'], Class['zulip::systemd_daemon_reload']],
} }
} }

View File

@ -46,5 +46,8 @@ logfile /var/log/memcached.log
# Maximize core file limit # Maximize core file limit
# -r # -r
# Use a pidfile
-P /var/run/memcached/memcached.pid
# Enable SASL authentication # Enable SASL authentication
-S -S