1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 02:20:53 +02:00
Commit graph

446 commits

Author SHA1 Message Date
Ludovic Courtès
c33bc80080
services: guix: ‘guix-ownership’ changes store ownership last.
Fixes <https://issues.guix.gnu.org/78355>.

* gnu/services/base.scm (guix-ownership-change-program)[claim-data-ownership]:
Replace hard-coded “/gnu/store” with #$(store-prefix).  Change store
ownership last.

Reported-by: Rutherther <rutherther@ditigal.xyz>
Change-Id: I55189f8bb82bf0c9e030aa042aa928f6f552569e
2025-07-01 23:40:09 +02:00
Quentin Vincent
e417692c4b
gnu: services: base: Set a home directory for the "greeter" user.
Fix a problem that caused an "unable to set working directory: no such file
or directory (os error 2)" error before every login prompt.
The reason for this is that greetd starts agreety as the "greeter" user.
The working directory for the newly created process is, by default,
"/home/greeter", which does not exist (per our instructions).

* gnu/services/base.scm (greetd-accounts)[home-directory]: Set to /var/empty
[shell]: Set to /sbin/nologin.

Change-Id: I6d971968e8b6a7825c261d4695caf0dd70127e5d
Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
2025-06-15 23:29:26 +02:00
Ludovic Courtès
1cd221c9e9
services: static-networking: Remove use of unbound variable.
Use of ‘G_’ was added in 670d985cab but
it’s actually unbound.

* gnu/services/base.scm (network-set-up/linux): Remove uses of ‘G_’,
which is unbound.

Change-Id: I6e879688ceee2fcb738e5e213cd3d539c9d89e20
2025-06-04 16:45:08 +02:00
Maxim Cournoyer
c743d646ee
system: Factorize bashrc default configuration.
This factorizes out the remaining bashrc bits from /etc/skel/.bashrc to a the
template used for both /etc/bashrc on Guix System and ~/.bashrc for
home-bash-service-type.

Rationale: The use of /etc/skel introduce state: the file is only copied
originally when the user account is created, and never (automatically)
refreshed again.

* gnu/system.scm (operating-system-etc-service):
<profile>: Guard against souring /etc/bashrc in non-interactive, SSH case.
<bashrc>: Use %default-bashrc, having migrated the remaining definitions to...
* gnu/system/shadow.scm (%default-bashrc): ... here.  Factorize aliases to...
* gnu/services.scm (%default-bash-aliases): ... here.
(%default-bashrc-d-aliases): New variable.
(%default-etc-bashrc-d-files): Include it in the default configuration.
* gnu/services/base.scm (%base-services): Register etc-bashrc-d-service-type.
* gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now
part of %default-bashrc.
(home-bash-configuration) [guix-defaults?]: Update doc.
[aliases]: Set %default-bash-aliases as the default value.  Update doc.
* doc/guix.texi (Shells Home Services): Update documentation.
(Service Reference): Update example.

Change-Id: I340c614983a78fd20a9c4a9705e7fc542ae9b513
2025-05-26 13:43:03 +09:00
Maxim Cournoyer
3bb6147fdc
services: udev: Also create subsystem nodes at boot.
This is a more correct fix to CDROM/DVDROM events/auto-mounting than was made
in the now-reverted commit 670724edcf ("gnu: eudev: Fix optical discs
detection/auto-mounting.")

This changes causes the 60-block.rules udev rules file shipped with eudev to
correctly set the default polling period to 2000 ms on block devices, which is
necessary for kernel events to be fired for CDROM drives for example.  To
validate it is set:

  # cat /sys/module/block/parameters/events_dfl_poll_msecs
  2000

Before, it would return 0.

* gnu/services/base.scm (udev-shepherd-service): <#:start>: Add a 'udevadm
trigger --change=add --type=subsystems' invocation, so that it also creates
subsystem nodes, as done in Void Linux or LinuxFromScratch init scripts for
example.
* gnu/tests/base.scm (run-basic-test): Add test.

Fixes: <https://issues.guix.gnu.org/35584>
Change-Id: Idc0eb5640163b27e41b72cc0c1885412a60805c1
2025-05-14 22:10:44 +09:00
Rutherther
e9cd72875e
services: guix: Fix case when /etc/guix/acl is a dangling symlink.
One possible solution for an issue when /etc/guix/acl file exists, but points
to a non-existent location. This can for example happen if one is
reinitializing the system, and remove only /gnu/store and /var/guix, keep the
rest okay. This is a major advantage of guix as compared to other distros that
usually need you to reinitialize the whole root partition. But this will leave
the user with acl file pointing to non-existent location. The file-exists?
procedure will return #f for broken symbolic links.

I think that another reason one would get this issue is, if one was booted in
a live iso, chrooted, fixing their system. They would switch generations to
one with different acl file, delete other generations gc rooting the original
acl file and then gc. One could do this approach for example when recovering
from file corruptions in the store, to get rid of the unsubstitutable paths
that can't be repaired with guix gc --verify.

This fixes the issue by looking for type of a file through lstat, instead of
relying on file-exists?. If the symlink is a broken symlink, it is
removed. Other than that the old behavior is kept:
- If regular file, back it up
- If symlink pointing to the store, remove it
- If symlink not pointing to the store, back it up

* gnu/services/base.scm (substitute-key-authorization): Check if acl file is a
possibly-dangling symbolic link.

Change-Id: I2f8170606b2f4afeea48f04acfd738b04cafc7cf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
2025-05-05 14:33:59 +02:00
Maxim Cournoyer
bb8cc412c8
services/udev: Allow configuring udev to run in debug mode.
This re-introduces commit dd64f441d3, which had
been reverted due to previously causing a system hang when debug? was enabled,
a problem that appears to have been resolved within Shepherd.

* gnu/services/base.scm (<udev-configuration>): <debug?>: New field.
* gnu/services/base.scm (udev-shepherd-service): Use it to add '--debug' to
the command line, if applicable.
* doc/guix.texi (Base Services): Document it.

Change-Id: I88243fb4f321ff0876dd227e3c2b22082d37cfcf
2025-04-30 22:44:34 +09:00
Ludovic Courtès
e2583b5a17
services: guix: Allow ‘guix-daemon’ to run without root privileges.
* gnu/services/base.scm (run-with-writable-store)
(guix-ownership-change-program): New procedures.
(<guix-configuration>)[privileged?]: New field.
(guix-shepherd-service): Rename to…
(guix-shepherd-services): … this.   Add the ‘guix-ownership’ service.
Change ‘guix-daemon’ service to depend on it; when unprivileged,
prefix ‘daemon-command’ by ‘run-with-writable-store’ and
omit ‘--build-users-group’; adjust socket activation endpoints.
(guix-accounts): When unprivileged, create the “guix-daemon” user and
group in addition to the others.
(guix-service-type)[extensions]: Adjust to name change.
* gnu/tests/base.scm (run-guix-daemon-test): Add ‘name’ parameter.
(%test-guix-daemon): Adjust accordingly.
(%test-guix-daemon-unprivileged): New test.
* doc/guix.texi (Base Services): Document ‘privileged?’.
(Migrating to the Unprivileged Daemon): Explain that this is automatic
on Guix System.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I28a9a22e617416c551dccb24e43a253b544ba163
2025-04-20 18:52:59 +02:00
Maxim Cournoyer
dedeb90501
gnu: eudev: Build with udevrulesdir pointing to /etc/udev/rules.d.
Prior to this change, only the udev rules installed to eudev's prefix were
consulted by tools such as udevadm, leading to problems such as when
configuring network interfaces, or attempting to override its default rules.

While our custom eudev patch adding support for the EUDEV_RULES_DIRECTORY
environment variable could have been refined to take precedence over the
package's configured udevrulesdir, this was not pursued for the following
reasons:

1. Due to eudev's using inotify to detect new rules, the EUDEV_RULES_DIRECTORY
is fixed in Guix System, per commit e9fa17eb98 ("services: udev: Use a fixed
location for the rules directory and config.")

2. Users would have had to set EUDEV_RULES_DIRECTORY to the fixed directory
themselves to have udevadm work as expected, which is inconvenient.

3. This simple solution is already implemented and tested in NixPkgs.

* gnu/packages/linux.scm (eudev) [source]: Remove custom patch.
[arguments] <#:make-flags>: New argument.
<#:phases>: Override install phase to alter installation make flags.
* gnu/services/base.scm (udev-shepherd-service): Do not set
EUDEV_RULES_DIRECTORY environment variable.
* gnu/packages/patches/eudev-rules-directory.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): De-register it.

Fixes: https://issues.guix.gnu.org/63508
Reported-by: Felix Lechner <felix.lechner@lease-up.com>
Change-Id: Ib8698f4b452f6fd0951bcd71831705b1be85e6e0
2025-04-11 12:42:47 +01:00
Maxim Cournoyer
c17c6b9820
services/base: Remove extraneous UDEV_CONFIG_FILE environment variable.
This environment variable used to be honored by udevd, but that is no longer
the case (as shown by grepping its source).

* gnu/services/base.scm (udev-shepherd-service) <#:environment-variables>:
Remove UDEV_CONFIG_FILE.

Change-Id: I0828de76e8da429432bc0679903aa501c99625af
2025-04-11 12:42:47 +01:00
Leo Famulari
bb4ce5cc47
services: Make the urandom-seed-service-type return success properly.
Reported by nigko on #guix:

https://logs.guix.gnu.org/guix/2025-04-05.log#201718

* gnu/services/base.scm (urandom-seed-shepherd-service): Return #f when
stopped.

Change-Id: I8212508e4a017270e4e9284b43170cd17999e8b4
2025-04-08 20:03:09 -04:00
Ludovic Courtès
c4dd590eab
services: guix: Socket-activate ‘guix-daemon’.
* gnu/services/base.scm (guix-shepherd-service): Change ‘start’ to use
‘make-systemd-constructor’ in the default case.  Remove now-redundant
code creating /var/guix/daemon-socket/.  Adjust ‘stop’ method to use
‘make-systemd-destructor’ when appropriate.

Change-Id: I3572670c90f65509fbad01dcf13a60f772a86839
2025-04-06 11:24:10 +02:00
Ludovic Courtès
96ae99c957
services: guix: Streamline the default ‘start’ case.
* gnu/services/base.scm (guix-shepherd-service): In ‘start’ method, use
‘fork+exec-command’ in the default case.

Change-Id: Id04d3d2651f89fbcdb2f17f027df91e132ff9ed1
2025-04-06 11:24:06 +02:00
Ludovic Courtès
b16e3f451f
services: guix: Factorize ‘guix-daemon’ arguments.
* gnu/services/base.scm (guix-shepherd-service): In ‘start’ method,
move ‘fork+exec-command/container’ arguments to the new variables
‘daemon-command’ and ‘environment-variables’.

Change-Id: Ic04a1006849697e4e185ad94185bbdec8a91a05a
2025-04-06 11:24:01 +02:00
Maxim Cournoyer
97be0a837e
Revert "services/udev: Allow configuring udev to run in debug mode."
This reverts commit dd64f441d3.  Enabling debug
output for udevd apparently hangs the boot.
2025-03-05 14:25:05 +09:00
Ludovic Courtès
8492a3c896
services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’.
This reinstates c83bfc0415, which had been
reverted in 8c483c12e9 in response to
<https://issues.guix.gnu.org/76315>.

* gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
by ‘shepherd-system-log-service-type’.
* doc/guix.texi (Base Services): Update ‘syslog-service-type’
documentation.
(Shepherd Services): Mention that ‘system-log-service-type’ is in
‘%base-services’.  Add anchor.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492
2025-03-05 00:28:49 +01:00
Maxim Cournoyer
dd64f441d3
services/udev: Allow configuring udev to run in debug mode.
* gnu/services/base.scm (<udev-configuration>): <debug?>: New field.
* gnu/services/base.scm (udev-shepherd-service): Use it to add '--debug' to
the command line, if applicable.
* doc/guix.texi (Base Services): Document it.

Change-Id: I88243fb4f321ff0876dd227e3c2b22082d37cfcf
2025-03-03 00:31:46 +09:00
Ludovic Courtès
bd7b9e6a60
services: Add missing Shepherd dependency on ‘user-processes’.
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@posteo.net>
Change-Id: I947bd2afc83b786cb17c555cfe73ab586b806618
2025-02-23 22:53:06 +01:00
Andreas Enge
9a41ec5762
gnu: guix-configuration: Add a chroot? parameter.
The parameter should take the values #t, #f or 'default.
In a container environment, 'default amounts to #f, otherwise it
amounts to #t.

* gnu/services/base.scm (guix-configuration)<chroot?>: New field.
(guix-shepherd-service): If chroot? is #f, add "--disable-chroot".
If it is #t or 'default, do nothing.
* gnu/system/linux-container.scm (containerized-operating-system):
If chroot? is 'default, replace it by #f.
* doc/guix.texi: Document the parameter.

Change-Id: I8b9c3f46ad8650fa6ed4acee947b4ae5d002d03d
2025-02-17 14:57:55 +01:00
Ludovic Courtès
8c483c12e9
Revert "services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’."
This reverts commit c83bfc0415 and the
corresponding ‘etc/news.scm’ entry (commits
12bd93113c and
622568ec13) while investigating
<https://issues.guix.gnu.org/76315>.

Change-Id: Ie26c24b8cd25cee3466cc871470b0bec9a5dfafb
2025-02-16 23:09:41 +01:00
Ludovic Courtès
c83bfc0415
services: Switch to ‘shepherd-system-log-service-type’ in ‘%base-services’.
* gnu/services/base.scm (%base-services): Replace ‘syslog-service-type’
by ‘shepherd-system-log-service-type’.
* doc/guix.texi (Base Services): Update ‘syslog-service-type’
documentation.
(Shepherd Services): Mention that ‘system-log-service-type’ is in
‘%base-services’.  Add anchor.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I21082300f6a052865a6ab1bdff27fbe71f73d492
2025-02-15 22:47:59 +01:00
Maxim Cournoyer
e8185fc4d5
services: Rename field in greetd-terminal-configuration record.
This was erroneously renamed during the review of commit
ee0d1b144c ("services: greetd: Improve greeter configurations.").  The field
*adds* to the intrinsic requirements of the service, so the 'extra-' prefixes
communicates this better.

* gnu/services/base.scm (<greetd-terminal-configuration>): Rename
shepherd-requirement field to extra-shepherd-requirement.
* doc/guix.texi (Base Services): Adjust doc accordingly.

Change-Id: I4b970bdd63864ed86d61fde9cad2487a293417ce
2025-02-07 17:50:21 +09:00
Dariqq
4d9eea998b
services: greetd: Use mkdir-p in activation script.
Fixes a bug introduced in ee0d1b144c where
reconfiguring a system with ‘greetd-service-type’ would fail with:

  guix system: error: mkdir: File exists "/run/user".

* gnu/services/base.scm (greetd-run-user-activation): Replace mkdir with mkdir-p.

Change-Id: I030d1f57c3292c518b3f17061f75258e8a72141c
2025-02-07 17:50:21 +09:00
muradm
220ef58440
services: greetd: Add new gtkgreet greeter.
* gnu/services/base.scm (<greetd-gtkgreet-sway-session>): New record,
represents 'gtkgreet' greeter session configuration.
* doc/guix.texi (Base Services): Document new 'gtkgreet' greeter.

Change-Id: I2e8b5710965faa05795af1d0b2a0e2f774af1d5a
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-02-06 22:26:45 +09:00
muradm
ee0d1b144c
services: greetd: Improve greeter configurations.
This improvement focuses on providing common user session scripts
for use by multiple greeters. Now user session entry point is
factored out into '<greetd-user-session>', which can be reused
as is with different greeters. By default it uses 'bash' as
first user process. Then user normally starts additional programs
with '.profile' or '.bashrc'. Using 'command', 'command-args' and
'extra-env' one can specify something else, which could be
'dbus-session' wrapped process, some desktop environment or else.
While the above is possible, one is still encouraged to use
'.bashrc', '.profile' or similar.

It also fixes incorrect use of 'XDG_RUNTIME_DIR' for 'wlgreet'.
'wlgreet' requires a compositor to run. We provide common sway based
greeter script, which can be shared by other graphical greeters.

* gnu/services/base.scm (<greetd-user-session>): Common user session
factored out, for shared use by multiple greeters.
(<greetd-agreety-session>): Switch to common user session.
(<greetd-wlgreet-configuration>): Refactor 'wlgreet' configuration.
(<greetd-wlgreet-sway-session>): Switch to common user session.
(<greetd-terminal-configuration>): Add 'extra-shepherd-requirement'
for establishing configurable Shepherd service dependency.
* gnu/tests/desktop.scm (%minimal-services): Reflect configuration
changes.
* doc/guix.texi (Base Services): Document refactoring changes.

Change-Id: I9d45a592b355eb9c438be5b1d4d15555ce4956fa
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-02-06 22:26:45 +09:00
Ludovic Courtès
dc0df5eb47
services: Add the Shepherd’s ‘transient’ and ‘timer’ to ‘%base-services’.
* gnu/services/base.scm (%base-services): Add instances of
‘shepherd-timer-service-type’ and ‘shepherd-transient-service-type’.

Change-Id: I28a35d0dce40b142ee71b330b1cf7a3d222ef6bd
2025-01-26 22:09:27 +01:00
Ludovic Courtès
6942161b44
services: Switch from mcron + Rottlog to Shepherd’s log rotation.
* gnu/services/admin.scm (unattended-upgrade-log-rotations): Remove.
(unattended-upgrade-service-type): Remove ‘rottlog-service-type’
extension.
* gnu/services/audio.scm (mpd-log-rotation): Remove.
(mpd-service-type): Remove ‘rottlog-service-type’ extension.
(mympd-log-rotation): Remove.
(mympd-service-type): Remove rottlog-service-type’ extension.
* gnu/services/base.scm (%guix-publish-log-rotations): Remove.
(guix-publish-service-type): Remove ‘rottlog-service-type’ extension.
(%base-services): Instantiate ‘log-rotation-service-type’ instead of
‘rottlog-service-type’.
(%default-syslog-files): New variable.
(syslog-service-type): Extend ‘log-rotation-service-type’.
* gnu/services/cuirass.scm (cuirass-log-rotations): Remove.
(cuirass-service-type): Remove ‘rottlog-service-type’ extension.
(cuirass-remote-worker-log-rotations): Remove.
(cuirass-remote-worker-service-type): Remove ‘rottlog-service-type’
extension.
* gnu/services/file-sharing.scm (%transmission-daemon-log-rotations):
Remove.
(transmission-daemon-service-type): Remove ‘rottlog-service-type’
extension.
* gnu/services/linux.scm (%earlyoom-log-rotation): Remove.
(earlyoom-service-type): Remove ‘rottlog-service-type’ extension.
* gnu/services/networking.scm (%ntp-log-rotation): Remove.
(ntp-service-type): Remove ‘rottlog-service-type’ extension.
(openntpd-service-type): Likewise.
(%connman-log-rotation): Remove.
(connman-service-type): Remove ‘rottlog-service-type’ extension.
(%hostapd-log-rotation): Remove.
(hostapd-service-type): Remove ‘rottlog-service-type’ extension.
(%pagekite-log-rotation): Remove.
(pagekite-service-type): Remove ‘rottlog-service-type’ extension.
(%yggdrasil-log-rotation): Remove.
(yggdrasil-service-type): Remove ‘rottlog-service-type’ extension.
(%ipfs-log-rotation): Remove.
(ipfs-service-type): Remove ‘rottlog-service-type’ extension.
(%keepalived-log-rotation): Remove.
(keepalived-service-type): Remove ‘rottlog-service-type’ extension.
* gnu/services/web.scm (%hpcguix-web-log-rotations): Remove.
(hpcguix-web-service-type): Remove ‘rottlog-service-type’ extension.
(%mumi-log-rotations): Remove.
(mumi-service-type): Remove ‘rottlog-service-type’ extension.
* doc/guix.texi (Log Rotation): Adjust text regarding which one is in
‘%base-services’.

Change-Id: I8802d4c2337a1e08e3c084d6217f76527d7ee1fb
2025-01-16 22:30:02 +01:00
Ludovic Courtès
431ab10344
services: static-networking: Fail when devices don’t show up.
Fixes <https://issues.guix.gnu.org/71173>.

* gnu/services/base.scm (network-set-up/linux): Define
‘max-set-up-duration’ and use it.
* gnu/tests/networking.scm (%static-networking-with-nonexistent-device):
New variable.
(run-static-networking-failure-test): New procedure.
(%test-static-networking-failure): New variable.

Change-Id: Idba9b36750aa8c6368c8f6d1bc1358066f7432e4
2025-01-08 22:54:37 +01:00
Ludovic Courtès
8d649a8d17
services: static-networking: Run set-up/tear-down as a separate process.
Running that code in PID 1 was fun but it’s not really beneficial and
somewhat risky: risk of blocking, file descriptor leak, inability to
reload Guile-Netlink in shepherd when it’s upgraded, and so on.

This change runs set-up and tear-down as separate processes, which, for
the price of one fork(1), buys us peace of mind.

* gnu/services/base.scm (network-set-up/hurd, network-tear-down/hurd)
(network-tear-down/linux): Use ‘program-file’ instead of ‘scheme-file’.
(network-set-up/linux): Likewise, and remove #:blocking? argument to
‘wait-for-link’.

Change-Id: Ia41479b50eab31ea40c67243fcb1cffe29ac874a
2025-01-08 22:54:37 +01:00
45mg
dbbef3d57f
services: syslog: fix configuration file argument
* gnu/services/base.scm (syslog-shepherd-service): Separate incorrectly
combined arguments which resulted in an argument like "-f
/etc/syslog.conf" being passed to syslogd, leading it to ignore the
argument and execute without a configuration file. Effects of this
included no log files being written, though the Shepherd service ran
successfully.

Ref: https://issues.guix.gnu.org/70677#4-lineno7
Change-Id: I3dbe00eabd4a10804e554c12e1466483c0b185b7
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-25 23:51:04 +01:00
Jean-Baptiste Note
786aff3785
services: syslog: Adjust service for rsyslog compatibility.
* gnu/services/base.scm (syslog-shepherd-service): Change flag for designating
configuration file. The long option is not compatible with rsyslog while the
short is; switch to the short one.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-23 20:45:32 +01:00
Jean-Baptiste Note
b732d702f9
services: syslog: Add extra-options argument to syslog service.
* gnu/services/base.scm (<syslog-configuration>): Add extra-options field.
  (syslog-shepherd-service): Use it when running the service.

* doc/guix.texi: Document it.

Change-Id: I540d070b9a9678b45ec9fa28d6fdc761f9b3fd9a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-23 20:45:31 +01:00
Giacomo Leidi
9411a1495f
services: pam: Allow extension of pam limits.
* gnu/services/pam.scm (pam-limits-service-type): Allow extension of pam
limits rules from users and services.

Change-Id: I93a363d1a2887493d52ef3ae32fc9721f81ddfa8
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-18 18:32:40 +01:00
Tomas Volf
e92b20a41a
services: mingetty: Support waiting on shepherd services.
For auto-login on systems with elogind, dbus-system needs to be started.  This
commit adds ability to express that ordering.

* gnu/services/base.scm (<mingetty-configuration>): Add shepherd-requirement
field.
(mingetty-shepherd-service): Use it.
* doc/guix.texi (Base Services)<mingetty-configuration>: Document it.

Change-Id: Iedbdc4375180740379d561aa193d7c63350d2e7b
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2024-12-15 00:19:41 +09:00
Tomas Volf
a64a3a14e8
services: mingetty: Rename misnamed accessors.
Rename the accessors to ensure all start with `mingetty-configuration-'
prefix.  Some were named just `mingetty-$FIELD', instead of
`mingetty-configuration-$FIELD'.

The renaming *is* backwards compatible, since in the define-module's #:export
argument the correct (`mingetty-configuration-$FIELD') were used already and
thus the accessors were not accessible.

* gnu/services/base.scm (<mingetty-configuration>): Rename accessors for
auto-login, login-program, login-pause?, clear-on-logout?.

Change-Id: I4557a82498805ade0b341feda9d33eccc305690f
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2024-12-15 00:19:41 +09:00
Tomas Volf
7068f6f7a5
services: mingetty: Add additional configuration options.
Not all aspects of mingetty were configurable, so this commit adds the
additional configuration fields to support that.

* gnu/services/base.scm (<mingetty-configuration>): Add delay, print-issue,
print-hostname, nice, working-directory, root-directory fields.
(mingetty-shepherd-service): Use the new fields.
(define-module)<#:export>: Export the new accessors.
* doc/guix.texi (Base Services)<mingetty-configuration>: Document the
additional field.

Change-Id: I4557a82498805ade0b341feda9d33eccc305690f
2024-12-15 00:19:41 +09:00
Janneke Nieuwenhuizen
a16c94446e
system: hurd: Add swap-services to hurd-default-essential-services.
* gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement
for the Hurd.  Use system* with "swapon", "swapoff" for the Hurd.
* gnu/system.scm (hurd-default-essential-services): Add swap-services.
* gnu/services/base.scm (swap-service-type):

Change-Id: I1d4d445c614921752dc84aa0dd6ff42cdbf62aa8
2024-11-11 07:28:33 +01:00
Reepca Russelstein
6a8a6171a7
services: guix: Add access control to daemon socket.
* gnu/services/base.scm
  (guix-configuration-socket-directory-{permissions,group,user}): New fields.
  (guix-shepherd-service): Use them.
* doc/guix.texi (Base Services): Document them.

Change-Id: I8f4c2e20392ced47c09812e62903c87cc0f4a97a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-11-03 23:05:06 +01:00
Zheng Junjie
7749477876
services: nscd: When cross-compiling, Use (cross-libc target).
* gnu/services/base.scm (nscd-configuration)[glibc]: When cross-compiling,
Use (cross-libc target).

Change-Id: Ib219459b1ec28f7edfac075e70be3d61edf72d27
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-10-15 18:40:08 +02:00
Ludovic Courtès
447bcead88
services: file-system: Do not try to unmount /dev and /.
Previously, when being stopped, the ‘user-file-systems’ service would
attempt to unmount / and /dev, which was bound to fail.  This was
harmless, apart from a couple of lines in /var/log/messages, but it was
wrong.

* gnu/services/base.scm (file-system-shepherd-services)[user-unmount]:
Remove “/” and “/dev” from the list of file systems subject to
unmounting.

Change-Id: Ieb68fe46c114909a64d54f885c94a9d7cd61f5e0
2024-09-19 19:03:08 +02:00
Ludovic Courtès
89fdc4b45f
services: host-name: Use the host name as the running value.
Previously, the “running value” of the ‘host-name’ service would
be #<unspecified>.  This change makes it more pleasing to the eye.

* gnu/services/base.scm (host-name-service-type): ‘start’ returns NAME.

Change-Id: I38b8320e43639b6623475871ca6fbad3a459eb59
2024-09-09 17:17:55 +02:00
Tomas Volf
76a2b9d707
services: guix: Default `channels' field to #f.
In the absence of the /etc/guix/channels.scm file, %default-channels is used
anyway.  If user manually (or by extra-special-file) created the file, we
should respect it.  This commit therefore changes the default to #f, hopefully
having zero impact on people not actively using the `channels' field.

* gnu/services/base.scm (<guix-configuration>)[channels]: Set default to #f.

Change-Id: I516c1735a037a153fabbebfc337051aaf0be2155
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-06-26 23:36:24 +02:00
Ludovic Courtès
7c8d38f91e
services: Never throw when stopping mount-may-fail file systems.
This is a followup to 7c27bd115b.

* gnu/services/base.scm (file-system-shepherd-service): Catch
'system-error from ‘umount’ call when FILE-SYSTEM is marked as
mount-may-fail.

Change-Id: I2234f8da320b43089f4ee058cad8608ce9c078f8
2024-06-26 22:52:03 +02:00
Richard Sent
579df5bc80
services: base: Add optional delayed mount of file-systems
Add a mechanism to only require mounting a subset of file-system entries
during early Shepherd initialization. Any file-system with additional Shepherd
service requirements (e.g. networking) is not required to provision
'file-systems.

* gnu/services/base.scm (file-system-shepherd-service): Splice
file-system-requirements into the Shepherd service requirement list.
(file-system-shepherd-services): Provision 'file-system only when file system
services without additional Shepherd requirements are started.
* gnu/system/file-systems.scm (file-system): Add shepherd-requirements field
to the file-system record. This field is used for adding additional Shepherd
requirements to a file-system Shepherd service.
* doc/guix.texi: Add documentation for file-system shepherd-requirements.

Change-Id: If0392db03d48e8820aa53df1df482c12ec72e1a5
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-06-04 12:08:34 +02:00
Ludovic Courtès
85ac164c41
services: nscd: Enable ‘passwd’ and ‘group’ caches by default.
This allows users to specify NSS plugins such as LDAP via the
‘name-services’ field of <nscd-configuration>.  Failing that, user code
will dlopen whatever passwd/group plugins are listed in
/etc/nsswitch.conf, which is likely to fail, typically because those are
not in $LD_LIBRARY_PATH.

* gnu/services/base.scm (%nscd-default-caches): Add ‘passwd’ and ‘group’
caches.

Change-Id: I9c03346a1de2710685f7801eccd2e08007427f5d
2024-06-03 23:00:10 +02:00
Ludovic Courtès
8f0878da8d
services: nscd: ‘log-file’ defaults to #f.
* gnu/services/base.scm (<nscd-configuration>)[log-file]: Default to #f.
* doc/guix.texi (Base Services): Clarify documentation.

Change-Id: Ia75914fc2665db13bef688d53659083a615ebef4
2024-06-02 20:52:24 +02:00
Ludovic Courtès
da9f509b03
services: guix: Use Shepherd 0.10 API for actions.
The ‘action’ method was deprecated in Shepherd 0.10.0.

* gnu/services/base.scm (shepherd-set-http-proxy-action)
(shepherd-discover-action): Use ‘perform-service-action’ instead of the
now-deprecated ‘action’ method.

Change-Id: Ibe1c79a44148596292c2c8907011ec787f8a9ddd
2024-05-05 12:06:23 +02:00
Ian Eure
ef8ab6ab66
gnu: guix-configuration: Improve offload build-machines.
It’s currently difficult to programmatically add a build-machine, because the
`service-extension' mechanism is the only facility which can do that.  It
relies on the `guix-service-type', ala:

    (service-extension guix-service-type
      (guix-extension (build-machines (list ...))))

...but `guix-service-type' is already instantiated as part of
`%base-services', and replacing it may lose other configuration, like
substitute servers and authorized keys.

Additionally, a default value of `#f' for the build-machines field requires
guarding uses of the field with:

    (or (guix-build-machines config) '())

Changing the default to be the empty list avoids that.  One can now add
build-machines with code such as:

    (modify-services %base-services
      (guix-service-type
       config =>
       (guix-configuration
        (inherit config)
        (authorized-keys
         (cons %build-machine-key
               (guix-configuration-authorized-keys config)))
        (build-machines (cons #~(build-machine ...)
                              (guix-configuration-build-machines config))))))

* gnu/services/base.scm (guix-configuration): Rename `guix-build-machines' to
`guix-configuration-build-machines' and export it.  Change the default from
`#f' to the empty list.
* gnu/services/base.scm (guix-activation): Update the build-machines test and
reverse the conditions.

Change-Id: I6780c6a5579fd9d4b4f22ee2b2bf7ba7a0454407
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-04 19:14:27 +02:00
Ludovic Courtès
91e1a457b5
services: guix: Gracefully handle dangling symlink for ‘machines.scm’.
Previously, if /etc/guix/machines.scm was a dangling symlink, it would
be kept (because ‘file-exists?’ would return #f) and thus the following
‘symlink’ call would throw with EEXIST.

* gnu/services/base.scm (guix-machines-files-installation): Use ‘lstat’
rather than ‘file-exists?’.

Change-Id: I07c7eed842dacabbd19ae2a17ac3e59cf26e46b2
2024-04-06 15:14:58 +02:00
Liliana Marie Prikler
a915a57d91
Merge branch 'gnome-team' 2024-03-30 09:47:43 +01:00