guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#27853] [PATCH 2/2] services: Add memcached.


From: Ludovic Courtès
Subject: [bug#27853] [PATCH 2/2] services: Add memcached.
Date: Fri, 28 Jul 2017 21:46:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Christopher Baines <address@hidden> skribis:

> * gnu/services/memcached.scm: New file.
> * gnu/tests/memcached.scm: New file.
> * doc/guix.texi (Cache Services): New node.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add entry for services/memcached.scm and
>   tests/memcached.scm.

[...]

> address@hidden Cache Services
> address@hidden Cache Services
> +
> address@hidden cache

Please write a couple of introductory sentences here.  :-)

I was going to suggest to document it under “Web”, but I guess this is
not inherently web-specific, so it’s probably better this way.

> +(define-record-type* <memcached-configuration>
> +  memcached-configuration make-memcached-configuration
> +  memcached-configuration?
> +  (memcached          memcached-configuration-memcached ;<package>
> +                      (default memcached))
> +  (interfaces         memcached-configuration-interfaces
> +                      (default '("0.0.0.0")))

Should it default to 127.0.0.1 to avoid bad surprises?

> +              (start #~(make-forkexec-constructor
> +                        `(#$(file-append memcached "/bin/memcached")
> +                          "-l" #$(string-join interfaces ",")
> +                          "-p" #$(number->string tcp-port)
> +                          "-U" #$(number->string udp-port)
> +                          "-u" "memcached"
> +                          ,address@hidden)
> +                        #:log-file "/var/log/memcached"))
> +              (stop #~(make-kill-destructor))))))))

If memcached has an option to create a PID file, it’s better to use it
and pass #:pid-file here (makes sure memcached is really listening when
the service is started.)

Perhaps a good candidate for ‘make-forkexec-constructor/container’?  We
can check that afterwards though.

> +(define %test-memcached
> +  (system-test
> +   (name "memcached")
> +   (description "Connect to a running MEMCACHED server.")
> +   (value (run-memcached-test))))

Awesome.

OK with these changes, thank you!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]