From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbBF2-0004HX-1A for guix-patches@gnu.org; Fri, 28 Jul 2017 15:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbBEx-0008Up-5Q for guix-patches@gnu.org; Fri, 28 Jul 2017 15:48:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbBEx-0008Uh-1L for guix-patches@gnu.org; Fri, 28 Jul 2017 15:48:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dbBEw-0005nU-PW for guix-patches@gnu.org; Fri, 28 Jul 2017 15:48:02 -0400 Subject: [bug#27853] [PATCH 2/2] services: Add memcached. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170727174531.43424168@cbaines.net> <20170727164905.16662-1-mail@cbaines.net> <20170727164905.16662-2-mail@cbaines.net> Date: Fri, 28 Jul 2017 21:46:52 +0200 In-Reply-To: <20170727164905.16662-2-mail@cbaines.net> (Christopher Baines's message of "Thu, 27 Jul 2017 17:49:05 +0100") Message-ID: <87lgn8l4yb.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 27853@debbugs.gnu.org Christopher Baines 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. [...] > +@node Cache Services > +@subsubsection Cache Services > + > +@cindex cache Please write a couple of introductory sentences here. :-) I was going to suggest to document it under =E2=80=9CWeb=E2=80=9D, but I gu= ess this is not inherently web-specific, so it=E2=80=99s probably better this way. > +(define-record-type* > + memcached-configuration make-memcached-configuration > + memcached-configuration? > + (memcached memcached-configuration-memcached ; > + (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" > + ,#$@additional-options) > + #:log-file "/var/log/memcached")) > + (stop #~(make-kill-destructor)))))))) If memcached has an option to create a PID file, it=E2=80=99s 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 =E2=80=98make-forkexec-constructor/container= =E2=80=99? 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=E2=80=99.