unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] services: nginx: Actually check if configuration is valid.
@ 2016-09-09  2:05 Tobias Geerinckx-Rice
  2016-09-09  2:09 ` Thompson, David
  2016-09-09 22:41 ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-09-09  2:05 UTC (permalink / raw)
  To: guix-devel

* gnu/services/web.scm (nginx-activation): Fix path to nginx binary.
---

Hullo again!

I suspect not many people run nginx (or dovecot, but that's a different
matter) on Guix. The nginx activation script will now correctly print a
non-fatal error if the configuration smells off.

Why I'm mailing: was this intended to be fatal? It's easy to miss now.

Kind regards,

T G-R

 gnu/services/web.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index d86aab5..5b0e816 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -80,7 +80,7 @@
          (format #t "creating nginx run directory '~a'~%" #$run-directory)
          (mkdir-p #$run-directory)
          ;; Check configuration file syntax.
-         (system* (string-append #$nginx "/bin/nginx")
+         (system* (string-append #$nginx "/sbin/nginx")
                   "-c" #$config-file "-t")))))
 
 (define nginx-shepherd-service
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:05 [PATCH] services: nginx: Actually check if configuration is valid Tobias Geerinckx-Rice
@ 2016-09-09  2:09 ` Thompson, David
  2016-09-09  2:21   ` Tobias Geerinckx-Rice
  2016-09-09 22:41 ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: Thompson, David @ 2016-09-09  2:09 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

On Thu, Sep 8, 2016 at 10:05 PM, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> * gnu/services/web.scm (nginx-activation): Fix path to nginx binary.
> ---
>
> Hullo again!
>
> I suspect not many people run nginx (or dovecot, but that's a different
> matter) on Guix. The nginx activation script will now correctly print a
> non-fatal error if the configuration smells off.

Maybe this could be done at build-time instead?  Would be nice to know
that when you boot the system the nginx config will be valid.

- Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:09 ` Thompson, David
@ 2016-09-09  2:21   ` Tobias Geerinckx-Rice
  2016-09-09  2:29     ` Thompson, David
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-09-09  2:21 UTC (permalink / raw)
  To: dthompson2; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 509 bytes --]

Dave,

On 09/09/16 04:09, Thompson, David wrote:
> Maybe this could be done at build-time instead?

The nginx service points to a stateful configuration file, like
/etc/nginx.conf, that isn't built or handled by Guix.

I'd like that to change, but that will have to wait for now.

> Would be nice to know that when you boot the system the nginx config 
> will be valid.

It's currently printed near the end of ‘guix system reconfigure’, if
that's what you mean.

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:21   ` Tobias Geerinckx-Rice
@ 2016-09-09  2:29     ` Thompson, David
  2016-09-09  2:36       ` Tobias Geerinckx-Rice
  2016-09-09 22:42       ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Thompson, David @ 2016-09-09  2:29 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

On Thu, Sep 8, 2016 at 10:21 PM, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> Dave,
>
> On 09/09/16 04:09, Thompson, David wrote:
>> Maybe this could be done at build-time instead?
>
> The nginx service points to a stateful configuration file, like
> /etc/nginx.conf, that isn't built or handled by Guix.

No, it doesn't.  I wrote the nginx service.  The config file used is
part of the g-expression and is absolutely not stateful.

> I'd like that to change, but that will have to wait for now.
>
>> Would be nice to know that when you boot the system the nginx config
>> will be valid.
>
> It's currently printed near the end of ‘guix system reconfigure’, if
> that's what you mean.

I mean that it should throw an error before the system is made active.
The derivation that builds the service file should fail.  Not
suggesting it needs to be done right now, but I think it would be
cool.

- Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:29     ` Thompson, David
@ 2016-09-09  2:36       ` Tobias Geerinckx-Rice
  2016-09-09 22:42       ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-09-09  2:36 UTC (permalink / raw)
  To: dthompson2; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]

Hi Dave,

On 09/09/16 04:29, Thompson, David wrote:
> No, it doesn't.  I wrote the nginx service.  The config file used is
> part of the g-expression and is absolutely not stateful.

Wait.

nckx@v5 ~$ sudo herd restart nginx
Service nginx has been stopped.
Service nginx has been started.
nckx@v5 ~$ echo syntax error >> ~/nginx/nginx.conf
nckx@v5 ~$ sudo herd restart nginx
Service nginx has been stopped.
Service nginx could not be started.

> I mean that it should throw an error before the system is made active.
> The derivation that builds the service file should fail.

I think that's what I want too :-)

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:05 [PATCH] services: nginx: Actually check if configuration is valid Tobias Geerinckx-Rice
  2016-09-09  2:09 ` Thompson, David
@ 2016-09-09 22:41 ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2016-09-09 22:41 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> * gnu/services/web.scm (nginx-activation): Fix path to nginx binary.

OK to push!  :-)

Ludo'.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] services: nginx: Actually check if configuration is valid.
  2016-09-09  2:29     ` Thompson, David
  2016-09-09  2:36       ` Tobias Geerinckx-Rice
@ 2016-09-09 22:42       ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2016-09-09 22:42 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

Hello,

"Thompson, David" <dthompson2@worcester.edu> skribis:

> I mean that it should throw an error before the system is made active.
> The derivation that builds the service file should fail.  Not
> suggesting it needs to be done right now, but I think it would be
> cool.

Yup.  Running “nginx -t” would do the trick, right?

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-09 22:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09  2:05 [PATCH] services: nginx: Actually check if configuration is valid Tobias Geerinckx-Rice
2016-09-09  2:09 ` Thompson, David
2016-09-09  2:21   ` Tobias Geerinckx-Rice
2016-09-09  2:29     ` Thompson, David
2016-09-09  2:36       ` Tobias Geerinckx-Rice
2016-09-09 22:42       ` Ludovic Courtès
2016-09-09 22:41 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).