diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2022-04-10 01:15:13 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-04-10 01:15:13 +0200 |
| commit | e25eca35ff04e4234d0376fbb9a8e146869772c8 (patch) | |
| tree | 11b817fae0ddfb0d6b6ebf7ecac832568ce4fd66 | |
| parent | d10cee786522ca2d321fb942a4da14feaaae091a (diff) | |
services: herd: Adjust to <live-service> changes.
This is a followup to a2c759c8304c461d096ab763568e7f71546ff4e8.
* guix/scripts/system/reconfigure.scm (running-services): Fill in the
'transient?' field of <live-service>.
* tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new")
("shepherd-service-upgrade: service depended on is not unloaded")
("shepherd-service-upgrade: obsolete services that depend on each
other"): Adjust calls to 'live-service'.
| -rw-r--r-- | guix/scripts/system/reconfigure.scm | 8 | ||||
| -rw-r--r-- | tests/services.scm | 20 |
2 files changed, 15 insertions, 13 deletions
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index bf23fb06af3..ca988953f99 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2016 Alex Kost <alezost@gmail.com> | 3 | ;;; Copyright © 2016 Alex Kost <alezost@gmail.com> |
| 4 | ;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com> | 4 | ;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com> |
| 5 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> | 5 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> |
| @@ -134,6 +134,7 @@ return the <live-service> objects that are currently running on MACHINE." | |||
| 134 | (map (lambda (service) | 134 | (map (lambda (service) |
| 135 | (list (live-service-provision service) | 135 | (list (live-service-provision service) |
| 136 | (live-service-requirement service) | 136 | (live-service-requirement service) |
| 137 | (live-service-transient service) | ||
| 137 | (match (live-service-running service) | 138 | (match (live-service-running service) |
| 138 | (#f #f) | 139 | (#f #f) |
| 139 | (#t #t) | 140 | (#t #t) |
| @@ -143,8 +144,9 @@ return the <live-service> objects that are currently running on MACHINE." | |||
| 143 | 144 | ||
| 144 | (mlet %store-monad ((services (eval exp))) | 145 | (mlet %store-monad ((services (eval exp))) |
| 145 | (return (map (match-lambda | 146 | (return (map (match-lambda |
| 146 | ((provision requirement running) | 147 | ((provision requirement transient? running) |
| 147 | (live-service provision requirement running))) | 148 | (live-service provision requirement |
| 149 | transient? running))) | ||
| 148 | services)))) | 150 | services)))) |
| 149 | 151 | ||
| 150 | ;; XXX: Currently, this does NOT attempt to restart running services. See | 152 | ;; XXX: Currently, this does NOT attempt to restart running services. See |
diff --git a/tests/services.scm b/tests/services.scm index 572fe381645..03c490100b6 100644 --- a/tests/services.scm +++ b/tests/services.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2015-2019, 2022 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -212,9 +212,9 @@ | |||
| 212 | ;; because it is not currently running. 'baz' is loaded because it's | 212 | ;; because it is not currently running. 'baz' is loaded because it's |
| 213 | ;; a new service. | 213 | ;; a new service. |
| 214 | (shepherd-service-upgrade | 214 | (shepherd-service-upgrade |
| 215 | (list (live-service '(foo) '() #t) | 215 | (list (live-service '(foo) '() #f #t) |
| 216 | (live-service '(bar) '() #f) | 216 | (live-service '(bar) '() #f #f) |
| 217 | (live-service '(root) '() #t)) ;essential! | 217 | (live-service '(root) '() #f #t)) ;essential! |
| 218 | (list (shepherd-service (provision '(foo)) | 218 | (list (shepherd-service (provision '(foo)) |
| 219 | (start #t)) | 219 | (start #t)) |
| 220 | (shepherd-service (provision '(bar)) | 220 | (shepherd-service (provision '(bar)) |
| @@ -234,9 +234,9 @@ | |||
| 234 | ;; unloaded because 'foo' depends on it. 'foo' gets replaced but it | 234 | ;; unloaded because 'foo' depends on it. 'foo' gets replaced but it |
| 235 | ;; must be restarted manually. | 235 | ;; must be restarted manually. |
| 236 | (shepherd-service-upgrade | 236 | (shepherd-service-upgrade |
| 237 | (list (live-service '(foo) '(bar) #t) | 237 | (list (live-service '(foo) '(bar) #f #t) |
| 238 | (live-service '(bar) '() #t) ;still used! | 238 | (live-service '(bar) '() #f #t) ;still used! |
| 239 | (live-service '(baz) '() #t)) | 239 | (live-service '(baz) '() #f #t)) |
| 240 | (list (shepherd-service (provision '(foo)) | 240 | (list (shepherd-service (provision '(foo)) |
| 241 | (start #t))))) | 241 | (start #t))))) |
| 242 | (lambda (unload restart) | 242 | (lambda (unload restart) |
| @@ -251,9 +251,9 @@ | |||
| 251 | ;; 'foo', 'bar', and 'baz' depend on each other, but all of them are | 251 | ;; 'foo', 'bar', and 'baz' depend on each other, but all of them are |
| 252 | ;; obsolete, and thus should be unloaded. | 252 | ;; obsolete, and thus should be unloaded. |
| 253 | (shepherd-service-upgrade | 253 | (shepherd-service-upgrade |
| 254 | (list (live-service '(foo) '(bar) #t) ;obsolete | 254 | (list (live-service '(foo) '(bar) #f #t) ;obsolete |
| 255 | (live-service '(bar) '(baz) #t) ;obsolete | 255 | (live-service '(bar) '(baz) #f #t) ;obsolete |
| 256 | (live-service '(baz) '() #t)) ;obsolete | 256 | (live-service '(baz) '() #f #t)) ;obsolete |
| 257 | (list (shepherd-service (provision '(qux)) | 257 | (list (shepherd-service (provision '(qux)) |
| 258 | (start #t))))) | 258 | (start #t))))) |
| 259 | (lambda (unload restart) | 259 | (lambda (unload restart) |
