diff options
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/base.scm | 4 | ||||
| -rw-r--r-- | gnu/services/configuration.scm | 8 | ||||
| -rw-r--r-- | gnu/services/cuirass.scm | 24 | ||||
| -rw-r--r-- | gnu/services/monitoring.scm | 32 | ||||
| -rw-r--r-- | gnu/services/vpn.scm | 4 |
5 files changed, 49 insertions, 23 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 370696a55e1..ba59e46155d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2016,7 +2016,9 @@ raise a deprecation warning if the 'compression-level' field was used." (define %guix-publish-log-rotations (list (log-rotation - (files (list "/var/log/guix-publish.log"))))) + (files (list "/var/log/guix-publish.log")) + (options `("rotate 4" ;don't keep too many of them + ,@%default-log-rotation-options))))) (define (guix-publish-activation config) (let ((cache (guix-publish-configuration-cache config))) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index dacfc52ba9e..10cb933ed1c 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -249,7 +249,7 @@ does not have a default value" field kind))) #'(field ...) #'(field-getter ...) #'(field-default ...)) - (%location #,(id #'stem #'stem #'-location) + (%location #,(id #'stem #'stem #'-source-location) (default (and=> (current-source-location) source-properties->location)) (innate))) @@ -436,7 +436,11 @@ the list result in @code{#t} when applying PRED? on them." (define list-of-strings? (list-of string?)) -(define alist? list?) +(define alist? + (match-lambda + (() #t) + ((head . tail) (and (pair? head) (alist? tail))) + (_ #f))) (define serialize-file-like empty-serializer) diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index d7c6ab9877a..43b0e0946ee 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -302,8 +302,13 @@ (define (cuirass-log-rotations config) "Return the list of log rotations that corresponds to CONFIG." (list (log-rotation - (files (list (cuirass-configuration-log-file config) - (cuirass-configuration-web-log-file config))) + (files (append (list (cuirass-configuration-log-file config) + (cuirass-configuration-web-log-file config)) + (let ((server + (cuirass-configuration-remote-server config))) + (if server + (list (cuirass-remote-server-log-file server)) + '())))) (frequency 'weekly) (options `("rotate 40" ;worth keeping ,@%default-log-rotation-options))))) @@ -394,12 +399,21 @@ CONFIG." #:log-file #$log-file)) (stop #~(make-kill-destructor)))))) +(define (cuirass-remote-worker-log-rotations config) + "Return the list of log rotations that corresponds to CONFIG." + (list (log-rotation + (files (list (cuirass-remote-worker-log-file config))) + (frequency 'weekly) + (options `("rotate 4" ;don't keep too many of them + ,@%default-log-rotation-options))))) + (define cuirass-remote-worker-service-type (service-type (name 'cuirass-remote-worker) (extensions - (list - (service-extension shepherd-root-service-type - cuirass-remote-worker-shepherd-service))) + (list (service-extension shepherd-root-service-type + cuirass-remote-worker-shepherd-service) + (service-extension rottlog-service-type + cuirass-remote-worker-log-rotations))) (description "Run the Cuirass remote build worker service."))) diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm index d6dc2c1e035..9a883515663 100644 --- a/gnu/services/monitoring.scm +++ b/gnu/services/monitoring.scm @@ -224,15 +224,12 @@ Prometheus.") (define (serialize-string field-name val) - (if (and (string? val) (string=? val "")) + (if (or (eq? 'user field-name) + (eq? 'group field-name) + (and (string? val) (string=? val ""))) "" (serialize-field field-name val))) -(define group? string?) - -(define serialize-group - (const "")) - (define include-files? list?) (define (serialize-include-files field-name val) @@ -256,8 +253,8 @@ Prometheus.") (user (string "zabbix") "User who will run the Zabbix server.") - (group ;for zabbix-server-account procedure - (group "zabbix") + (group + (string "zabbix") "Group who will run the Zabbix server.") (db-host (string "127.0.0.1") @@ -438,7 +435,7 @@ results in a Web interface."))) (string "zabbix") "User who will run the Zabbix agent.") (group - (group "zabbix") + (string "zabbix") "Group who will run the Zabbix agent.") (hostname (string "") @@ -516,6 +513,18 @@ configuration file.")) (format port #$(serialize-configuration config zabbix-agent-configuration-fields))))))) +(define (zabbix-agent-arguments config) + #~(let* ((config-file #$(zabbix-agent-config-file config)) + (agent #$(zabbix-agent-configuration-zabbix-agent config)) + (agent2? (file-exists? (string-append agent "/sbin/zabbix_agent2")))) + (if agent2? + (list (string-append agent "/sbin/zabbix_agent2") + "-config" config-file + "-foreground") + (list (string-append agent "/sbin/zabbix_agentd") + "--config" config-file + "--foreground")))) + (define (zabbix-agent-shepherd-service config) "Return a <shepherd-service> for Zabbix agent with CONFIG." (list (shepherd-service @@ -523,10 +532,7 @@ configuration file.")) (requirement '(user-processes)) (documentation "Run Zabbix agent daemon.") (start #~(make-forkexec-constructor - (list #$(file-append (zabbix-agent-configuration-zabbix-agent config) - "/sbin/zabbix_agentd") - "--config" #$(zabbix-agent-config-file config) - "--foreground") + #$(zabbix-agent-arguments config) #:user #$(zabbix-agent-configuration-user config) #:group #$(zabbix-agent-configuration-group config) #:pid-file #$(zabbix-agent-configuration-pid-file config) diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index def381987b4..7b3bb8903c3 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -833,7 +833,7 @@ PostUp = ~a set %i private-key ~a (define (wireguard-activation config) (match-record config <wireguard-configuration> - (private-key) + (private-key wireguard) #~(begin (use-modules (guix build utils) (ice-9 popen) @@ -842,7 +842,7 @@ PostUp = ~a set %i private-key ~a (unless (file-exists? #$private-key) (let* ((pipe (open-input-pipe (string-append - #$(file-append wireguard-tools "/bin/wg") + #$(file-append wireguard "/bin/wg") " genkey"))) (key (read-line pipe))) (call-with-output-file #$private-key |
