services: tailscale: Rotate logs.

* rosenthal/services/networking.scm (tailscale-log-rotations): New procedure.
(tailscale-service-type): Extend rottlog-service-type with it.
pull/2/head
Hilton Chain 12 months ago
parent bcde595503
commit bf0c5dc70b
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
  1. 11
      rosenthal/services/networking.scm

@ -9,6 +9,7 @@
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages networking) #:use-module (gnu packages networking)
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services admin)
#:use-module (gnu services configuration) #:use-module (gnu services configuration)
#:use-module (gnu services dbus) #:use-module (gnu services dbus)
#:use-module (gnu services shepherd) #:use-module (gnu services shepherd)
@ -401,7 +402,7 @@ list, power save will be disabled."))
"The iptables package to use.") "The iptables package to use.")
(log-file (log-file
(string "/dev/null") (string "/var/log/tailscaled.log")
"Path to log file.") "Path to log file.")
(bird-socket (bird-socket
@ -457,6 +458,10 @@ to #f.")
"Log verbosity level; 0 is default, 1 or higher are increasingly verbose.") "Log verbosity level; 0 is default, 1 or higher are increasingly verbose.")
(no-serialization)) (no-serialization))
(define (tailscale-log-rotations config)
(list (log-rotation
(files (list (tailscale-configuration-log-file config))))))
(define tailscale-shepherd-service (define tailscale-shepherd-service
(match-record-lambda <tailscale-configuration> (match-record-lambda <tailscale-configuration>
(tailscale iptables log-file bird-socket debug-server port socket (tailscale iptables log-file bird-socket debug-server port socket
@ -506,6 +511,8 @@ to #f.")
(list (service-extension shepherd-root-service-type (list (service-extension shepherd-root-service-type
tailscale-shepherd-service) tailscale-shepherd-service)
(service-extension profile-service-type (service-extension profile-service-type
(compose list tailscale-configuration-tailscale)))) (compose list tailscale-configuration-tailscale))
(service-extension rottlog-service-type
tailscale-log-rotations)))
(default-value (tailscale-configuration)) (default-value (tailscale-configuration))
(description "Run tailscaled."))) (description "Run tailscaled.")))

Loading…
Cancel
Save