diff options
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/avahi.scm | 3 | ||||
-rw-r--r-- | gnu/services/base.scm | 23 | ||||
-rw-r--r-- | gnu/services/dbus.scm | 3 | ||||
-rw-r--r-- | gnu/services/dmd.scm | 4 | ||||
-rw-r--r-- | gnu/services/networking.scm | 3 | ||||
-rw-r--r-- | gnu/services/ssh.scm | 5 | ||||
-rw-r--r-- | gnu/services/xorg.scm | 3 |
7 files changed, 31 insertions, 13 deletions
diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm index 48a2c75927..89478cb997 100644 --- a/gnu/services/avahi.scm +++ b/gnu/services/avahi.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ #:use-module (gnu system shadow) #:use-module (gnu packages avahi) #:use-module (guix monads) + #:use-module (guix store) #:use-module (guix gexp) #:export (avahi-service)) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 402f5991a5..d55eb3a5f9 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -17,8 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu services base) - #:use-module ((guix store) - #:select (%store-prefix)) + #:use-module (guix store) #:use-module (gnu services) #:use-module (gnu services networking) #:use-module (gnu system shadow) ; 'user-account', etc. @@ -193,7 +192,7 @@ in KNOWN-MOUNT-POINTS when it is stopped." ;; the system. Typical example is user-space file systems. "/etc/dmd/do-not-kill") -(define* (user-processes-service requirements #:key (grace-delay 5)) +(define* (user-processes-service requirements #:key (grace-delay 4)) "Return the service that is responsible for terminating all the processes so that the root file system can be re-mounted read-only, just before rebooting/halting. Processes still running GRACE-DELAY seconds after SIGTERM @@ -230,6 +229,18 @@ stopped before 'kill' is called." (@ (ice-9 rdelim) read-string)))) '())) + (define (now) + (car (gettimeofday))) + + (define (sleep* n) + ;; Really sleep N seconds. + ;; Work around <http://bugs.gnu.org/19581>. + (define start (now)) + (let loop ((elapsed 0)) + (when (> n elapsed) + (sleep (- n elapsed)) + (loop (- (now) start))))) + (define lset= (@ (srfi srfi-1) lset=)) (display "sending all processes the TERM signal\n") @@ -238,7 +249,7 @@ stopped before 'kill' is called." (begin ;; Easy: terminate all of them. (kill -1 SIGTERM) - (sleep #$grace-delay) + (sleep* #$grace-delay) (kill -1 SIGKILL)) (begin ;; Kill them all except OMITTED-PIDS. XXX: We @@ -246,7 +257,7 @@ stopped before 'kill' is called." ;; list of processes, like 'killall5' does, but ;; that seems unreliable. (kill-except omitted-pids SIGTERM) - (sleep #$grace-delay) + (sleep* #$grace-delay) (kill-except omitted-pids SIGKILL) (delete-file #$%do-not-kill-file))) @@ -256,7 +267,7 @@ stopped before 'kill' is called." (format #t "waiting for process termination\ (processes left: ~s)~%" pids) - (sleep 2) + (sleep* 2) (wait)))) (display "all processes have been terminated\n") diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 5da7f14605..d97c54cc5d 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ #:use-module (gnu system shadow) #:use-module (gnu packages glib) #:use-module (guix monads) + #:use-module (guix store) #:use-module (guix gexp) #:export (dbus-service)) diff --git a/gnu/services/dmd.scm b/gnu/services/dmd.scm index 35b6b384c1..4bf76e01ec 100644 --- a/gnu/services/dmd.scm +++ b/gnu/services/dmd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,7 +18,9 @@ (define-module (gnu services dmd) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (guix monads) + #:use-module (guix derivations) ;imported-modules, etc. #:use-module (gnu services) #:use-module (ice-9 match) #:use-module (srfi srfi-1) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index db9be8cfbd..f0c3538e0b 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +25,7 @@ #:use-module (gnu packages messaging) #:use-module (gnu packages ntp) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (guix monads) #:use-module (srfi srfi-26) #:export (%facebook-host-aliases diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 2b52c777b7..8868e4fcdb 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,10 +18,11 @@ (define-module (gnu services ssh) #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix monads) #:use-module (gnu services) #:use-module (gnu system linux) ; 'pam-service' #:use-module (gnu packages lsh) - #:use-module (guix monads) #:export (lsh-service)) ;;; Commentary: diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index b32bb8674c..6820456698 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +30,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages bash) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (guix monads) #:use-module (guix derivations) #:use-module (srfi srfi-1) |