services: tor: Remove unnecessary modules from shepherd environment.

This is a followup to fb868cd779.

* gnu/services/networking.scm (tor-shepherd-service): Remove unused
'with-imported-modules' and 'modules' field.
This commit is contained in:
Ludovic Courtès 2022-11-18 15:40:14 +01:00
parent 8b56983999
commit 2a358911b0
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1011,30 +1011,24 @@ (define (tor-shepherd-service config)
(source torrc) (source torrc)
(target source))) (target source)))
#:namespaces (delq 'net %namespaces)))) #:namespaces (delq 'net %namespaces))))
(with-imported-modules (source-module-closure (list (shepherd-service
'((gnu build shepherd) (provision '(tor))
(gnu system file-systems)))
(list (shepherd-service
(provision '(tor))
;; Tor needs at least one network interface to be up, hence the ;; Tor needs at least one network interface to be up, hence the
;; dependency on 'loopback'. ;; dependency on 'loopback'.
(requirement '(user-processes loopback syslogd)) (requirement '(user-processes loopback syslogd))
(modules '((gnu build shepherd) ;; XXX: #:pid-file won't work because the wrapped 'tor'
(gnu system file-systems))) ;; program would print its PID within the user namespace
;; instead of its actual PID outside. There's no inetd or
;; XXX: #:pid-file won't work because the wrapped 'tor' ;; systemd socket activation support either (there's
;; program would print its PID within the user namespace ;; 'sd_notify' though), so we're stuck with that.
;; instead of its actual PID outside. There's no inetd or (start #~(make-forkexec-constructor
;; systemd socket activation support either (there's (list #$tor "-f" #$torrc)
;; 'sd_notify' though), so we're stuck with that. #:user "tor" #:group "tor"))
(start #~(make-forkexec-constructor (stop #~(make-kill-destructor))
(list #$tor "-f" #$torrc) (actions (list (shepherd-configuration-action torrc)))
#:user "tor" #:group "tor")) (documentation "Run the Tor anonymous network overlay.")))))))
(stop #~(make-kill-destructor))
(actions (list (shepherd-configuration-action torrc)))
(documentation "Run the Tor anonymous network overlay."))))))))
(define (tor-activation config) (define (tor-activation config)
"Set up directories for Tor and its hidden services, if any." "Set up directories for Tor and its hidden services, if any."