From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5yYZ-0006sv-4p for guix-patches@gnu.org; Fri, 28 Sep 2018 15:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5yYU-0002Vo-3o for guix-patches@gnu.org; Fri, 28 Sep 2018 15:36:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5yYT-0002Vb-Tu for guix-patches@gnu.org; Fri, 28 Sep 2018 15:36:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g5yYT-00087k-Mq for guix-patches@gnu.org; Fri, 28 Sep 2018 15:36:01 -0400 Subject: [bug#32771] [PATCH 2/2] services: Add Varnish service. Resent-Message-ID: References: <20180919133027.12799-1-mbakke@fastmail.com> <20180919133027.12799-2-mbakke@fastmail.com> <87va6xwbq0.fsf@cbaines.net> <87ftxxkx4s.fsf@fastmail.com> From: Christopher Baines In-reply-to: <87ftxxkx4s.fsf@fastmail.com> Date: Fri, 28 Sep 2018 20:35:40 +0100 Message-ID: <87in2pjtyr.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Marius Bakke Cc: 32771-done@debbugs.gnu.org --=-=-= Content-Type: text/plain Marius Bakke writes: > Christopher Baines writes: > >> Also, I wonder if you'd considered supporing running multiple instances >> of varnishd, I guess the "name" might come in useful then. > > If you read the system test closely, you'll notice it does actually run > multiple instances, one proxying the other, and testing different > aspects of the service definition :-) Huh, I made this comment based off the service itself. I didn't quite realise you could just have multiple services of the same type without handling that explicitly in the service type. >>> +@c Varnish does not support HTTPS, so keep this URL to avoid confusion. >>> +For example, to mirror @url{http://www.gnu.org,www.gnu.org} with VCL you >>> +can do something along these lines: >> >> Does "@c" mean a comment? > > Yes. Ah, I think I get it now. I was reading this comment as being the whole block, but now I see it's only the line about the use of HTTP. >>> +(define %varnish-accounts >>> + (list (user-group >>> + (name "varnish") >>> + (system? #t)) >>> + (user-account >>> + (name "varnish") >>> + (group "varnish") >>> + (system? #t) >>> + (comment "Varnish Cache User") >>> + (home-directory "/var/varnish") >>> + (shell (file-append shadow "/sbin/nologin"))))) >>> + >>> +(define %varnish-activation >>> + #~(begin >>> + (use-modules (guix build utils)) >>> + (let ((home-dir "/var/varnish") >>> + (user (getpwnam "varnish"))) >>> + (mkdir-p home-dir) >>> + (chown home-dir (passwd:uid user) (passwd:gid user)) >>> + (chmod home-dir #o755)))) >> >> Is this necessary, as I think the users home directory might be >> automatically created? > > You are correct! I removed the activation script. Great :) >> Anyway, this looks pretty much good to me. > > Thank you very much for reviewing :-) > > Pushed as 3b97a1779f3b65d582b8edc8c154b6414314b946. Awesome :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAluugoxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfCOw/7BuxOrxqrh1evSm4/vCC2FpLFZVo2avDqnVTYmuVFBKXDPrsywLbFpdjY gurRQhd8DRlitvo9ZBUdcMAqDezYH2tjK2zeTUE+OdxbrbHnh04qLFm22KNEPbFJ nyH+z69+On6UZ6fEhy/gAuxNA1kkOXgQIJoBvtpc/XmoRECeMFt/4cIbGebeVnzU rj4WCI2bYguoku3jljt6C+fwGmZREuyJJl27G4HjXSFyAFFVuCoGkLTs9bXR8E3E KYMyq63u9c0WJxj9Tv3iWubZGx4thVq8bulx1WXO3+dBmg2Fvcki3B6GKuKiSBDW I5WxOhPJiSKp62lTFV7FPTDbV8TIkF0dHdfoWUNnW4On3DcjG1Gk2eywWfOCGFxo JebmWC/+CzwWCc9hxCxl1o8oEJzPyvrMiPIDmewYSxDMTP7TDacqeKauBW3g3RGT ezxAgSTqZV59/j46K369ClSDu0ATpNw22x2SVnPJAsM/zubQo8DAiJLRpFkTax4l i9CR7UZpxMKXzBWnz8uOVxfQRzsTAxB+YSF1fyTGKaAndt6vnyIMCu1LjTjyFVn3 il/GvJEndGIfYU+w7rL7VKqQjoOcCZMlqJPRpmadyBY3rTsPY4F0ozqW5mVb6aPS KvSW1MR/ei9i6ekRbEg/2PGbboaf4qlOiA5n003nSN3PP+hMg1U= =wDcq -----END PGP SIGNATURE----- --=-=-=--