[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: gnu: services: Create logs directory.
From: |
julien lepiller |
Subject: |
02/02: gnu: services: Create logs directory. |
Date: |
Mon, 1 May 2017 03:57:19 -0400 (EDT) |
roptat pushed a commit to branch master
in repository guix.
commit 5a10cd4736342160d93d2e1d5797b6cc6baebd0a
Author: Julien Lepiller <address@hidden>
Date: Sun Apr 30 11:51:12 2017 +0200
gnu: services: Create logs directory.
* gnu/services/web.scm (nginx-activation): Create logs directory so nginx
can
log its startup messages before it loads its configuration.
---
doc/guix.texi | 9 +++++++++
gnu/services/web.scm | 3 +++
2 files changed, 12 insertions(+)
diff --git a/doc/guix.texi b/doc/guix.texi
index 0d334e3..957ce2b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13316,6 +13316,15 @@ used to specify the list of @dfn{server blocks}
required on the host and
blocks} to configure. For this to work, use the default value for
@var{config-file}.
+At startup, @command{nginx} has not yet read its configuration file, so it
+uses a default file to log error messages. If it fails to load its
+configuration file, that is where error messages are logged. After the
+configuration file is loaded, the default error log file changes as per
+configuration. In our case, startup error messages can be found in
address@hidden/var/run/nginx/logs/error.log}, and after configuration in
address@hidden/var/log/nginx/error.log}. The second location can be changed
with the
address@hidden configuration option.
+
@end deffn
@deffn {Scheme Variable} nginx-service-type
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 47036f4..9f78970 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -237,6 +237,9 @@ of index files."
(mkdir-p (string-append #$run-directory "/fastcgi_temp"))
(mkdir-p (string-append #$run-directory "/uwsgi_temp"))
(mkdir-p (string-append #$run-directory "/scgi_temp"))
+ ;; Start-up logs. Once configuration is loaded, nginx switches to
+ ;; log-directory.
+ (mkdir-p (string-append #$run-directory "/logs"))
;; Check configuration file syntax.
(system* (string-append #$nginx "/sbin/nginx")
"-c" #$(or config-file