mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
services: tor: Run in a container.
* gnu/services/networking.scm (tor-shepherd-service): Use (gnu build shepherd) and use 'make-forkexec-constructor/container' instead of 'make-forkexec-constructor'.
This commit is contained in:
parent
bb5cad4eb2
commit
ee295346ce
1 changed files with 23 additions and 9 deletions
|
@ -595,6 +595,9 @@ (define (tor-shepherd-service config)
|
||||||
(match config
|
(match config
|
||||||
(($ <tor-configuration> tor)
|
(($ <tor-configuration> tor)
|
||||||
(let ((torrc (tor-configuration->torrc config)))
|
(let ((torrc (tor-configuration->torrc config)))
|
||||||
|
(with-imported-modules (source-module-closure
|
||||||
|
'((gnu build shepherd)
|
||||||
|
(gnu system file-systems)))
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(provision '(tor))
|
(provision '(tor))
|
||||||
|
|
||||||
|
@ -602,10 +605,21 @@ (define (tor-shepherd-service config)
|
||||||
;; dependency on 'loopback'.
|
;; dependency on 'loopback'.
|
||||||
(requirement '(user-processes loopback syslogd))
|
(requirement '(user-processes loopback syslogd))
|
||||||
|
|
||||||
(start #~(make-forkexec-constructor
|
(modules '((gnu build shepherd)
|
||||||
(list (string-append #$tor "/bin/tor") "-f" #$torrc)))
|
(gnu system file-systems)))
|
||||||
|
|
||||||
|
(start #~(make-forkexec-constructor/container
|
||||||
|
(list #$(file-append tor "/bin/tor") "-f" #$torrc)
|
||||||
|
|
||||||
|
#:mappings (list (file-system-mapping
|
||||||
|
(source "/var/lib/tor")
|
||||||
|
(target source)
|
||||||
|
(writable? #t))
|
||||||
|
(file-system-mapping
|
||||||
|
(source "/dev/log") ;for syslog
|
||||||
|
(target source)))))
|
||||||
(stop #~(make-kill-destructor))
|
(stop #~(make-kill-destructor))
|
||||||
(documentation "Run the Tor anonymous network overlay.")))))))
|
(documentation "Run the Tor anonymous network overlay."))))))))
|
||||||
|
|
||||||
(define (tor-hidden-service-activation config)
|
(define (tor-hidden-service-activation config)
|
||||||
"Return the activation gexp for SERVICES, a list of hidden services."
|
"Return the activation gexp for SERVICES, a list of hidden services."
|
||||||
|
|
Loading…
Reference in a new issue