[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: services: Add nginx-service.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] gnu: services: Add nginx-service. |
Date: |
Tue, 18 Aug 2015 17:58:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
"Thompson, David" <address@hidden> skribis:
> From c2da6c04eb1a12d0ee2f56a3954673f3bddc122b Mon Sep 17 00:00:00 2001
> From: David Thompson <address@hidden>
> Date: Sun, 2 Aug 2015 23:29:53 -0400
> Subject: [PATCH] gnu: services: Add nginx-service.
>
> * gnu/services/web.scm: New file.
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
[...]
> +(define (default-nginx-config log-directory run-directory)
> + (text-file* "nginx.conf"
> + "user nginx nginx;\n"
> + "pid " run-directory "/pid;\n"
> + "error_log " log-directory "/error.log info;\n"
> + "http {\n"
> + " access_log " log-directory "/access.log;\n"
> + " root /var/www;\n"
> + " server {}\n"
> + "}\n"
> + "events {}\n"))
> +
> +(define* (nginx-service #:key (nginx nginx)
> + (log-directory "/var/log/nginx")
> + (run-directory "/var/run/nginx")
> + (config-file
> + (default-nginx-config log-directory run-directory)))
There’s this annoying thing that here ‘config-file’ is a monadic value
when we’d instead prefer a “file-like object.”
To work around it you could use ‘plain-file’ and make the default config
file independent of the parameters. The obvious issue is that if the
user specifies LOG-DIRECTORY or RUN-DIRECTORY different from the
default, yet use the default config files, things will break. But maybe
that’s an acceptable drawback?
Lastly, could you add a “Web Services” section under “Services” in the
manual?
Thanks!
Ludo’.