summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-02-10 16:06:09 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-02-10 18:07:49 +0900
commit90b1546bc2246eebee18d743bcb59e6700fcf8f9 (patch)
treeefd4866f2cebdbfd9fc0788b2729ca88b4e04d1b /gnu/services
parente92dafb302ca3a01538652f364cbd01f88d32853 (diff)
services: Fix logging for jami-service-type.
Its default behavior changed and it no longer logs to syslog by default; update to log to /var/log/jami.log instead. * gnu/services/telephony.scm (jami-configuration->command-line-arguments): Drop /dev/log mapping. Add /var/log/jami.log mapping. Always add --console argument. (jami-shepherd-services): Conditionally add #:log-file argument; simplify usernames logic a bit. * gnu/services/telephony.scm (jami-configuration): Update doc. * doc/guix.texi (Telephony Services): Likewise. Change-Id: Ia2819866c84db4cba92fad52dfd0a74acdc887fc
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/telephony.scm39
1 files changed, 20 insertions, 19 deletions
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 4b288817182..a61098fb9b9 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -235,7 +235,7 @@ SET-ACCOUNT-DETAILS."
235 "The nss-certs package to use to provide TLS certificates.") 235 "The nss-certs package to use to provide TLS certificates.")
236 (enable-logging? 236 (enable-logging?
237 (boolean #t) 237 (boolean #t)
238 "Whether to enable logging to syslog.") 238 "Whether to enable logging to @file{/var/log/jami.log}.")
239 (debug? 239 (debug?
240 (boolean #f) 240 (boolean #f)
241 "Whether to enable debug level messages.") 241 "Whether to enable debug level messages.")
@@ -269,20 +269,21 @@ CONFIG, a <jami-configuration> object."
269 "bin") 269 "bin")
270 #:mappings 270 #:mappings
271 (list (file-system-mapping 271 (list (file-system-mapping
272 (source "/dev/log") ;for syslog 272 (source "/var/lib/jami")
273 (target source)) 273 (target source)
274 (writable? #t))
274 (file-system-mapping 275 (file-system-mapping
275 (source "/var/lib/jami") 276 (source "/var/log/jami.log")
276 (target source) 277 (target source)
277 (writable? #t)) 278 (writable? #t))
278 (file-system-mapping 279 (file-system-mapping
279 (source "/var/run/jami") 280 (source "/var/run/jami")
280 (target source) 281 (target source)
281 (writable? #t)) 282 (writable? #t))
282 ;; Expose TLS certificates for GnuTLS. 283 ;; Expose TLS certificates for GnuTLS.
283 (file-system-mapping 284 (file-system-mapping
284 (source (file-append nss-certs "/etc/ssl/certs")) 285 (source (file-append nss-certs "/etc/ssl/certs"))
285 (target "/etc/ssl/certs"))) 286 (target "/etc/ssl/certs")))
286 #:preserved-environment-variables 287 #:preserved-environment-variables
287 '("DBUS_SESSION_BUS_ADDRESS" "SSL_CERT_DIR") 288 '("DBUS_SESSION_BUS_ADDRESS" "SSL_CERT_DIR")
288 #:user "jami" 289 #:user "jami"
@@ -290,12 +291,10 @@ CONFIG, a <jami-configuration> object."
290 #:namespaces (fold delq %namespaces '(net user)))) 291 #:namespaces (fold delq %namespaces '(net user))))
291 292
292 (match-record config <jami-configuration> 293 (match-record config <jami-configuration>
293 (libjami dbus enable-logging? debug? auto-answer?) 294 (libjami dbus debug? auto-answer?)
294 `(,(wrapper libjami) 295 `(,(wrapper libjami)
295 "--persistent" ;stay alive after client quits 296 "--persistent" ;stay alive after client quits
296 ,@(if enable-logging? 297 "--console" ;ensure output goes to stdout/stderr
297 '() ;logs go to syslog by default
298 (list "--console")) ;else stdout/stderr
299 ,@(if debug? 298 ,@(if debug?
300 (list "--debug") 299 (list "--debug")
301 '()) 300 '())
@@ -351,6 +350,7 @@ CONFIG, a <jami-configuration> object."
351 ;; so run it in the global user namespace. 350 ;; so run it in the global user namespace.
352 #:namespaces 351 #:namespaces
353 (fold delq %namespaces '(net user)))) 352 (fold delq %namespaces '(net user))))
353 (enable-logging? (jami-configuration-enable-logging? config))
354 (accounts (jami-configuration-accounts config)) 354 (accounts (jami-configuration-accounts config))
355 (declarative-mode? (maybe-value-set? accounts))) 355 (declarative-mode? (maybe-value-set? accounts)))
356 356
@@ -641,7 +641,8 @@ argument, either a registered username or the fingerprint of the account.")
641 (list (string-append "DBUS_SESSION_BUS_ADDRESS=" 641 (list (string-append "DBUS_SESSION_BUS_ADDRESS="
642 "unix:path=/var/run/jami/bus") 642 "unix:path=/var/run/jami/bus")
643 ;; Expose TLS certificates for OpenSSL. 643 ;; Expose TLS certificates for OpenSSL.
644 "SSL_CERT_DIR=/etc/ssl/certs"))) 644 "SSL_CERT_DIR=/etc/ssl/certs")
645 #:log-file #$(and enable-logging? "/var/log/jami.log")))
645 646
646 (setenv "DBUS_SESSION_BUS_ADDRESS" 647 (setenv "DBUS_SESSION_BUS_ADDRESS"
647 "unix:path=/var/run/jami/bus") 648 "unix:path=/var/run/jami/bus")
@@ -655,9 +656,9 @@ argument, either a registered username or the fingerprint of the account.")
655 (map (cut string-append 656 (map (cut string-append
656 "/var/lib/jami/accounts/" <>) 657 "/var/lib/jami/accounts/" <>)
657 (scandir "/var/lib/jami/accounts/" 658 (scandir "/var/lib/jami/accounts/"
658 (lambda (f) 659 (negate
659 (not (member f '("." ".."))))))) 660 (cut member <> '("." ".."))))))
660 (usernames (map-in-order (cut add-account <>) 661 (usernames (map-in-order add-account
661 jami-account-archives))) 662 jami-account-archives)))
662 663
663 (define (archive-name->username archive) 664 (define (archive-name->username archive)