Message ID | 1473386715-10297-1-git-send-email-me@tobias.gr |
---|---|
State | New |
Headers |
Received: (qmail 100477 invoked by uid 89); 9 Sep 2016 02:05:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:196, Hx-spam-relays-external:196, H*r:196, services X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Sep 2016 02:05:43 +0000 Received: from localhost ([::1]:55096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guix-devel-bounces+patchwork=sourceware.org@gnu.org>) id 1biBCI-00055U-4V for patchwork@sourceware.org; Thu, 08 Sep 2016 22:05:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <me@tobias.gr>) id 1biBC9-00055F-6F for guix-devel@gnu.org; Thu, 08 Sep 2016 22:05:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <me@tobias.gr>) id 1biBC3-0005dr-Bd for guix-devel@gnu.org; Thu, 08 Sep 2016 22:05:32 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:46924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <me@tobias.gr>) id 1biBC3-0005dl-5Q for guix-devel@gnu.org; Thu, 08 Sep 2016 22:05:27 -0400 Received: from localhost.localdomain (ptr-2hj4tbtvcl90ij2ml4xlngsoq.ip6.access.telenet.be [IPv6:2a02:1811:b680:8200:e4bd:a7c2:276f:f03a]) (Authenticated sender: me@tobias.gr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 7C97817209C for <guix-devel@gnu.org>; Fri, 9 Sep 2016 04:05:23 +0200 (CEST) From: Tobias Geerinckx-Rice <me@tobias.gr> To: guix-devel@gnu.org Subject: [PATCH] services: nginx: Actually check if configuration is valid. Date: Fri, 9 Sep 2016 04:05:15 +0200 Message-Id: <1473386715-10297-1-git-send-email-me@tobias.gr> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4b98:c:538::196 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." <guix-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guix-devel/> List-Post: <mailto:guix-devel@gnu.org> List-Help: <mailto:guix-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=subscribe> Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" <guix-devel-bounces+patchwork=sourceware.org@gnu.org> |
Commit Message
Tobias Geerinckx-Rice
Sept. 9, 2016, 2:05 a.m. UTC
* 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(-)
Comments
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
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
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
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
Tobias Geerinckx-Rice <me@tobias.gr> skribis:
> * gnu/services/web.scm (nginx-activation): Fix path to nginx binary.
OK to push! :-)
Ludo'.
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’.
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