[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/09: services: bitlbee: Run in a container.
From: |
Ludovic Courtès |
Subject: |
09/09: services: bitlbee: Run in a container. |
Date: |
Mon, 6 Feb 2017 23:08:27 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit a062b6ca99ad61c9df473fe49a93d69f9698c59d
Author: Ludovic Courtès <address@hidden>
Date: Mon Feb 6 23:48:48 2017 +0100
services: bitlbee: Run in a container.
* gnu/services/networking.scm (bitlbee-shepherd-service): Wrap in
'with-imported-modules' and add 'modules' field. Use
'make-forkexec-constructor/container' and pass #:mappings.
---
gnu/services/networking.scm | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index ba04a96..b63888c 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -36,6 +36,7 @@
#:use-module (gnu packages gnome)
#:use-module (guix gexp)
#:use-module (guix records)
+ #:use-module (guix modules)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-26)
@@ -624,14 +625,29 @@ project's documentation} for more information."
DaemonPort = " (number->string port) "
" extra-settings))))
- (list (shepherd-service
- (provision '(bitlbee))
- (requirement '(user-processes loopback))
- (start #~(make-forkexec-constructor
- (list (string-append #$bitlbee "/sbin/bitlbee")
- "-n" "-F" "-u" "bitlbee" "-c" #$conf)
- #:pid-file "/var/run/bitlbee.pid"))
- (stop #~(make-kill-destructor))))))))
+ (with-imported-modules (source-module-closure
+ '((gnu build shepherd)
+ (gnu system file-systems)))
+ (list (shepherd-service
+ (provision '(bitlbee))
+
+ ;; Note: If networking is not up, then /etc/resolv.conf
+ ;; doesn't get mapped in the container, hence the dependency
+ ;; on 'networking'.
+ (requirement '(user-processes networking))
+
+ (modules '((gnu build shepherd)
+ (gnu system file-systems)))
+ (start #~(make-forkexec-constructor/container
+ (list #$(file-append bitlbee "/sbin/bitlbee")
+ "-n" "-F" "-u" "bitlbee" "-c" #$conf)
+
+ #:pid-file "/var/run/bitlbee.pid"
+ #:mappings (list (file-system-mapping
+ (source "/var/lib/bitlbee")
+ (target source)
+ (writable? #t)))))
+ (stop #~(make-kill-destructor)))))))))
(define %bitlbee-accounts
;; User group and account to run BitlBee.
- branch master updated (a24fda8 -> a062b6c), Ludovic Courtès, 2017/02/06
- 03/09: bash completion: Complete file names after 'guix system COMMAND'., Ludovic Courtès, 2017/02/06
- 06/09: services: bitlbee: Read the PID file., Ludovic Courtès, 2017/02/06
- 05/09: bash completion: Complete subcommands for the current word., Ludovic Courtès, 2017/02/06
- 02/09: bash completion: Complete 'guix gc' with file names., Ludovic Courtès, 2017/02/06
- 07/09: linux-container: Add 'container-excursion*'., Ludovic Courtès, 2017/02/06
- 01/09: file-systems: Add '%network-configuration-files' and '%network-file-mappings'., Ludovic Courtès, 2017/02/06
- 04/09: bash completion: Properly complete 'guix container exec'., Ludovic Courtès, 2017/02/06
- 09/09: services: bitlbee: Run in a container.,
Ludovic Courtès <=
- 08/09: Add (gnu build shepherd)., Ludovic Courtès, 2017/02/06