GNU bug report logs - #76338
shepherd restarts service during shutdown and then waits forever

Previous Next

Package: guix;

Reported by: Dariqq <dariqq <at> posteo.net>

Date: Sun, 16 Feb 2025 14:40:03 UTC

Severity: grave

Tags: patch

Merged with 76368

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76338 in the body.
You can then email your comments to 76338 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Sun, 16 Feb 2025 14:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dariqq <dariqq <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 16 Feb 2025 14:40:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dariqq <dariqq <at> posteo.net>
To: bug-guix <at> gnu.org
Subject: shepherd restarts service during shutdown and then waits forever
Date: Sun, 16 Feb 2025 14:38:49 +0000
Hi,

After I updated today I noticed that the system was not shutting down 
properly. The reason was that stopping of user-processes causes shepherd 
to respawn thermald.

The following is happening on tty12 (and is annoyingly not logged to 
/var/log/messages):

[...]
Stopping user processes
Sending all processes the TERM Signal
thermald : Terminating on user request
Respawning thermald
Service service thermald
Service thermald running with value ...
Service thermald has been started
[...]

Waiting for process termination (processes left (1 THERMALD-PID)
Waiting for process termination (processes left (1 THERMALD-PID)
Waiting for process termination (processes left (1 THERMALD-PID)
[...]

The issue is that thermald (and possibly other services) don't depend on 
user-processes service. Don't know why I had no problems until now.

Have a nice day,
Dariqq




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Sun, 16 Feb 2025 17:24:01 GMT) Full text and rfc822 format available.

Message #8 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: 76338 <at> debbugs.gnu.org
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Sun, 16 Feb 2025 18:23:37 +0100
Hi,

Dariqq <dariqq <at> posteo.net> skribis:

> The issue is that thermald (and possibly other services) don't depend
> on user-processes service. Don't know why I had no problems until now.

This should be fixed: they should all depend on ‘user-processes’.

Probably the bug you’re seeing here was revealed by
<https://issues.guix.gnu.org/75829>.

But perhaps shepherd should also just disable all services when shutting
down so that respawning doesn’t happen.

Ludo’.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 16 Feb 2025 17:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Mon, 17 Feb 2025 10:17:02 GMT) Full text and rfc822 format available.

Message #13 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Dariqq <dariqq <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76338 <at> debbugs.gnu.org
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Mon, 17 Feb 2025 10:15:53 +0000
Hi Ludo,

On 16.02.25 18:23, Ludovic Courtès wrote:
> Hi,
> 
> Dariqq <dariqq <at> posteo.net> skribis:
> 
>> The issue is that thermald (and possibly other services) don't depend
>> on user-processes service. Don't know why I had no problems until now.
> 
> This should be fixed: they should all depend on ‘user-processes’.
> 
For the record I will not be verifying every daemon service manually in 
the guix codebase whether it correctly depends on user-processes. Many 
do directly however also a lot only do transitively. The problematic 
cases most likely are where a service sets no requirement field at all

The two services that I know of are thermald and virtlogd.

Also the purpose of the user-processes service (and maybe also the 
filesystems) service as synchronization targets are documented only in 
their definition and implicitly with the shepherd graph image. 
System-shepherd services that dont depend on anything are probably a bad 
idea and seems like a very common mistake for (new) users implementing 
their own services.
Maybe this should be a a more explicit note in the documentation for 
shepherd-service-requirement and/or a small paragraph in the shepherd 
services intro?


> Probably the bug you’re seeing here was revealed by
> <https://issues.guix.gnu.org/75829>.
> 

Is there a reason for user-processes to block on waiting for every 
process execpt PID1 to exit or why during the (sleep 1) calls other 
services (that falsely dont depend on user-processes) are not being 
stopped in the meantime which would help resolve the deadlock?

This causes every daemon indirectly to depend on user-processes but 
shepherd may not know about it.

> But perhaps shepherd should also just disable all services when shutting
> down so that respawning doesn’t happen.

I guess shepherd is just doing its duty as a service manager. Something 
else send SIGTERM/SIGKILL and shepherd kindly respawns it as instructed.
But insisting on restarting a service seems a bit pointless to me during 
shutdown/reboot where everything will be terminated anyway.

> 
> Ludo’.





Merged 76338 76368. Request was from Tomas Volf <~@wolfsden.cz> to control <at> debbugs.gnu.org. (Mon, 17 Feb 2025 21:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Wed, 19 Feb 2025 18:09:02 GMT) Full text and rfc822 format available.

Message #18 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>, Ludovic Courtès <ludo <at> gnu.org>,
 Tomas Volf <~@wolfsden.cz>
Subject: Rspamd too
Date: Wed, 19 Feb 2025 10:08:04 -0800
Hi,

I believe Rspamd should likewise depend on 'user-processes'.  Thanks!

Kind regards
Felix




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Wed, 19 Feb 2025 21:30:02 GMT) Full text and rfc822 format available.

Message #21 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ashvith Shetty <ashvithshetty0010 <at> zohomail.in>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: bug#76338: shepherd restarts service during shutdown and then waits
 forever
Date: Thu, 20 Feb 2025 02:58:09 +0530
Hello,
I also have the same exact issue. Here's the shutdown log:

--8<---------------cut here---------------start------------->8---
Feb 20 00:37:30 localhost elogind[426]: System is powering down.
Feb 20 00:37:30 localhost elogind[426]: Removed session c2.
Feb 20 00:37:30 localhost NetworkManager[503]: <info> 
[1739992050.8059] device (wlp3s0): state change: activated ->
deactivating (reason 'connection-removed', sys-iface-state: 'managed')
Feb 20 00:37:30 localhost NetworkManager[503]: <info> 
[1739992050.8069] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 20 00:37:30 localhost dbus-daemon[415]: [system] Activating service
name='org.freedesktop.nm_dispatcher' requested by ':1.10' (uid=0
pid=503 comm="/gnu/store/zav4w5jrcn4yhcawg9l0smv7g2hmyais-networ")
(using servicehelper)
Feb 20 00:37:30 localhost dbus-daemon[415]: [system] Successfully
activated service 'org.freedesktop.nm_dispatcher'
Feb 20 00:37:30 localhost vmunix: [40112.799390] wlp3s0:
deauthenticating from 54:37:bb:d2:dd:3d by local choice (Reason:
3=DEAUTH_LEAVING)
Feb 20 00:37:30 localhost shepherd[1]: Stopping service root... 
Feb 20 00:37:30 localhost shepherd[1]: Exiting shepherd... 
Feb 20 00:37:30 localhost shepherd[1]: Stopping service swap-swap... 
Feb 20 00:37:30 localhost shepherd[1]: Service swap-swap stopped. 
Feb 20 00:37:30 localhost shepherd[1]: Service swap-swap is now
stopped. 
Feb 20 00:37:30 localhost shepherd[1]: Stopping service lightdm... 
Feb 20 00:37:31 localhost wpa_supplicant[437]: wlp3s0: CTRL-EVENT-
DISCONNECTED bssid=54:37:bb:d2:dd:3d reason=3 locally_generated=1
Feb 20 00:37:31 localhost wpa_supplicant[437]: wlp3s0: CTRL-EVENT-DSCP-
POLICY clear_all
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2420] device (wlp3s0): state change: deactivating ->
disconnected (reason 'connection-removed', sys-iface-state: 'managed')
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2428] dhcp4 (wlp3s0): canceled DHCP transaction
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2428] dhcp4 (wlp3s0): activation: beginning transaction
(timeout in 45 seconds)
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2429] dhcp4 (wlp3s0): state changed no lease
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2435] dhcp6 (wlp3s0): canceled DHCP transaction
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2435] dhcp6 (wlp3s0): activation: beginning transaction
(timeout in 45 seconds)
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2436] dhcp6 (wlp3s0): state changed no lease
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2809] device (wlp3s0): set-hw-addr: set MAC address to
5E:3F:03:00:57:16 (scanning)
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.2908] dns-mgr: Removing DNS information from
/gnu/store/139drha7awx79jb2js4m88p2jsl7zasc-openresolv-
3.13.2/sbin/resolvconf
Feb 20 00:37:31 localhost nscd: 1232 monitored file `/etc/resolv.conf`
was written to
Feb 20 00:37:31 localhost shepherd[1]: Service lightdm stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service lightdm is now stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service ssh-daemon... 
Feb 20 00:37:31 localhost shepherd[1]: Service ssh-daemon stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service ssh-daemon is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service avahi-daemon...
Feb 20 00:37:31 localhost shepherd[1]: Service avahi-daemon stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service avahi-daemon is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service ntpd... 
Feb 20 00:37:31 localhost ntpd[619]: ntpd exiting on signal 15
(Terminated)
Feb 20 00:37:31 localhost shepherd[1]: Service ntpd stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service ntpd is now stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service dockerd... 
Feb 20 00:37:31 localhost shepherd[1]: Service dockerd stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service dockerd is now stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service
NetworkManager... 
Feb 20 00:37:31 localhost shepherd[1]: [NetworkManager] Terminated 
Feb 20 00:37:31 localhost NetworkManager[503]: <warn> 
[1739992051.4008] dns-mgr: could not commit DNS changes:
/gnu/store/139drha7awx79jb2js4m88p2jsl7zasc-openresolv-
3.13.2/sbin/resolvconf returned error code
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5026] caught SIGTERM, shutting down normally.
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5029] device (wlp3s0): supplicant interface state:
completed -> disconnected
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5029] device (p2p-dev-wlp3s0): supplicant management
interface state: completed -> disconnected
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5032] device (wlp3s0): supplicant interface state:
disconnected -> interface_disabled
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5033] device (p2p-dev-wlp3s0): supplicant management
interface state: disconnected -> interface_disabled
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5034] device (wlp3s0): supplicant interface state:
interface_disabled -> disconnected
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5035] device (p2p-dev-wlp3s0): supplicant management
interface state: interface_disabled -> disconnected
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5179] device (wlp3s0): state change: disconnected ->
unmanaged (reason 'unmanaged', sys-iface-state: 'managed')
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5719] device (wlp3s0): set-hw-addr: reset MAC address to
98:3B:8F:30:37:7A (unmanage)
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.5879] device (p2p-dev-wlp3s0): state change: disconnected -
> unmanaged (reason 'removed', sys-iface-state: 'removed')
Feb 20 00:37:31 localhost wpa_supplicant[437]: p2p-dev-wlp3s0: CTRL-
EVENT-DSCP-POLICY clear_all
Feb 20 00:37:31 localhost wpa_supplicant[437]: p2p-dev-wlp3s0: CTRL-
EVENT-DSCP-POLICY clear_all
Feb 20 00:37:31 localhost wpa_supplicant[437]: nl80211: deinit
ifname=p2p-dev-wlp3s0 disabled_11b_rates=0
Feb 20 00:37:31 localhost NetworkManager[503]: <info> 
[1739992051.6236] exiting (success)
Feb 20 00:37:31 localhost shepherd[1]: Service NetworkManager stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service NetworkManager is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service wpa-
supplicant... 
Feb 20 00:37:31 localhost wpa_supplicant[437]: wlp3s0: CTRL-EVENT-DSCP-
POLICY clear_all
Feb 20 00:37:31 localhost wpa_supplicant[437]: wlp3s0: CTRL-EVENT-DSCP-
POLICY clear_all
Feb 20 00:37:31 localhost wpa_supplicant[437]: nl80211: deinit
ifname=wlp3s0 disabled_11b_rates=0
Feb 20 00:37:31 localhost shepherd[1]: Service wpa-supplicant stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service wpa-supplicant is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service bluetooth... 
Feb 20 00:37:31 localhost bluetoothd[428]: Terminating
Feb 20 00:37:31 localhost bluetoothd[428]: Stopping SDP server
Feb 20 00:37:31 localhost bluetoothd[428]: Exit
Feb 20 00:37:31 localhost shepherd[1]: Service bluetooth stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service bluetooth is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service upower-
daemon... 
Feb 20 00:37:31 localhost shepherd[1]: Service upower-daemon stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service upower-daemon is now
stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service pam... 
Feb 20 00:37:31 localhost shepherd[1]: Service pam stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service pam is now stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service elogind... 
Feb 20 00:37:31 localhost elogind[426]: Received signal 15 [TERM]
Feb 20 00:37:31 localhost shepherd[1]: Service elogind stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service elogind is now stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Stopping service libvirtd... 
Feb 20 00:37:31 localhost shepherd[1]: Service libvirtd stopped. 
Feb 20 00:37:31 localhost shepherd[1]: Service libvirtd is now stopped.
Feb 20 00:37:31 localhost shepherd[1]: Stopping service dbus-system... 
Feb 20 00:37:31 localhost ModemManager[531]: <msg> caught signal,
shutting down... 
Feb 20 00:37:31 localhost nm-dispatcher: Caught signal 15, shutting
down...
Feb 20 00:37:32 localhost shepherd[1]: Service dbus-system stopped. 
Feb 20 00:37:32 localhost shepherd[1]: Service dbus-system is now
stopped. 
Feb 20 00:37:32 localhost ModemManager[531]: <msg> ModemManager is shut
down 
Feb 20 00:37:32 localhost shepherd[1]: Stopping service term-console...
Feb 20 00:37:32 localhost shepherd[1]: Service term-console stopped. 
Feb 20 00:37:32 localhost shepherd[1]: Service term-console is now
stopped. 
Feb 20 00:37:32 localhost shepherd[1]: Stopping service nscd... 
Feb 20 00:37:32 localhost shepherd[1]: Service nscd stopped. 
Feb 20 00:37:32 localhost shepherd[1]: Service nscd is now stopped. 
Feb 20 00:37:32 localhost syslogd: exiting on signal 15
--8<---------------cut here---------------start------------->8---

Regards,
Ashvith




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Thu, 20 Feb 2025 19:51:02 GMT) Full text and rfc822 format available.

Message #24 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Ashvith Shetty <ashvithshetty0010 <at> zohomail.in>, Tomas Volf <~@wolfsden.cz>,
 Felix Lechner <felix.lechner <at> lease-up.com>
Subject: [PATCH v1] Add user-processes to services that prevent clean
 shutdowns. (Closes: #76338)
Date: Thu, 20 Feb 2025 11:50:44 -0800
It's at least a partial fix.

Change-Id: Ifca81e4311f5145a3bb36f1ea338554079e121e2
---
 gnu/services/mail.scm | 2 +-
 gnu/services/pm.scm   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 18b482272c..210a226ccf 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -2317,7 +2317,7 @@ (define-configuration/no-serialization rspamd-configuration
    (boolean #f)
    "Do not apply Jinja templates.")
   (shepherd-requirements
-   (list-of-symbols '(loopback))
+   (list-of-symbols '(loopback user-processes))
    "This is a list of symbols naming Shepherd services that this service
 will depend on."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 1978de55d4..fa18af254b 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -512,6 +512,7 @@ (define (thermald-shepherd-service config)
    (shepherd-service
     (provision '(thermald))
     (documentation "Run thermald cpu frequency scaling.")
+    (requirement '(user-processes))
     (start #~(make-forkexec-constructor
               '(#$(file-append (thermald-thermald config) "/sbin/thermald")
                 "--no-daemon"

base-commit: 40e83f8f72fc831c94dc6d42664be50db755344b
-- 
2.48.1





Severity set to 'grave' from 'important' Request was from Felix Lechner <felix.lechner <at> lease-up.com> to control <at> debbugs.gnu.org. (Thu, 20 Feb 2025 19:56:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Felix Lechner <felix.lechner <at> lease-up.com> to control <at> debbugs.gnu.org. (Thu, 20 Feb 2025 19:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Fri, 21 Feb 2025 04:30:04 GMT) Full text and rfc822 format available.

Message #31 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Richard Sent <richard <at> freakingpenguin.com>
To: Felix Lechner via Bug reports for GNU Guix <bug-guix <at> gnu.org>
Cc: 76338 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
 Ashvith Shetty <ashvithshetty0010 <at> zohomail.in>,
 Felix Lechner <felix.lechner <at> lease-up.com>, Dariqq <dariqq <at> posteo.net>,
 Tomas Volf <~@wolfsden.cz>
Subject: Re: bug#76338: [PATCH v1] Add user-processes to services that
 prevent clean shutdowns. (Closes: #76338)
Date: Thu, 20 Feb 2025 23:29:36 -0500
I believe this fix is also required for the Shepherd services in
virtlogd-service-type, containerd-service-type, and rngd-service-type
[1].

(I've not observed rngd outright halt shutdown, but Shepherd does seem
to still periodically respawn it while shutdown is ongoing.)

[1]: https://issues.guix.gnu.org/76368#0
-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Fri, 21 Feb 2025 04:36:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Fri, 21 Feb 2025 10:53:02 GMT) Full text and rfc822 format available.

Message #37 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: 76338 <at> debbugs.gnu.org
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Fri, 21 Feb 2025 11:52:01 +0100
Hello,

Dariqq <dariqq <at> posteo.net> skribis:

> The two services that I know of are thermald and virtlogd.

I found these:

--8<---------------cut here---------------start------------->8---
scheme@(guix scripts system search)> ,pp (map shepherd-service-provision
					      (append-map (lambda (services)
							    (remove (lambda (service)
								      (memq 'user-processes
									    (shepherd-service-requirement service)))
								    services))
							  (map service-type-default-shepherd-services (fold-service-types cons '()))))
$7 = ((user-homes)
      (tailon)
      (agate)
      (varnish-default)
      (httpd)
      (fcgiwrap)
      (mumi)
      (mumi-worker)
      (mumi-mailer)
      (php-fpm)
      (whoogle-search)
      (hpcguix-web)
      (gmnisrv)
      (vpn-client)
      (ipsec)
      (vpn-server)
      (xvnc vncserver)
      (git-daemon)
      (mumble-server)
      (jami-dbus-session)
      (jami)
      (sysctl)
      (autossh)
      (ssh-daemon ssh sshd)
      (webssh)
      (ssh-daemon ssh sshd)
      (ssh-daemon ssh sshd)
      (spice-vdagentd)
      (speakersafetyd)
      (system-log syslogd)
      (pcscd)
      (samba-nmbd)
      (samba-smbd)
      (samba-winbindd)
      (wsdd)
      (rsync)
      (thermald)
      (rpcbind-daemon)
      (idmap-daemon)
      (gss-daemon)
      (rpc-pipefs)
      (pagekite)
      (ipfs)
      (vswitchd)
      (unblocked-wifi)
      (iptables)
      (nftables)
      (opendht dhtnode dhtproxy)
      (prometheus-node-exporter)
      (vnstatd)
      (radicale)
      (dovecot)
      (rspamd)
      (imap4d)
      (kernel-module-loader)
      (rasdaemon)
      (cachefilesd)
      (directory-server-localhost)
      (guix-data-service)
      (guix-data-service-setup-database)
      (guix-data-service-process-jobs)
      (guix-build-coordinator)
      (wesnoth-daemon)
      (joycond)
      (transmission-daemon transmission bittorrent)
      (dockerd)
      (containerd)
      (kresd)
      (dnsmasq)
      (inputattach)
      (elogind)
      (bluetooth)
      (x11-socket-directory)
      (seatd elogind)
      (upower-daemon)
      (postgres-roles)
      (mysql-upgrade)
      (cups)
      (cgroups2-limits)
      (cgroups2-fs-owner)
      (laminar)
      (gpm)
      (udev)
      (urandom-seed)
      (virtual-terminal)
      (trng)
      (user-processes)
      (auditd))
--8<---------------cut here---------------end--------------->8---

Some of them are legitimate, many are not.  (Not sure why ‘virtlogd’
doesn’t show up here.)

> Also the purpose of the user-processes service (and maybe also the
> filesystems) service as synchronization targets are documented only in
> their definition and implicitly with the shepherd graph
> image. System-shepherd services that dont depend on anything are
> probably a bad idea and seems like a very common mistake for (new)
> users implementing their own services.
> Maybe this should be a a more explicit note in the documentation for
> shepherd-service-requirement and/or a small paragraph in the shepherd
> services intro?

Yes, agreed.  I’m not entirely sure where to document it; do you have
ideas?

(The doc in this area probably needs a Spring cleanup…)

> Is there a reason for user-processes to block on waiting for every
> process execpt PID1 to exit or why during the (sleep 1) calls other
> services (that falsely dont depend on user-processes) are not being
> stopped in the meantime which would help resolve the deadlock?

The assumption is that services have been stopped by the time
‘user-processes’ is stopped (because they’re supposed to depend on it).
Thus, when ‘user-processes’ is stopped, normally only user processes are
left.

> But insisting on restarting a service seems a bit pointless to me
> during shutdown/reboot where everything will be terminated anyway.

Agreed, I’ll see how to do that on the shepherd side.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Fri, 21 Feb 2025 15:06:03 GMT) Full text and rfc822 format available.

Message #40 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Dariqq <dariqq <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76338 <at> debbugs.gnu.org
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Fri, 21 Feb 2025 15:04:54 +0000
Hello,

On 21.02.25 11:52, Ludovic Courtès wrote:
> Hello,
> 
> Dariqq <dariqq <at> posteo.net> skribis:
> 
>> The two services that I know of are thermald and virtlogd.
> 
> I found these:
> 
> --8<---------------cut here---------------start------------->8--- 
> scheme@(guix scripts system search)> ,pp (map shepherd-service- 
> provision (append-map (lambda (services) (remove (lambda (service) 
> (memq 'user-processes (shepherd-service-requirement service))) 
> services)) (map service-type-default-shepherd-services (fold- 
> service- types cons '()))))

> 
> Some of them are legitimate, many are not.  (Not sure why ‘virtlogd’
> doesn’t show up here.)
> 

Neat trick. A lot more than I thought.

>> Also the purpose of the user-processes service (and maybe also the
>> filesystems) service as synchronization targets are documented 
>> only in their definition and implicitly with the shepherd graph 
>> image. System-shepherd services that dont depend on anything are 
>> probably a bad idea and seems like a very common mistake for (new)
>> users implementing their own services. Maybe this should be a a
>> more explicit note in the documentation for shepherd-service- 
>> requirement and/or a small paragraph in the shepherd services 
>> intro?
> 
> Yes, agreed.  I’m not entirely sure where to document it; do you 
> have ideas?
> 

Maybe near the shepherd-graph image in "Shepherd Services" where the
special "targets" can be seen as well (the image looks a bit outdated as
e.g.the filesystem "target" is missing)? Not sure if there is another
 "target" worth documenting.

Also maybe a comment or warning in the documentation for shepherd-
service-requirement field that root-shepherd services that don't depend
on anything/ don't depend on user-processes is most likely not what a
user wants for a usual daemon service?

Consistency in all guix services helps as well,s.t. one can look at an
example and then wonder what this user-processes service is about.

> (The doc in this area probably needs a Spring cleanup…)
> 
> 
> Thanks, Ludo’.





Information forwarded to liliana.prikler <at> gmail.com, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, bug-guix <at> gnu.org:
bug#76338; Package guix. (Sat, 22 Feb 2025 22:25:01 GMT) Full text and rfc822 format available.

Message #43 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/2] services: Add missing Shepherd dependency on ‘user-processes’.
Date: Sat, 22 Feb 2025 23:23:48 +0100
Fixes <https://issues.guix.gnu.org/76368>.

* gnu/services/auditd.scm (auditd-shepherd-service):
* gnu/services/base.scm (rngd-service-type):
(gpm-shepherd-service):
* gnu/services/ci.scm (laminar-shepherd-service):
* gnu/services/containers.scm (rootless-podman-cgroups-fs-owner-service):
(rootless-podman-cgroups-limits-service):
* gnu/services/cups.scm (cups-shepherd-service):
* gnu/services/databases.scm (postgresql-role-shepherd-service):
* gnu/services/desktop.scm (upower-shepherd-service):
(bluetooth-shepherd-service):
(elogind-shepherd-service):
(inputattach-shepherd-service):
(seatd-shepherd-service):
* gnu/services/dns.scm (knot-resolver-shepherd-services):
(dnsmasq-shepherd-service):
* gnu/services/docker.scm (containerd-shepherd-service):
(docker-shepherd-service):
* gnu/services/file-sharing.scm (transmission-daemon-shepherd-service):
* gnu/services/games.scm (joycond-shepherd-service):
(wesnothd-shepherd-service):
* gnu/services/guix.scm (guix-build-coordinator-shepherd-services):
(guix-data-service-shepherd-services):
(nar-herder-shepherd-services):
(bffe-shepherd-services):
* gnu/services/ldap.scm (directory-server-shepherd-service):
* gnu/services/linux.scm (cachefilesd-shepherd-service):
(rasdaemon-shepherd-service):
* gnu/services/mail.scm (dovecot-shepherd-service):
(imap4d-shepherd-service):
(radicale-shepherd-service):
(rspamd-configuration):
* gnu/services/monitoring.scm (prometheus-node-exporter-shepherd-service):
(vnstat-shepherd-service):
* gnu/services/networking.scm (opendht-shepherd-service):
(openvswitch-shepherd-service):
(pagekite-shepherd-service):
(ipfs-shepherd-service):
* gnu/services/nfs.scm (rpcbind-service-type):
(gss-service-type):
(idmap-service-type):
* gnu/services/pm.scm (thermald-shepherd-service):
* gnu/services/rsync.scm (rsync-shepherd-service):
* gnu/services/samba.scm (samba-samba-shepherd-service):
(samba-nmbd-shepherd-service):
(samba-smbd-shepherd-service):
(samba-winbindd-shepherd-service):
(wsdd-shepherd-service):
* gnu/services/security-token.scm (pcscd-shepherd-service):
* gnu/services/sound.scm (speakersafetyd-shepherd-service):
* gnu/services/spice.scm (spice-vdagent-shepherd-service):
* gnu/services/ssh.scm (lsh-shepherd-service):
(openssh-shepherd-service):
(dropbear-shepherd-service):
(autossh-shepherd-service):
* gnu/services/telephony.scm (jami-shepherd-services):
(mumble-server-shepherd-service):
* gnu/services/version-control.scm (git-daemon-shepherd-service):
* gnu/services/virtualization.scm (virtlogd-shepherd-service):
* gnu/services/vnc.scm (xvnc-shepherd-service):
* gnu/services/vpn.scm (openvpn-shepherd-service):
(strongswan-shepherd-service):
* gnu/services/web.scm (httpd-shepherd-services):
(fcgiwrap-shepherd-service):
(php-fpm-shepherd-service):
(hpcguix-web-shepherd-service):
(tailon-shepherd-service):
(varnish-shepherd-service):
(whoogle-shepherd-service):
(mumi-shepherd-services):
(gmnisrv-shepherd-service):
(agate-shepherd-service): Add ‘user-processes’ requirement.
* doc/guix.texi (Mail Services): Update accordingly.

Reported-by: Dariqq <dariqq <at> posteo.net>
Change-Id: I947bd2afc83b786cb17c555cfe73ab586b806618
---
 doc/guix.texi                    |  2 +-
 gnu/services/auditd.scm          |  1 +
 gnu/services/base.scm            |  4 ++--
 gnu/services/ci.scm              |  2 +-
 gnu/services/containers.scm      |  6 ++++--
 gnu/services/cups.scm            |  2 +-
 gnu/services/databases.scm       |  2 +-
 gnu/services/desktop.scm         | 10 +++++-----
 gnu/services/dns.scm             |  4 ++--
 gnu/services/docker.scm          |  4 +++-
 gnu/services/file-sharing.scm    |  2 +-
 gnu/services/games.scm           |  4 ++--
 gnu/services/guix.scm            | 12 ++++++------
 gnu/services/ldap.scm            |  2 +-
 gnu/services/linux.scm           |  4 ++--
 gnu/services/mail.scm            |  8 ++++----
 gnu/services/monitoring.scm      |  4 ++--
 gnu/services/networking.scm      |  8 ++++----
 gnu/services/nfs.scm             |  6 +++---
 gnu/services/pm.scm              |  1 +
 gnu/services/rsync.scm           |  1 +
 gnu/services/samba.scm           | 10 +++++-----
 gnu/services/security-token.scm  |  2 +-
 gnu/services/sound.scm           |  2 +-
 gnu/services/spice.scm           |  2 +-
 gnu/services/ssh.scm             | 11 +++++++----
 gnu/services/telephony.scm       |  6 +++---
 gnu/services/version-control.scm |  2 +-
 gnu/services/virtualization.scm  |  1 +
 gnu/services/vnc.scm             |  2 +-
 gnu/services/vpn.scm             |  4 ++--
 gnu/services/web.scm             | 22 ++++++++++++----------
 32 files changed, 83 insertions(+), 70 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 83ba0f32923..1bfe76f016d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -29519,7 +29519,7 @@ Mail Services
 @item @code{skip-template?} (default: @code{#f}) (type: boolean)
 Do not apply Jinja templates.
 
-@item @code{shepherd-requirements} (default: @code{(loopback)}) (type: list-of-symbols)
+@item @code{shepherd-requirements} (default: @code{(user-processes loopback)}) (type: list-of-symbols)
 This is a list of symbols naming Shepherd services that this service
 will depend on.
 
diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm
index abde811f51f..7c6c87a060c 100644
--- a/gnu/services/auditd.scm
+++ b/gnu/services/auditd.scm
@@ -56,6 +56,7 @@ (define (auditd-shepherd-service config)
     (list (shepherd-service
            (documentation "Auditd allows you to audit file system accesses and process execution.")
            (provision '(auditd))
+           (requirement '(user-processes))
            (start #~(make-forkexec-constructor
                      (list (string-append #$audit "/sbin/auditd") "-c" #$configuration-directory)
                      #:pid-file "/var/run/auditd.pid"))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 0cd4d3e9cd0..2ff9bee4a79 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -721,7 +721,7 @@ (define rngd-service-type
 
       (shepherd-service
         (documentation "Add TRNG to entropy pool.")
-        (requirement '(udev))
+        (requirement '(user-processes udev))
         (provision '(trng))
         (start #~(make-forkexec-constructor '#$rngd-command))
         (stop #~(make-kill-destructor))))
@@ -2791,7 +2791,7 @@ (define (gpm-shepherd-service config)
   (match-record config <gpm-configuration>
     (gpm options)
     (list (shepherd-service
-           (requirement '(udev))
+           (requirement '(user-processes udev))
            (provision '(gpm))
            ;; 'gpm' runs in the background and sets a PID file.
            ;; Note that it requires running as "root".
diff --git a/gnu/services/ci.scm b/gnu/services/ci.scm
index 01cc7c7d860..d0363595a20 100644
--- a/gnu/services/ci.scm
+++ b/gnu/services/ci.scm
@@ -79,7 +79,7 @@ (define laminar-shepherd-service
      (list (shepherd-service
             (documentation "Run Laminar.")
             (provision '(laminar))
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       (list #$(file-append laminar "/sbin/laminard"))
                       #:environment-variables
diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm
index 19d35ccbcb6..b3cd109ce6c 100644
--- a/gnu/services/containers.scm
+++ b/gnu/services/containers.scm
@@ -153,7 +153,8 @@ (define (cgroups-fs-owner-entrypoint config)
 (define (rootless-podman-cgroups-fs-owner-service config)
   (shepherd-service (provision '(cgroups2-fs-owner))
                     (requirement
-                     '(dbus-system
+                     '(user-processes
+                       dbus-system
                        elogind
                        file-system-/sys/fs/cgroup
                        networking
@@ -180,7 +181,8 @@ (define cgroups-limits-entrypoint
 (define (rootless-podman-cgroups-limits-service config)
   (shepherd-service (provision '(cgroups2-limits))
                     (requirement
-                     '(dbus-system
+                     '(user-processes
+                       dbus-system
                        elogind
                        networking
                        udev
diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm
index d95c38b4d91..738bb7f5cc3 100644
--- a/gnu/services/cups.scm
+++ b/gnu/services/cups.scm
@@ -1008,7 +1008,7 @@ (define (cups-shepherd-service config)
     (list (shepherd-service
            (documentation "Run the CUPS print server.")
            (provision '(cups))
-           (requirement '(networking))
+           (requirement '(user-processes networking))
            (start #~(make-forkexec-constructor
                      (list (string-append #$cups "/sbin/cupsd")
                            "-f" "-c" #$cupsd.conf "-s" #$cups-files.conf)))
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index 6530c6f0a12..6d80376d90d 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -443,7 +443,7 @@ (define (postgresql-role-shepherd-service config)
   (match-record config <postgresql-role-configuration>
     (log)
     (list (shepherd-service
-           (requirement '(postgres))
+           (requirement '(user-processes postgres))
            (provision '(postgres-roles))
            (one-shot? #t)
            (start
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 708034f89c4..ee05bd98db9 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -304,7 +304,7 @@ (define (upower-shepherd-service config)
     (list (shepherd-service
            (documentation "Run the UPower power and battery monitor.")
            (provision '(upower-daemon))
-           (requirement '(dbus-system udev))
+           (requirement '(user-processes dbus-system udev))
 
            (start #~(make-forkexec-constructor
                      (list (string-append #$upower "/libexec/upowerd"))
@@ -859,7 +859,7 @@ (define (bluetooth-shepherd-service config)
   "Return a shepherd service for @command{bluetoothd}."
   (shepherd-service
    (provision '(bluetooth))
-   (requirement '(dbus-system udev))
+   (requirement '(user-processes dbus-system udev))
    (documentation "Run the bluetoothd daemon.")
    (start #~(make-forkexec-constructor
              (list #$(file-append (bluetooth-configuration-bluez config)
@@ -1303,7 +1303,7 @@ (define (elogind-shepherd-service config)
     (elogind-configuration-file config))
 
   (list (shepherd-service
-         (requirement '(dbus-system))
+         (requirement '(user-processes dbus-system))
          (provision '(elogind))
          (start #~(make-forkexec-constructor
                    (list #$(file-append (elogind-package config)
@@ -1953,7 +1953,7 @@ (define inputattach-shepherd-service
                                device))))
        (list (shepherd-service
               (provision '(inputattach))
-              (requirement '(udev))
+              (requirement '(user-processes udev))
               (documentation "inputattach daemon")
               (start #~(make-forkexec-constructor
                         (cons (string-append #$inputattach
@@ -2067,7 +2067,7 @@ (define-record-type* <seatd-configuration> seatd-configuration
 (define (seatd-shepherd-service config)
   (list (shepherd-service
          (documentation "Minimal seat management daemon")
-         (requirement '())
+         (requirement '(user-processes))
          ;; TODO: once cgroups is separate dependency
          ;; here we should depend on it rather than elogind
          (provision '(seatd elogind))
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index dcfb90235c1..05291eb65d9 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -700,7 +700,7 @@ (define knot-resolver-shepherd-services
      (list
       (shepherd-service
        (provision '(kresd))
-       (requirement '(networking))
+       (requirement '(user-processes networking))
        (documentation "Run the Knot Resolver daemon.")
        (start #~(make-forkexec-constructor
                  '(#$(file-append package "/sbin/kresd")
@@ -816,7 +816,7 @@ (define (dnsmasq-shepherd-service config)
      tftp-root tftp-unique-root extra-options)
     (shepherd-service
      (provision (dnsmasq-provision config))
-     (requirement '(networking))
+     (requirement '(user-processes networking))
      (documentation "Run the dnsmasq DNS server.")
      (start #~(make-forkexec-constructor
                (list
diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
index 5837784c7f1..9ab3e583345 100644
--- a/gnu/services/docker.scm
+++ b/gnu/services/docker.scm
@@ -157,6 +157,7 @@ (define (containerd-shepherd-service config)
     (shepherd-service
      (documentation "containerd daemon.")
      (provision '(containerd))
+     (requirement '(user-processes))
      (start #~(make-forkexec-constructor
                (list (string-append #$containerd "/bin/containerd")
                      #$@(if debug?
@@ -195,7 +196,8 @@ (define (docker-shepherd-service config)
     (shepherd-service
            (documentation "Docker daemon.")
            (provision '(dockerd))
-           (requirement '(containerd
+           (requirement '(user-processes
+                          containerd
                           dbus-system
                           elogind
                           file-system-/sys/fs/cgroup
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index 4b6867bc070..d0e9a8ca901 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -635,7 +635,7 @@ (define (transmission-daemon-shepherd-service config)
     (list
      (shepherd-service
       (provision '(transmission-daemon transmission bittorrent))
-      (requirement '(networking))
+      (requirement '(user-processes networking))
       (documentation "Share files using the BitTorrent protocol.")
       (start #~(make-forkexec-constructor
                 '(#$(file-append transmission "/bin/transmission-daemon")
diff --git a/gnu/services/games.scm b/gnu/services/games.scm
index 2557b82bec7..cea442fd3ae 100644
--- a/gnu/services/games.scm
+++ b/gnu/services/games.scm
@@ -53,7 +53,7 @@ (define (joycond-shepherd-service config)
     (list (shepherd-service
            (documentation "Run joycond.")
            (provision '(joycond))
-           (requirement '(bluetooth))
+           (requirement '(user-processes bluetooth))
            (start #~(make-forkexec-constructor
                      (list #$(file-append joycond "/bin/joycond"))))
            (stop #~(make-kill-destructor))))))
@@ -109,7 +109,7 @@ (define wesnothd-shepherd-service
        (shepherd-service
         (documentation "The Battle for Wesnoth server")
         (provision '(wesnoth-daemon))
-        (requirement '(networking))
+        (requirement '(user-processes networking))
         (start #~(make-forkexec-constructor
                   (list #$wesnothd "-p" #$(number->string port))
                   #:user "wesnothd" #:group "wesnothd"))
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index 86a1e1bf52f..24d22a7a3d1 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -334,7 +334,7 @@ (define (guix-build-coordinator-shepherd-services config)
      (shepherd-service
       (documentation "Guix Build Coordinator")
       (provision '(guix-build-coordinator))
-      (requirement '(networking))
+      (requirement '(user-processes networking))
       (start #~(lambda args
                  (parameterize ((%current-logfile-date-format ""))
                    (apply
@@ -585,7 +585,7 @@ (define (guix-data-service-shepherd-services config)
      (shepherd-service
       (documentation "Guix Data Service web server")
       (provision '(guix-data-service))
-      (requirement '(postgres networking))
+      (requirement '(user-processes postgres networking))
       (start #~(make-forkexec-constructor
                 (list #$(file-append package
                                      "/bin/guix-data-service")
@@ -612,7 +612,7 @@ (define (guix-data-service-shepherd-services config)
      (shepherd-service
       (documentation "Guix Data Service setup database")
       (provision '(guix-data-service-setup-database))
-      (requirement '(postgres))
+      (requirement '(user-processes postgres))
       (one-shot? #t)
       (start
        (with-extensions (cons package
@@ -647,7 +647,7 @@ (define (guix-data-service-shepherd-services config)
      (shepherd-service
       (documentation "Guix Data Service process jobs")
       (provision '(guix-data-service-process-jobs))
-      (requirement '(postgres networking))
+      (requirement '(user-processes postgres networking))
       (start #~(make-forkexec-constructor
                 (list
                  #$(file-append package
@@ -923,7 +923,7 @@ (define (nar-herder-shepherd-services config)
      (shepherd-service
       (documentation "Nar Herder")
       (provision '(nar-herder))
-      (requirement '(networking))
+      (requirement '(user-processes networking))
       (start #~(make-forkexec-constructor
                 (list #$(file-append package
                                      "/bin/nar-herder")
@@ -1097,7 +1097,7 @@ (define (bffe-shepherd-services config)
      (shepherd-service
       (documentation "Build Farm Front-end")
       (provision '(bffe))
-      (requirement '(networking))
+      (requirement '(user-processes networking))
       (start #~(make-forkexec-constructor
                 (list #$start-script)
                 #:user #$user
diff --git a/gnu/services/ldap.scm b/gnu/services/ldap.scm
index 49a33fac086..76f9b14a412 100644
--- a/gnu/services/ldap.scm
+++ b/gnu/services/ldap.scm
@@ -229,7 +229,7 @@ (define (directory-server-shepherd-service config)
            (documentation "Run an 389 directory server instance.")
            (provision (list (symbol-append 'directory-server-
                                            (string->symbol instance-name))))
-           (requirement '())
+           (requirement '(user-processes))
            (start #~(make-forkexec-constructor
                      (list #$(file-append 389-ds-base "/sbin/dsctl")
                            #$instance-name "start")
diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index fb089b965f8..b22dbeefa03 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -469,7 +469,7 @@ (define (cachefilesd-shepherd-service config)
         (shepherd-service
          (documentation "Run the cachefilesd daemon for FS-Cache.")
          (provision '(cachefilesd))
-         (requirement (append '(file-systems)
+         (requirement (append '(user-processes file-systems)
                               (if use-syslog? '(syslogd) '())))
          (start #~(begin
                     (and=> #$(maybe-value cache-directory) mkdir-p)
@@ -523,7 +523,7 @@ (define (rasdaemon-shepherd-service config)
   (shepherd-service
    (documentation "Run rasdaemon")
    (provision '(rasdaemon))
-   (requirement '(syslogd))
+   (requirement '(user-processes syslogd))
    (start #~(make-forkexec-constructor
              '#$(rasdaemon-configuration->command-line-args config)))
    (stop #~(make-kill-destructor))))
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 18b482272c7..4ab0d681348 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1600,7 +1600,7 @@ (define (dovecot-shepherd-service config)
     (list (shepherd-service
            (documentation "Run the Dovecot POP3/IMAP mail server.")
            (provision '(dovecot))
-           (requirement '(pam networking))
+           (requirement '(user-processes pam networking))
            (start #~(make-forkexec-constructor
                      (list (string-append #$dovecot "/sbin/dovecot")
                            "-F")))
@@ -1903,7 +1903,7 @@ (define imap4d-shepherd-service
     (($ <imap4d-configuration> package config-file)
      (list (shepherd-service
             (provision '(imap4d))
-            (requirement '(networking syslogd))
+            (requirement '(user-processes networking syslogd))
             (documentation "Run the imap4d daemon.")
             (start (let ((imap4d (file-append package "/sbin/imap4d")))
                      #~(make-forkexec-constructor
@@ -2195,7 +2195,7 @@ (define (radicale-shepherd-service cfg)
   (list (shepherd-service
          (provision '(radicale))
          (documentation "Run the radicale daemon.")
-         (requirement '(networking))
+         (requirement '(user-processes networking))
          (start #~(make-forkexec-constructor
                    (list #$(file-append (radicale-configuration-package cfg)
                                         "/bin/radicale")
@@ -2317,7 +2317,7 @@ (define-configuration/no-serialization rspamd-configuration
    (boolean #f)
    "Do not apply Jinja templates.")
   (shepherd-requirements
-   (list-of-symbols '(loopback))
+   (list-of-symbols '(user-processes loopback))
    "This is a list of symbols naming Shepherd services that this service
 will depend on."))
 
diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index 59cf4710ea4..f504c61afdf 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -196,7 +196,7 @@ (define prometheus-node-exporter-shepherd-service
       (shepherd-service
        (documentation "Prometheus node exporter.")
        (provision '(prometheus-node-exporter))
-       (requirement '(networking))
+       (requirement '(user-processes networking))
        (start #~(make-forkexec-constructor
                  (list #$(file-append package "/bin/node_exporter")
                        "--web.listen-address" #$web-listen-address
@@ -630,7 +630,7 @@ (define (vnstat-shepherd-service config)
     (match-record config <vnstat-configuration> (package pid-file)
       (shepherd-service
        (documentation "Run vnstatd.")
-       (requirement `(networking file-systems))
+       (requirement `(user-processes networking file-systems))
        (provision '(vnstatd))
        (start #~(make-forkexec-constructor
                  (list #$(file-append package "/sbin/vnstatd")
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index f7c2471535a..53840c27642 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -936,7 +936,7 @@ (define (opendht-shepherd-service config)
   (shepherd-service
    (documentation "Run an OpenDHT node.")
    (provision '(opendht dhtnode dhtproxy))
-   (requirement '(networking syslogd))
+   (requirement '(user-processes networking syslogd))
    (start #~(make-forkexec-constructor
              (list #$@(opendht-configuration->command-line-arguments config))
              #:user "opendht"
@@ -2036,7 +2036,7 @@ (define (openvswitch-shepherd-service config)
            (stop #~(make-kill-destructor)))
           (shepherd-service
            (provision '(vswitchd))
-           (requirement '(ovsdb))
+           (requirement '(user-processes ovsdb))
            (documentation "Run the Open vSwitch daemon.")
            (start #~(make-forkexec-constructor
                      (list #$ovs-vswitchd "--pidfile")
@@ -2248,7 +2248,7 @@ (define (pagekite-shepherd-service config)
       (shepherd-service
        (documentation "Run the PageKite service.")
        (provision '(pagekite))
-       (requirement '(networking))
+       (requirement '(user-processes networking))
        (actions (list (shepherd-configuration-action config-file)))
        (start #~(make-forkexec-constructor
                  (list #$pagekite
@@ -2446,7 +2446,7 @@ (define (ipfs-shepherd-service config)
          ;; While IPFS is most useful when the machine is connected
          ;; to the network, only loopback is required for starting
          ;; the service.
-         (requirement '(loopback))
+         (requirement '(user-processes loopback))
          (documentation "Connect to the IPFS network")
          (start #~(make-forkexec-constructor
                    #$ipfs-daemon-command
diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm
index 209cde24b35..f5a1c6a44e8 100644
--- a/gnu/services/nfs.scm
+++ b/gnu/services/nfs.scm
@@ -74,7 +74,7 @@ (define rpcbind-service-type
 
            (shepherd-service
             (documentation "Start the RPC bind daemon.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (provision '(rpcbind-daemon))
 
             (start #~(make-forkexec-constructor #$rpcbind-command))
@@ -164,7 +164,7 @@ (define gss-service-type
 
            (shepherd-service
             (documentation "Start the RPC GSS daemon.")
-            (requirement '(rpcbind-daemon rpc-pipefs))
+            (requirement '(user-processes rpcbind-daemon rpc-pipefs))
             (provision '(gss-daemon))
 
             (start #~(make-forkexec-constructor #$gss-command))
@@ -236,7 +236,7 @@ (define idmap-service-type
 
            (shepherd-service
             (documentation "Start the RPC IDMAP daemon.")
-            (requirement '(rpcbind-daemon rpc-pipefs))
+            (requirement '(user-processes rpcbind-daemon rpc-pipefs))
             (provision '(idmap-daemon))
             (start #~(make-forkexec-constructor #$idmap-command))
             (stop #~(make-kill-destructor))))))
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 1978de55d47..64b64e01fb8 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -511,6 +511,7 @@ (define (thermald-shepherd-service config)
   (list
    (shepherd-service
     (provision '(thermald))
+    (requirement '(user-processes))
     (documentation "Run thermald cpu frequency scaling.")
     (start #~(make-forkexec-constructor
               '(#$(file-append (thermald-thermald config) "/sbin/thermald")
diff --git a/gnu/services/rsync.scm b/gnu/services/rsync.scm
index e85dd509346..4bbf2c4eff1 100644
--- a/gnu/services/rsync.scm
+++ b/gnu/services/rsync.scm
@@ -277,6 +277,7 @@ (define (rsync-shepherd-service config)
                                   "--config" #$config-file "--daemon")))
       (list (shepherd-service
              (provision '(rsync))
+             (requirement '(user-processes))
              (documentation "Run rsync daemon.")
              (actions (list (shepherd-configuration-action config-file)))
              (start #~(if #$inetd-style?
diff --git a/gnu/services/samba.scm b/gnu/services/samba.scm
index dfc77785702..23d5cc45a07 100644
--- a/gnu/services/samba.scm
+++ b/gnu/services/samba.scm
@@ -91,7 +91,7 @@ (define (samba-samba-shepherd-service config)
        (list (shepherd-service
               (documentation "Run Samba")
               (provision '(samba-samba))
-              (requirement '(networking))
+              (requirement '(user-processes networking))
               (start #~(make-forkexec-constructor
                         (list #$(file-append package "/sbin/samba")
                               (string-append "--configfile=" #$config-file)
@@ -105,7 +105,7 @@ (define (samba-nmbd-shepherd-service config)
        (list (shepherd-service
               (documentation "Run NMBD")
               (provision '(samba-nmbd))
-              (requirement '(networking))
+              (requirement '(user-processes networking))
               (start #~(make-forkexec-constructor
                         (list #$(file-append package "/sbin/nmbd")
                               (string-append "--configfile=" #$config-file)
@@ -119,7 +119,7 @@ (define (samba-smbd-shepherd-service config)
        (list (shepherd-service
               (documentation "Run SMBD")
               (provision '(samba-smbd))
-              (requirement '(networking))
+              (requirement '(user-processes networking))
               (start #~(make-forkexec-constructor
                         (list #$(file-append package "/sbin/smbd")
                               (string-append "--configfile=" #$config-file)
@@ -133,7 +133,7 @@ (define (samba-winbindd-shepherd-service config)
        (list (shepherd-service
               (documentation "Run Winnbindd for Name Service Switch")
               (provision '(samba-winbindd))
-              (requirement '(networking))
+              (requirement '(user-processes networking))
               (start #~(make-forkexec-constructor
                         (list #$(file-append package "/sbin/winbindd")
                               (string-append "--configfile=" #$config-file)
@@ -222,7 +222,7 @@ (define (wsdd-shepherd-service config)
 like your local NAS device, to be found by Web Service Discovery Clients
 like Windows.")
             (provision '(wsdd))
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       (list #$(file-append package "/bin/wsdd")
                             #$@(if ipv4only?
diff --git a/gnu/services/security-token.scm b/gnu/services/security-token.scm
index d971091e732..7d6c0e0f8da 100644
--- a/gnu/services/security-token.scm
+++ b/gnu/services/security-token.scm
@@ -53,7 +53,7 @@ (define pcscd-shepherd-service
      (shepherd-service
       (documentation "PC/SC Smart Card Daemon")
       (provision '(pcscd))
-      (requirement '(syslogd))
+      (requirement '(user-processes syslogd))
       (start #~(lambda _
                  (let ((socket "/run/pcscd/pcscd.comm"))
                    (when (file-exists? socket)
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index 20f78bb500b..fbaa55c5533 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -301,7 +301,7 @@ (define speakersafetyd-shepherd-service
     (shepherd-service
      (documentation "Run the speaker safety daemon")
      (provision '(speakersafetyd))
-     (requirement '(udev))
+     (requirement '(user-processes udev))
      (start #~(make-forkexec-constructor
                (list #$(file-append speakersafetyd "/bin/speakersafetyd")
                      "--config-path" #$configuration-directory
diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
index b8d2f8486e9..59c5c186274 100644
--- a/gnu/services/spice.scm
+++ b/gnu/services/spice.scm
@@ -47,7 +47,7 @@ (define (spice-vdagent-shepherd-service config)
   (list
    (shepherd-service
     (documentation "Spice vdagentd service")
-    (requirement '(dbus-system))
+    (requirement '(user-processes dbus-system))
     (provision '(spice-vdagentd))
     (start #~(lambda args
                ;; spice-vdagentd supports being activated upon the client
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index f759c5cf6e9..12547b3c7b3 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014-2019, 2022-2024 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2014-2019, 2022-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
 ;;; Copyright © 2016 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2017 Clément Lassieur <clement <at> lassieur.org>
@@ -218,7 +218,8 @@ (define (lsh-shepherd-service config)
                      interfaces)))))
 
   (define requires
-    `(networking
+    `(user-processes
+      networking
       pam
       ,@(if (and daemonic? (lsh-configuration-syslog-output? config))
             '(syslogd)
@@ -595,7 +596,7 @@ (define (openssh-shepherd-service config)
 
          ;; On the Hurd, this can only be started after pfinet is up, hence
          ;; the dependency on 'networking'.
-         (requirement '(pam syslogd loopback networking))
+         (requirement '(user-processes pam syslogd loopback networking))
          (provision '(ssh-daemon ssh sshd))
 
          (start #~(if #$inetd-style?
@@ -726,7 +727,8 @@ (define (dropbear-shepherd-service config)
 
   (define requires
     (if (dropbear-configuration-syslog-output? config)
-        '(networking syslogd) '(networking)))
+        '(user-processes networking syslogd)
+        '(user-processes networking)))
 
   (list (shepherd-service
          (documentation "Dropbear SSH server.")
@@ -794,6 +796,7 @@ (define (autossh-shepherd-service config)
   (shepherd-service
    (documentation "Automatically set up ssh connections (and keep them alive).")
    (provision '(autossh))
+   (requirement '(user-processes))
    (start #~(make-forkexec-constructor
              (list #$(file-append autossh "/bin/autossh")
                    #$@(autossh-configuration-ssh-options config))
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 16d109b8b1b..9926f4107de 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -547,7 +547,7 @@ (define (jami-shepherd-services config)
                           ,@%default-modules))
                ;; The requirement on dbus-system is to ensure other required
                ;; activation for D-Bus, such as a /etc/machine-id file.
-               (requirement '(dbus-system syslogd))
+               (requirement '(user-processes dbus-system syslogd))
                (start
                 #~(lambda ()
                     (define pid
@@ -580,7 +580,7 @@ (define (jami-shepherd-services config)
                               list-banned-contacts-action
                               enable-account-action
                               disable-account-action))
-               (requirement '(jami-dbus-session))
+               (requirement '(user-processes jami-dbus-session))
                (modules `((ice-9 format)
                           (ice-9 ftw)
                           (ice-9 match)
@@ -944,7 +944,7 @@ (define (mumble-server-shepherd-service config)
   (list (shepherd-service
          (provision '(mumble-server))
          (documentation "Run the Mumble server.")
-         (requirement '(networking))
+         (requirement '(user-processes networking))
          (start #~(make-forkexec-constructor
                    '(#$(file-append (mumble-server-configuration-package config)
                                     "/bin/mumble-server")
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index 14ff0a59a6b..06b6ff224dc 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -136,7 +136,7 @@ (define git-daemon-shepherd-service
                        ,@whitelist)))
        (list (shepherd-service
               (documentation "Run the git-daemon.")
-              (requirement '(networking))
+              (requirement '(user-processes networking))
               (provision '(git-daemon))
               (start #~(make-forkexec-constructor '#$command
                                                   #:user "git-daemon"
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index b697ae95269..88cc91bb490 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -573,6 +573,7 @@ (define (virtlogd-shepherd-service config)
     (list (shepherd-service
            (documentation "Run the virtlog daemon.")
            (provision '(virtlogd))
+           (requirement '(user-processes))
            (start #~(make-forkexec-constructor
                      (list (string-append #$libvirt "/sbin/virtlogd")
                            "-f" #$config-file)))
diff --git a/gnu/services/vnc.scm b/gnu/services/vnc.scm
index 8b9ad0b1799..0b18830d2b5 100644
--- a/gnu/services/vnc.scm
+++ b/gnu/services/vnc.scm
@@ -206,7 +206,7 @@ (define (xvnc-shepherd-service config)
     (shepherd-service
      (provision '(xvnc vncserver))
      (documentation "Run the Xvnc server.")
-     (requirement '(networking syslogd))
+     (requirement '(user-processes networking syslogd))
      (start (if (xvnc-configuration-inetd? config)
                 #~(let* ((inaddr (if #$(xvnc-configuration-localhost? config)
                                      INADDR_LOOPBACK
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index 8e90032c93f..c66622ad6c9 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -506,7 +506,7 @@ (define (openvpn-shepherd-service role)
              (provision (match role
                           ('server '(vpn-server))
                           ('client '(vpn-client))))
-             (requirement '(networking))
+             (requirement '(user-processes networking))
              (start #~(make-forkexec-constructor
                        (list (string-append #$openvpn "/sbin/openvpn")
                              "--writepid" #$pid-file "--config" #$config-file
@@ -693,7 +693,7 @@ (define (strongswan-shepherd-service config)
   (let* ((ipsec (file-append strongswan "/sbin/ipsec"))
         (strongswan-conf-path (strongswan-configuration-file config)))
     (list (shepherd-service
-           (requirement '(networking))
+           (requirement '(user-processes networking))
            (provision '(ipsec))
            (start #~(make-forkexec-constructor
                      (list #$ipsec "start" "--nofork")
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index d42ef09c3c0..7593cd2eaa1 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -471,7 +471,7 @@ (define httpd-shepherd-services
      (list (shepherd-service
             (provision '(httpd))
             (documentation "The Apache HTTP Server")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       `(#$(file-append package "/bin/httpd")
                         #$@(if config
@@ -960,7 +960,7 @@ (define fcgiwrap-shepherd-service
      (list (shepherd-service
             (provision '(fcgiwrap))
             (documentation "Run the fcgiwrap daemon.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       '(#$(file-append package "/sbin/fcgiwrap")
                         "-s" #$socket)
@@ -1144,7 +1144,7 @@ (define php-fpm-shepherd-service
      (list (shepherd-service
             (provision '(php-fpm))
             (documentation "Run the php-fpm daemon.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       '(#$(file-append php "/sbin/php-fpm")
                         "--fpm-config"
@@ -1289,7 +1289,7 @@ (define (hpcguix-web-shepherd-service config)
     (shepherd-service
      (documentation "hpcguix-web daemon")
      (provision     '(hpcguix-web))
-     (requirement   '(networking))
+     (requirement   '(user-processes networking))
      (start #~(make-forkexec-constructor
                (list #$(file-append hpcguix-web "/bin/hpcguix-web")
                      (string-append "--listen="
@@ -1426,6 +1426,7 @@ (define tailon-shepherd-service
     (($ <tailon-configuration> config-file package)
      (list (shepherd-service
             (provision '(tailon))
+            (requirement '(user-processes))
             (documentation "Run the tailon daemon.")
             (start #~(make-forkexec-constructor
                       `(,(string-append #$package "/bin/tailon")
@@ -1618,7 +1619,7 @@ (define varnish-shepherd-service
             (provision (list (symbol-append 'varnish- (string->symbol name))))
             (documentation (string-append "The Varnish Web Accelerator"
                                           " (" name ")"))
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       (list #$(file-append package "/sbin/varnishd")
                             "-n" #$name
@@ -1678,6 +1679,7 @@ (define (whoogle-shepherd-service config)
     (list
      (shepherd-service
       (provision '(whoogle-search))
+      (requirement '(user-processes))
       (start #~(make-forkexec-constructor
                 (list (string-append #$package "/bin/whoogle-search")
                       "--host" #$host "--port" #$(number->string port))
@@ -2066,7 +2068,7 @@ (define (mumi-shepherd-services config)
      (list (shepherd-service
             (provision '(mumi))
             (documentation "Mumi bug-tracking web interface.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       `(#$(file-append mumi "/bin/mumi") "web"
                         ,@(if #$mailer? '() '("--disable-mailer")))
@@ -2077,7 +2079,7 @@ (define (mumi-shepherd-services config)
            (shepherd-service
             (provision '(mumi-worker))
             (documentation "Mumi bug-tracking web interface database worker.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       '(#$(file-append mumi "/bin/mumi") "worker")
                       #:environment-variables #$environment
@@ -2087,7 +2089,7 @@ (define (mumi-shepherd-services config)
            (shepherd-service
             (provision '(mumi-mailer))
             (documentation "Mumi bug-tracking web interface mailer.")
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (start #~(make-forkexec-constructor
                       `(#$(file-append mumi "/bin/mumi") "mailer"
                         ,@(if #$sender
@@ -2142,7 +2144,7 @@ (define gmnisrv-shepherd-service
     (($ <gmnisrv-configuration> package config-file)
      (list (shepherd-service
             (provision '(gmnisrv))
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (documentation "Run the gmnisrv Gemini server.")
             (start (let ((gmnisrv (file-append package "/bin/gmnisrv")))
                      #~(make-forkexec-constructor
@@ -2231,7 +2233,7 @@ (define agate-shepherd-service
                               log-ip? user group log-file)
      (list (shepherd-service
             (provision '(agate))
-            (requirement '(networking))
+            (requirement '(user-processes networking))
             (documentation "Run the agate Gemini server.")
             (start (let ((agate (file-append package "/bin/agate")))
                      #~(make-forkexec-constructor

base-commit: 90aa90eb05429553402e0b5225d23f84742a9286
-- 
2.48.1





Information forwarded to ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, bug-guix <at> gnu.org:
bug#76338; Package guix. (Sat, 22 Feb 2025 22:25:02 GMT) Full text and rfc822 format available.

Message #46 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/2] doc: Write about depending on the ‘user-processes’ Shepherd service.
Date: Sat, 22 Feb 2025 23:23:49 +0100
* doc/guix.texi (Shepherd Services): Add paragraph on ‘user-processes’.

Suggested-by: Dariqq <dariqq <at> posteo.net>
Change-Id: I76fb11779eefc90d13dbc11368ddf64f7450f5e6
---
 doc/guix.texi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1bfe76f016d..b525913c151 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -46142,6 +46142,13 @@ Shepherd Services
 @item @code{requirement} (default: @code{'()})
 List of symbols denoting the Shepherd services this one depends on.
 
+@cindex @code{user-processes} Shepherd service
+With very few exceptions, services that start a daemon must depend at
+least on the @code{user-processes} service; this ensures that these
+daemons are started after all the file systems have been mounted and
+that, during shutdown, they are stopped before attempting to terminate
+remaining user processes.
+
 @cindex one-shot services, for the Shepherd
 @item @code{one-shot?} (default: @code{#f})
 Whether this service is @dfn{one-shot}.  One-shot services stop immediately
-- 
2.48.1





Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Sat, 22 Feb 2025 22:31:02 GMT) Full text and rfc822 format available.

Message #49 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: 76338 <at> debbugs.gnu.org, Richard Sent <richard <at> freakingpenguin.com>,
 Simen Endsjø <contact <at> simendsjo.me>,
 Felix Lechner <felix.lechner <at> lease-up.com>, 76368 <at> debbugs.gnu.org
Subject: Re: bug#76368: Cannot reboot when virtlogd and containerd is running?
Date: Sat, 22 Feb 2025 23:30:09 +0100
Hi,

Ludovic Courtès <ludo <at> gnu.org> skribis:

> I found these:
>
> scheme@(guix scripts system search)> ,pp (map shepherd-service-provision
> 					      (append-map (lambda (services)
> 							    (remove (lambda (service)
> 								      (memq 'user-processes
> 									    (shepherd-service-requirement service)))
> 								    services))
> 							  (map service-type-default-shepherd-services (fold-service-

I’ve just sent a patch in this issue adding ‘user-processes’ to all
these + virtlogd, and another one documenting ‘user-processes’ in the
manual.

I’ll apply it tomorrow if there are no objections.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Sun, 23 Feb 2025 01:48:01 GMT) Full text and rfc822 format available.

Message #52 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Dariqq <dariqq <at> posteo.net>, 76338 <at> debbugs.gnu.org, 76368 <at> debbugs.gnu.org
Subject: Re: bug#76368: Cannot reboot when virtlogd and containerd is running?
Date: Sun, 23 Feb 2025 10:46:57 +0900
Hi Ludovic,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi,
>
> Dariqq <dariqq <at> posteo.net> skribis:
>
>> The issue is that thermald (and possibly other services) don't depend
>> on user-processes service. Don't know why I had no problems until now.
>
> This should be fixed: they should all depend on ‘user-processes’.

I was wondering if this shouldn't be part of an implicit default %shepherd-default-requires that
could be overridden if needed... but I think even in systemd land you
must explicitly specify wanted using e.g. 'WantedBy=multi-user.target'
in your systemd unit definition, so I guess it's fine that it must be
explicitly specified.

It'd be nice though, that in the case where it's missing, if it didn't
cause a hang upon shutdown.  I don't think anything should be able to
hang the system when calling 'shutdown', no matter what (perhaps there
count be some timeout... with a warning like:

--8<---------------cut here---------------start------------->8---
waiting for service X to terminate...
[internal timeout, perhaps defaulting to 60 s or so]
service X forcefully terminated
hint: perhaps X should require the `user-processes' service?
--8<---------------cut here---------------end--------------->8---

If the reason of the hang could be inferred with reasonable certitude
from shepherd's side, even better, though I haven't thought how that
could be done.

LGTM for the two patches you've sent so far!  Thank you.

-- 
Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Sun, 23 Feb 2025 21:53:01 GMT) Full text and rfc822 format available.

Message #55 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Dariqq <dariqq <at> posteo.net>, 76338 <at> debbugs.gnu.org, 76368 <at> debbugs.gnu.org
Subject: Re: bug#76368: Cannot reboot when virtlogd and containerd is running?
Date: Sun, 23 Feb 2025 22:51:49 +0100
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> I was wondering if this shouldn't be part of an implicit default %shepherd-default-requires that
> could be overridden if needed... but I think even in systemd land you
> must explicitly specify wanted using e.g. 'WantedBy=multi-user.target'
> in your systemd unit definition, so I guess it's fine that it must be
> explicitly specified.

I almost changed the default value of ‘requirement’ to '(user-processes)
in <shepherd-service>, but then I thought this would need more testing
and discussion: surely there are places in Guix and in code/config out
there that relies on the current default value.

> It'd be nice though, that in the case where it's missing, if it didn't
> cause a hang upon shutdown.  I don't think anything should be able to
> hang the system when calling 'shutdown', no matter what (perhaps there
> count be some timeout... with a warning like:

Even better: I think shepherd just shouldn’t try to respawn anything
while it’s shutting down.

Not depending on ‘user-processes’ could still cause problems such as
“device or resource busy” when trying to unmount file systems, but at
least it would lead to that infinite loop.

Thanks for your feedback,
Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 23 Feb 2025 23:06:02 GMT) Full text and rfc822 format available.

Notification sent to Dariqq <dariqq <at> posteo.net>:
bug acknowledged by developer. (Sun, 23 Feb 2025 23:06:02 GMT) Full text and rfc822 format available.

Message #60 received at 76338-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Dariqq <dariqq <at> posteo.net>
Cc: 76338-done <at> debbugs.gnu.org, Richard Sent <richard <at> freakingpenguin.com>,
 Simen Endsjø <contact <at> simendsjo.me>,
 Felix Lechner <felix.lechner <at> lease-up.com>, 76368 <at> debbugs.gnu.org
Subject: Re: bug#76368: Cannot reboot when virtlogd and containerd is running?
Date: Mon, 24 Feb 2025 00:04:45 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> I’ve just sent a patch in this issue adding ‘user-processes’ to all
> these + virtlogd, and another one documenting ‘user-processes’ in the
> manual.
>
> I’ll apply it tomorrow if there are no objections.

Pushed:

  bcb772d7d00 doc: Write about depending on the ‘user-processes’ Shepherd service.
  bd7b9e6a601 services: Add missing Shepherd dependency on ‘user-processes’.

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 23 Feb 2025 23:06:02 GMT) Full text and rfc822 format available.

Notification sent to Simen Endsjø <contact <at> simendsjo.me>:
bug acknowledged by developer. (Sun, 23 Feb 2025 23:06:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Mon, 24 Feb 2025 11:01:01 GMT) Full text and rfc822 format available.

Message #68 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Dariqq <dariqq <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76338 <at> debbugs.gnu.org, 76368 <at> debbugs.gnu.org
Subject: Re: bug#76368: Cannot reboot when virtlogd and containerd is running?
Date: Mon, 24 Feb 2025 10:59:43 +0000
Hi Ludo,

Thank you for the patch.

On 23.02.25 22:51, Ludovic Courtès wrote:
> Hi Maxim,
> 
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
> 
>> I was wondering if this shouldn't be part of an implicit default %shepherd-default-requires that
>> could be overridden if needed... but I think even in systemd land you
>> must explicitly specify wanted using e.g. 'WantedBy=multi-user.target'
>> in your systemd unit definition, so I guess it's fine that it must be
>> explicitly specified.
> 
> I almost changed the default value of ‘requirement’ to '(user-processes)
> in <shepherd-service>, but then I thought this would need more testing
> and discussion: surely there are places in Guix and in code/config out
> there that relies on the current default value.
> 

I don't think this would have been a good change:

- It breaks services that correctly don't depend on user-processes, i.e. 
filesystem mounts
- It breaks every home-services that (correctly) depends on nothing but 
the home-shepherd .
- It creates a (non obvious) discrepancy between the shepherd service 
API and the Guix layer on top


Imo ideally all services would expose their shepherd requirements (and 
service-autostart, extra daemon args, daemon-environment, extra actions, 
...) in the configuration records which would allows users to workaround 
such a problem themselves.

The current system depends on whether the author of the service added 
it, feels a bit arbitrary and is not flexible if a setting one would 
like to adjust is not configurable.

(i am guilty of this as well for the service i contributed to guix)

But this for a discussion at another time.

> Thanks for your feedback,
> Ludo’.





Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Wed, 26 Feb 2025 22:27:02 GMT) Full text and rfc822 format available.

Message #71 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76338 <at> debbugs.gnu.org
Cc: Dariqq <dariqq <at> posteo.net>, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Wed, 26 Feb 2025 23:26:21 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Fixes <https://issues.guix.gnu.org/76368>.

I followed up with a Shepherd fix to inhibit respawning when shutting
down:

  https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=94c2516903ad75528898616f453a9dea7fb42eb7

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#76338; Package guix. (Thu, 27 Feb 2025 14:12:03 GMT) Full text and rfc822 format available.

Message #74 received at 76338 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 76338 <at> debbugs.gnu.org, Dariqq <dariqq <at> posteo.net>,
 Vivien Kraus <vivien <at> planete-kraus.eu>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: bug#76338: shepherd restarts service during shutdown and then
 waits forever
Date: Thu, 27 Feb 2025 23:11:04 +0900
Hi Ludovic,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Ludovic Courtès <ludo <at> gnu.org> skribis:
>
>> Fixes <https://issues.guix.gnu.org/76368>.
>
> I followed up with a Shepherd fix to inhibit respawning when shutting
> down:
>
>   https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=94c2516903ad75528898616f453a9dea7fb42eb7

Yay, thanks for the hard work!

-- 
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Mar 2025 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.