From a6c2079502397f5ed75fd1383da2f9f265f6c29b Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Sat, 11 Dec 2021 02:26:28 +0000 Subject: [PATCH] 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`. --- puppet/zulip/manifests/profile/memcached.pp | 9 ++++++++- puppet/zulip/templates/memcached.conf.template.erb | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/puppet/zulip/manifests/profile/memcached.pp b/puppet/zulip/manifests/profile/memcached.pp index ad3c5226f1..ec049a96b2 100644 --- a/puppet/zulip/manifests/profile/memcached.pp +++ b/puppet/zulip/manifests/profile/memcached.pp @@ -99,9 +99,16 @@ Environment=SASL_CONF_PATH=/etc/sasl2 mode => '0644', content => template('zulip/memcached.conf.template.erb'), } + file { '/run/memcached': + ensure => 'directory', + owner => 'memcache', + group => 'memcache', + mode => '0755', + require => Package[$memcached_packages], + } service { 'memcached': ensure => running, subscribe => File['/etc/memcached.conf'], - require => Class['zulip::systemd_daemon_reload']; + require => [File['/run/memcached'], Class['zulip::systemd_daemon_reload']], } } diff --git a/puppet/zulip/templates/memcached.conf.template.erb b/puppet/zulip/templates/memcached.conf.template.erb index 64a57f6fa3..ba8f8acc78 100644 --- a/puppet/zulip/templates/memcached.conf.template.erb +++ b/puppet/zulip/templates/memcached.conf.template.erb @@ -46,5 +46,8 @@ logfile /var/log/memcached.log # Maximize core file limit # -r +# Use a pidfile +-P /var/run/memcached/memcached.pid + # Enable SASL authentication -S