Subject: Re: [bug#32771] [PATCH 2/2] services: Add Varnish service.

From: Christopher Baines <[email-masked]>
Date: Fri, 28 Sep 2018 20:35:40 +0100

Marius Bakke <[email-masked]> writes:

> Christopher Baines <[email-masked]> 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 :)