1 From f74056bec3910ef03b6e993084731b482ba359ba Mon Sep 17 00:00:00 2001
2 From: anthraxx <levente@leventepolyak.net>
3 Date: Wed, 19 Dec 2018 01:00:32 +0100
4 Subject: [PATCH] modern configuration purely using systemd overrides
7 scripts/memcached.service | 12 ++++++++++--
8 scripts/memcached@.service | 15 +++++++++------
9 2 files changed, 19 insertions(+), 8 deletions(-)
11 diff --git a/scripts/memcached.service b/scripts/memcached.service
12 index 88a4b8a..3a1e87e 100644
13 --- a/scripts/memcached.service
14 +++ b/scripts/memcached.service
18 # Environment=OPTIONS="-l 127.0.0.1,::1"
20 +# To use the "instanced" version of this, just start 'memcached@11211' or
21 +# whatever port you'd like.
25 @@ -14,8 +17,13 @@ Description=memcached daemon
29 -EnvironmentFile=/etc/sysconfig/memcached
30 -ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
32 +Environment=CACHESIZE=64
33 +Environment=MAXCONN=1024
34 +Environment=LISTEN="-l 127.0.0.1,::1"
35 +Environment=OPTIONS="-o modern,drop_privileges"
36 +ExecStart=/usr/bin/memcached -m ${CACHESIZE} -c ${MAXCONN} $LISTEN $OPTIONS
39 # Set up a new file system namespace and mounts private /tmp and /var/tmp
40 # directories so this service cannot access the global directories and
41 diff --git a/scripts/memcached@.service b/scripts/memcached@.service
42 index 4e9f1d7..e666da9 100644
43 --- a/scripts/memcached@.service
44 +++ b/scripts/memcached@.service
46 # Environment=OPTIONS="-l 127.0.0.1,::1"
48 # To use the "instanced" version of this, just start 'memcached@11211' or
49 -# whatever port you'd like. If /etc/sysconfig/memcached.<port> exists, it
50 -# will be read first, so you can set different parameters for a given
52 +# whatever port you'd like.
56 Description=memcached daemon
60 -EnvironmentFile=/etc/sysconfig/memcached
61 -EnvironmentFile=-/etc/sysconfig/memcached.%i
62 -ExecStart=/usr/bin/memcached -p %i -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
64 +Environment=CACHESIZE=64
65 +Environment=MAXCONN=1024
66 +Environment=LISTEN="-l 127.0.0.1,::1"
67 +Environment=OPTIONS="-o modern,drop_privileges"
68 +ExecStart=/usr/bin/memcached -p %i -m ${CACHESIZE} -c ${MAXCONN} $LISTEN $OPTIONS
71 # Set up a new file system namespace and mounts private /tmp and /var/tmp
72 # directories so this service cannot access the global directories and