diff mbox series

[bug#38720] system: linux-container: Recommend guix container

Message ID 20191223140758.GS1115@E5400
State Accepted
Headers show
Series [bug#38720] system: linux-container: Recommend guix container | expand

Commit Message

Efraim Flashner Dec. 23, 2019, 2:07 p.m. UTC
I've been using guix containers on foreign systems to bring some Guixy
goodness to the unwashed sysadmins out there. When the container starts
up it displays a message like "Run 'sudo nsenter -a -t 65698' to get a
shell into it." Sometimes when I try to do that I'll get an error
message back about the system's nsenter not knowing about the '-a' flag.
I have found that using a 'guix container' command works well for me.

Comments

Ludovic Courtès Dec. 30, 2019, 10:05 p.m. UTC | #1
Hi!

Efraim Flashner <efraim@flashner.co.il> skribis:

> I've been using guix containers on foreign systems to bring some Guixy
> goodness to the unwashed sysadmins out there. When the container starts
> up it displays a message like "Run 'sudo nsenter -a -t 65698' to get a
> shell into it." Sometimes when I try to do that I'll get an error
> message back about the system's nsenter not knowing about the '-a' flag.
> I have found that using a 'guix container' command works well for me.

Oh.  I was conservative and thought that people would rather use
“standard” tools.

> From f2cd59c9eb756e243a5a01e6cd3a6a6e58a02be6 Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Mon, 23 Dec 2019 16:05:04 +0200
> Subject: [PATCH] system: linux-container: Recommend guix container.
>
> * gnu/system/linux-container.scm (container-script)[script]: Recommend
> using 'guix container' to get a shell inside the running container.

[...]

> -              ;; XXX: Should we recommend 'guix container exec'?  It's more
> -              ;; verbose and doesn't bring much.
> -              (info (G_ "Run 'sudo nsenter -a -t ~a' to get a shell into it.~%")
> +              (info (G_ "Run 'sudo guix container exec ~a /run/current-system/profile/bin/bash --login' to get a shell into it.~%")
>                      pid)

The comment is still correct: “guix container exec” is more verbose.
:-)

Should we change it so that “guix container exec PID” without additional
arguments runs /bin/sh by default, or something like that?

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index 2ab679ff3f..7d9e02b945 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -2,6 +2,7 @@ 
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -195,9 +196,7 @@  that will be shared with the host system."
               ;; XXX: We can't quite call 'bindtextdomain' so there's actually
               ;; no i18n.
               (info (G_ "system container is running as PID ~a~%") pid)
-              ;; XXX: Should we recommend 'guix container exec'?  It's more
-              ;; verbose and doesn't bring much.
-              (info (G_ "Run 'sudo nsenter -a -t ~a' to get a shell into it.~%")
+              (info (G_ "Run 'sudo guix container exec ~a /run/current-system/profile/bin/bash --login' to get a shell into it.~%")
                     pid)
               (newline (guix-warning-port)))