File: 02_service_wrapper.patch

package info (click to toggle)
memcached 1.5.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,696 kB
  • sloc: ansic: 16,931; perl: 5,523; sh: 4,302; xml: 1,638; python: 393; makefile: 170
file content (37 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download
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
From: Guillaume Delacour <gui@iroqwa.org>
Description: Additions for service unit file
 - Use wrapper script for /etc/memcached.conf
 - Document man page
 - Use a pidfile
 - Try to automatically restart the service when
Last-Update: 2017-09-13
Forwarded: not-needed

Index: memcached/scripts/memcached.service
===================================================================
--- memcached.orig/scripts/memcached.service
+++ memcached/scripts/memcached.service
@@ -12,10 +12,10 @@
 [Unit]
 Description=memcached daemon
 After=network.target
+Documentation=man:memcached(1)
 
 [Service]
-EnvironmentFile=/etc/sysconfig/memcached
-ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
+ExecStart=/usr/share/memcached/scripts/systemd-memcached-wrapper /etc/memcached.conf
 
 # Set up a new file system namespace and mounts private /tmp and /var/tmp
 # directories so this service cannot access the global directories and
@@ -68,5 +68,10 @@ RestrictAddressFamilies=AF_INET AF_INET6
 # Takes away the ability to create or manage any kind of namespace
 ##safer##RestrictNamespaces=true
 
+PIDFile=/var/run/memcached/memcached.pid
+
+# try to restart if errors encountered
+Restart=always
+
 [Install]
 WantedBy=multi-user.target