[bug#70148] guix-install.sh: Add daemonize to requirements.

Message ID 4e4fa72cfff690365f06c94534bc3d03ac7a3418.1712074456.git.richard@freakingpenguin.com
State New
Headers
Series [bug#70148] guix-install.sh: Add daemonize to requirements. |

Commit Message

Richard Sent April 2, 2024, 4:14 p.m. UTC
* etc/guix-install.sh (REQUIRE): Add daemonize to requirements list.
Needed to spawn the Guix Daemon in guix-daemon.in

Change-Id: I77c7f2bdd686bb023ecfa108a499c2eafbad1eb7
---

Hi Guix. I noticed that in Debian WSL the guix daemon sysvinit service
wouldn't start due to daemonize not being present. This patch should
catch that issue sooner.

Both openrc and sysvinit use guix-daemon.in so daemonize should be
required regardless of the init system.

 etc/guix-install.sh | 1 +
 1 file changed, 1 insertion(+)


base-commit: d67e4f0f9b10c7ddac8fb0ca68cbf1d6ad0a6e5d
  

Comments

Ludovic Courtès May 4, 2024, 4:49 p.m. UTC | #1
Hi Richard,

Richard Sent <richard@freakingpenguin.com> skribis:

> * etc/guix-install.sh (REQUIRE): Add daemonize to requirements list.
> Needed to spawn the Guix Daemon in guix-daemon.in
>
> Change-Id: I77c7f2bdd686bb023ecfa108a499c2eafbad1eb7
> ---
>
> Hi Guix. I noticed that in Debian WSL the guix daemon sysvinit service
> wouldn't start due to daemonize not being present. This patch should
> catch that issue sooner.
>
> Both openrc and sysvinit use guix-daemon.in so daemonize should be
> required regardless of the init system.

‘daemonize’ seems to be used by etc/init.d/guix-daemon.in, but not by
etc/openrc/guix-daemon.in, right?

>  REQUIRE=(
> +    "daemonize"

My only concern is if the majority of users (which I assume use systemd)
would get an error for a missing package they don’t actually need.

Do you think that is a risk or is ‘daemonize’ usually installed “by
default” even on those systemd distros?

Thanks,
Ludo’.
  
Richard Sent May 4, 2024, 10:44 p.m. UTC | #2
Hi Ludo!

>> Both openrc and sysvinit use guix-daemon.in so daemonize should be
>> required regardless of the init system.
>
> ‘daemonize’ seems to be used by etc/init.d/guix-daemon.in, but not by
> etc/openrc/guix-daemon.in, right?

Correct, I think I got confused by guix-install.sh copying
etc/openrc/guix-daemon to /etc/init.d/guix-daemon. (See the openrc
handler in the $INIT_SYS case statement in sys_enable_guix_daemon()).
Assuming I understand the script; I find shell scripts hard to parse.

> My only concern is if the majority of users (which I assume use systemd)
> would get an error for a missing package they don’t actually need.
>
> Do you think that is a risk or is ‘daemonize’ usually installed “by
> default” even on those systemd distros?

I suspect there's a risk. WSL Debian does not come with daemonize out of
the box so I imagine normal Debian does not either.

If OpenRC/systemd does not require daemonize, there's probably a better way to
handle this. Perhaps a INITD_REQUIRE variable that's only checked
conditionally depending on what init system is detected (aka INIT_SYS).
  
Simon Tournier May 22, 2024, 2:08 p.m. UTC | #3
Hi,

On sam., 04 mai 2024 at 18:44, Richard Sent <richard@freakingpenguin.com> wrote:

> If OpenRC/systemd does not require daemonize, there's probably a better way to
> handle this. Perhaps a INITD_REQUIRE variable that's only checked
> conditionally depending on what init system is detected (aka INIT_SYS).

This appears to me the best solution.  It seems better that the
requirements stay as minimal as possible for most of users.

Well, maybe another variable as INITD_REQUIRE.  Or maybe a plain test
for this daemonize when the init system is detected; since for now there
is only one extra package, if I read correctly.

Cheers,
simon
  
Ludovic Courtès May 25, 2024, 1:59 p.m. UTC | #4
Hi,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> On sam., 04 mai 2024 at 18:44, Richard Sent <richard@freakingpenguin.com> wrote:
>
>> If OpenRC/systemd does not require daemonize, there's probably a better way to
>> handle this. Perhaps a INITD_REQUIRE variable that's only checked
>> conditionally depending on what init system is detected (aka INIT_SYS).
>
> This appears to me the best solution.  It seems better that the
> requirements stay as minimal as possible for most of users.

+1.  Would be best to ensure the installer doesn’t get in the way of
those using systemd distros.

Could you look into it, Richard?

Ludo’.
  

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 982fb0a266..94ecb1d8f3 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -56,6 +56,7 @@  set -eo pipefail
 [ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
 
 REQUIRE=(
+    "daemonize"
     "dirname"
     "readlink"
     "wget"