<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/tests/services.scm, branch ocaml-team</title>
<subtitle>Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! https://guix.gnu.org</subtitle>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/'/>
<entry>
<title>services: ‘shepherd-service-upgrade’ handles canonical name changes.</title>
<updated>2025-03-04T23:28:49+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-02-23T14:20:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=749eb1a2dd9fdf63a71f223b3f6756d9cb5940e6'/>
<id>749eb1a2dd9fdf63a71f223b3f6756d9cb5940e6</id>
<content type='text'>
Partly fixes &lt;https://issues.guix.gnu.org/76315&gt;.

Fixes a bug whereby a service whose canonical name has changed would not
be restarted—e.g., if '(syslogd) has a replacement providing
'(system-log syslogd).

* gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]:
Remove.
[to-restart]: Change to a subset of LIVE.  Look up all the names of each
element of TARGET.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services):
TO-RESTART is now a list of &lt;live-service&gt;; adjust accordingly.
* 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"):
("shepherd-service-upgrade: transient service"): Adjust accordingly.
("shepherd-service-upgrade: service has new canonical name"): New test.

Reported-by: Tomas Volf &lt;~@wolfsden.cz&gt;
Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partly fixes &lt;https://issues.guix.gnu.org/76315&gt;.

Fixes a bug whereby a service whose canonical name has changed would not
be restarted—e.g., if '(syslogd) has a replacement providing
'(system-log syslogd).

* gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]:
Remove.
[to-restart]: Change to a subset of LIVE.  Look up all the names of each
element of TARGET.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services):
TO-RESTART is now a list of &lt;live-service&gt;; adjust accordingly.
* 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"):
("shepherd-service-upgrade: transient service"): Adjust accordingly.
("shepherd-service-upgrade: service has new canonical name"): New test.

Reported-by: Tomas Volf &lt;~@wolfsden.cz&gt;
Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
</pre>
</div>
</content>
</entry>
<entry>
<title>gnu: services: Revert to deleting and updating all matching services</title>
<updated>2023-09-01T03:31:50+00:00</updated>
<author>
<name>Brian Cully</name>
<email>bjc@spork.org</email>
</author>
<published>2023-07-17T17:02:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=f66fa5f917e76935187935b09ae7ac037b8b35f8'/>
<id>f66fa5f917e76935187935b09ae7ac037b8b35f8</id>
<content type='text'>
This patch reverts the behavior introduced in
181951207339508789b28ba7cb914f983319920f which caused ‘modify-services’
clauses to only match a single instance of a service.

We will now match all service instances when doing a deletion or update, while
still raising an exception when trying to match against a service that does
not exist in the services list, or which was deleted explicitly by a ‘delete’
clause (or an update clause that returns ‘#f’ for the service).

Fixes: #64106

* gnu/services.scm (%modify-services): New procedure.
(modify-services): Use it.
(apply-clauses): Add DELETED-SERVICES argument, change to modify one service
at a time.
* tests/services.scm
("modify-services: delete then modify")
("modify-services: modify then delete")
("modify-services: delete multiple services of the same type")
("modify-services: modify multiple services of the same type"): New tests.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Modified-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch reverts the behavior introduced in
181951207339508789b28ba7cb914f983319920f which caused ‘modify-services’
clauses to only match a single instance of a service.

We will now match all service instances when doing a deletion or update, while
still raising an exception when trying to match against a service that does
not exist in the services list, or which was deleted explicitly by a ‘delete’
clause (or an update clause that returns ‘#f’ for the service).

Fixes: #64106

* gnu/services.scm (%modify-services): New procedure.
(modify-services): Use it.
(apply-clauses): Add DELETED-SERVICES argument, change to modify one service
at a time.
* tests/services.scm
("modify-services: delete then modify")
("modify-services: modify then delete")
("modify-services: delete multiple services of the same type")
("modify-services: modify multiple services of the same type"): New tests.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
Modified-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>services: 'modify-services' preserves service ordering.</title>
<updated>2023-06-06T09:54:39+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2023-06-06T09:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=181951207339508789b28ba7cb914f983319920f'/>
<id>181951207339508789b28ba7cb914f983319920f</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/63921&gt;.

The regression was introduced in
dbbc7e946131ba257728f1d05b96c4339b7ee88b, which changed the order of
services.  As a result, someone using 'modify-services' could find
themselves with incorrect ordering of expressions in the "boot" script,
whereby the cleanup expressions would come after (execl ".../shepherd").
This, in turn, would lead shepherd to error out at boot with EADDRINUSE
on /var/run/shepherd/socket.

* gnu/services.scm (%delete-service, %apply-clauses): Remove.
(clause-alist): New macro.
(apply-clauses): New procedure.
(modify-services): Use it.  Adjust docstring.
* tests/services.scm ("modify-services: do nothing"): Remove 'sort' call.
("modify-services: delete service"): Likewise, and add 't4' service.
("modify-services: change value"): Remove 'sort' call and fix expected value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://issues.guix.gnu.org/63921&gt;.

The regression was introduced in
dbbc7e946131ba257728f1d05b96c4339b7ee88b, which changed the order of
services.  As a result, someone using 'modify-services' could find
themselves with incorrect ordering of expressions in the "boot" script,
whereby the cleanup expressions would come after (execl ".../shepherd").
This, in turn, would lead shepherd to error out at boot with EADDRINUSE
on /var/run/shepherd/socket.

* gnu/services.scm (%delete-service, %apply-clauses): Remove.
(clause-alist): New macro.
(apply-clauses): New procedure.
(modify-services): Use it.  Adjust docstring.
* tests/services.scm ("modify-services: do nothing"): Remove 'sort' call.
("modify-services: delete service"): Likewise, and add 't4' service.
("modify-services: change value"): Remove 'sort' call and fix expected value.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Check for service existence in MODIFY-SERVICES</title>
<updated>2023-06-02T14:16:12+00:00</updated>
<author>
<name>Brian Cully</name>
<email>bjc@spork.org</email>
</author>
<published>2023-05-26T22:30:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=ae707b62e71b1fae054eb422412384bcc8d39fa9'/>
<id>ae707b62e71b1fae054eb422412384bcc8d39fa9</id>
<content type='text'>
* tests/services.scm ("modify-services: delete non-existing service")
("modify-services: change value for non-existing service"): New tests.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/services.scm ("modify-services: delete non-existing service")
("modify-services: change value for non-existing service"): New tests.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Add tests for MODIFY-SERVICES procedure</title>
<updated>2023-06-02T14:16:07+00:00</updated>
<author>
<name>Brian Cully</name>
<email>bjc@spork.org</email>
</author>
<published>2023-05-26T22:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=09fcf261c1f66a07891ec2fe80f8652fd286bd3e'/>
<id>09fcf261c1f66a07891ec2fe80f8652fd286bd3e</id>
<content type='text'>
* tests/services.scm ("modify-services: do nothing")
("modify-services: delete service")
("modify-services: change value"): New tests.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/services.scm ("modify-services: do nothing")
("modify-services: delete service")
("modify-services: change value"): New tests.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>services: Make &lt;service-type&gt; 'description' field mandatory.</title>
<updated>2022-05-18T20:29:54+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2022-05-13T21:40:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=3948ac25b1dccc40c7fdf56377f94a0775a835ee'/>
<id>3948ac25b1dccc40c7fdf56377f94a0775a835ee</id>
<content type='text'>
* gnu/services.scm (&lt;service-type&gt;)[description]: Remove default value.
* tests/services.scm: Add 'description' field to each 'service-type' form.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnu/services.scm (&lt;service-type&gt;)[description]: Remove default value.
* tests/services.scm: Add 'description' field to each 'service-type' form.
</pre>
</div>
</content>
</entry>
<entry>
<title>services: Test 'shepherd-service-upgrade' with transient services.</title>
<updated>2022-04-09T23:24:30+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2022-04-09T23:24:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=ec6a585ee2fd91c857276479411eedd0756e0093'/>
<id>ec6a585ee2fd91c857276479411eedd0756e0093</id>
<content type='text'>
This is a followup to eeb8ac43c8c0b0cc69422766070dbefc55f5c5c1.

* tests/services.scm ("shepherd-service-upgrade: transient service"):
New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a followup to eeb8ac43c8c0b0cc69422766070dbefc55f5c5c1.

* tests/services.scm ("shepherd-service-upgrade: transient service"):
New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>services: herd: Adjust to &lt;live-service&gt; changes.</title>
<updated>2022-04-09T23:15:13+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2022-04-09T23:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=e25eca35ff04e4234d0376fbb9a8e146869772c8'/>
<id>e25eca35ff04e4234d0376fbb9a8e146869772c8</id>
<content type='text'>
This is a followup to a2c759c8304c461d096ab763568e7f71546ff4e8.

* guix/scripts/system/reconfigure.scm (running-services): Fill in the
'transient?' field of &lt;live-service&gt;.
* 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'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a followup to a2c759c8304c461d096ab763568e7f71546ff4e8.

* guix/scripts/system/reconfigure.scm (running-services): Fill in the
'transient?' field of &lt;live-service&gt;.
* 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'.
</pre>
</div>
</content>
</entry>
<entry>
<title>guix system: Add 'reconfigure' module.</title>
<updated>2019-07-26T17:19:49+00:00</updated>
<author>
<name>Jakob L. Kreuze</name>
<email>zerodaysfordays@sdf.lonestar.org</email>
</author>
<published>2019-07-24T16:34:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=5c793753b31b1dcd9a554bce953124f7ae88ca9a'/>
<id>5c793753b31b1dcd9a554bce953124f7ae88ca9a</id>
<content type='text'>
* guix/scripts/system/reconfigure.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/system.scm (bootloader-installer-script): Export variable.
* gnu/machine/ssh.scm (switch-to-system, upgrade-shepherd-services)
(install-bootloader): Delete variable.
* gnu/machine/ssh.scm (deploy-managed-host): Rewrite procedure.
* gnu/services/herd.scm (live-service): Export variable.
* gnu/services/herd.scm (live-service-canonical-name): New variable.
* tests/services.scm (live-service): Delete variable.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/scripts/system/reconfigure.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/system.scm (bootloader-installer-script): Export variable.
* gnu/machine/ssh.scm (switch-to-system, upgrade-shepherd-services)
(install-bootloader): Delete variable.
* gnu/machine/ssh.scm (deploy-managed-host): Rewrite procedure.
* gnu/services/herd.scm (live-service): Export variable.
* gnu/services/herd.scm (live-service-canonical-name): New variable.
* tests/services.scm (live-service): Delete variable.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Remove duplicate field initializers.</title>
<updated>2019-01-24T19:47:21+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-01-24T18:18:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=2c5ee9bba4067fb0a9e68fb2af3a6e7fe36960cb'/>
<id>2c5ee9bba4067fb0a9e68fb2af3a6e7fe36960cb</id>
<content type='text'>
Fixes a regression introduced in
c2dcff41c2e47f5f978f467864d5ed7829939884, whereby many tests in
'tests/packages.scm' would trigger a syntax error due to duplicate field
intializers in forms like:

  (dummy-package "foo" (version "0"))

* guix/tests.scm (dummy-package, dummy-origin): Rewrite to inherit from
a base record.  This restores the semantics from before
c2dcff41c2e47f5f978f467864d5ed7829939884.
* tests/services.scm ("instantiate-missing-services, indirect"): Remove
duplicate 'extensions' field.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a regression introduced in
c2dcff41c2e47f5f978f467864d5ed7829939884, whereby many tests in
'tests/packages.scm' would trigger a syntax error due to duplicate field
intializers in forms like:

  (dummy-package "foo" (version "0"))

* guix/tests.scm (dummy-package, dummy-origin): Rewrite to inherit from
a base record.  This restores the semantics from before
c2dcff41c2e47f5f978f467864d5ed7829939884.
* tests/services.scm ("instantiate-missing-services, indirect"): Remove
duplicate 'extensions' field.
</pre>
</div>
</content>
</entry>
</feed>
