summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--takemi-os.scm21
1 files changed, 8 insertions, 13 deletions
diff --git a/takemi-os.scm b/takemi-os.scm
index b58417b..a32ae59 100644
--- a/takemi-os.scm
+++ b/takemi-os.scm
@@ -29,6 +29,12 @@
(shell (file-append (specification->package "shadow")
"/sbin/nologin")))))
+(define (nginx-signal name signal)
+ (program-file
+ name
+ #~(let ((pid (call-with-input-file "/var/run/nginx/pid" read)))
+ (kill pid #$signal))))
+
;; Need to override the default nginx service account configuration so
;; that the nginx user is a member of the git group.
(define nginx-service-type*
@@ -132,12 +138,7 @@
;; Send SIGHUP signal to nginx to trigger a
;; configuration reload, thus loading the
;; updated certificates.
- (deploy-hook (program-file
- "nginx-deploy-hook"
- #~(let ((pid (call-with-input-file
- "/var/run/nginx/pid"
- read)))
- (kill pid SIGHUP)))))))
+ (deploy-hook (nginx-signal "nginx-deploy-hook" SIGHUP)))))
(webroot "/var/www/certbot")))
(service nginx-service-type*
(nginx-configuration
@@ -298,13 +299,7 @@
"sharedscripts"
,@%default-log-rotation-options))
;; Tell nginx to reopen its log files after rotation.
- (post-rotate
- (program-file
- "nginx-post-rotate-hook"
- #~(let ((pid (call-with-input-file
- "/var/run/nginx/pid"
- read)))
- (kill pid SIGUSR1)))))
+ (post-rotate (nginx-signal "nginx-post-rotate-hook" SIGUSR1)))
(log-rotation
(frequency 'daily)
(files '("/var/log/fcgiwrap.log"))