diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-08-21 02:40:37 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-08-21 02:40:37 +0200 |
commit | 2718a9cd096d0f5ae4b23cc0814a42aee5cf3c4d (patch) | |
tree | 334bed3ef9be203d77065a75380696c2537ede92 /gnu/services/databases.scm | |
parent | 9c4ce3afac2ad42c832dc7a9f0932744b5fd8892 (diff) | |
parent | e904de7ec1789e243e830b19187b5ef550b2eefa (diff) | |
download | patches-2718a9cd096d0f5ae4b23cc0814a42aee5cf3c4d.tar patches-2718a9cd096d0f5ae4b23cc0814a42aee5cf3c4d.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/services/databases.scm')
-rw-r--r-- | gnu/services/databases.scm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 3b64d0e075..de1f6b8411 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -216,6 +216,14 @@ and stores the database cluster in @var{data-directory}." (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) +(define memcached-activation + #~(begin + (use-modules (guix build utils)) + (let ((user (getpwnam "memcached"))) + (mkdir-p "/var/run/memcached") + (chown "/var/run/memcached" + (passwd:uid user) (passwd:gid user))))) + (define memcached-shepherd-service (match-lambda (($ <memcached-configuration> memcached interfaces tcp-port udp-port @@ -233,11 +241,14 @@ and stores the database cluster in @var{data-directory}." "-p" #$(number->string tcp-port) "-U" #$(number->string udp-port) "--daemon" - "-P" "/var/run/memcached.pid" + ;; Memcached changes to the memcached user prior to + ;; writing the pid file, so write it to a directory + ;; that memcached owns. + "-P" "/var/run/memcached/pid" "-u" "memcached" ,#$@additional-options) #:log-file "/var/log/memcached" - #:pid-file "/var/run/memcached.pid")) + #:pid-file "/var/run/memcached/pid")) (stop #~(make-kill-destructor)))))))) (define memcached-service-type @@ -245,6 +256,8 @@ and stores the database cluster in @var{data-directory}." (extensions (list (service-extension shepherd-root-service-type memcached-shepherd-service) + (service-extension activation-service-type + (const memcached-activation)) (service-extension account-service-type (const %memcached-accounts)))) (default-value (memcached-configuration)))) |