guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/15] scripts: Add 'container' subcommand.


From: Ludovic Courtès
Subject: Re: [PATCH 15/15] scripts: Add 'container' subcommand.
Date: Tue, 07 Jul 2015 16:50:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

David Thompson <address@hidden> skribis:

> * guix/scripts/container.scm: New file.
> * guix/scripts/container/exec.scm: New file.
> * doc/guix.texi (Invoking guix container): New section.
> * Makefile.am (MODULES): Add them.

[...]

> address@hidden Invoking guix container
> address@hidden Invoking @command{guix container}
> +
> +The purpose of @command{guix container} is to manipulate processes
> +running within an isolated environment, commonly known as a
> +``container.''

s/\./, typically created by the @command{guix environment}
(@pxref{Invoking guix environment}) and @command{guix system container}
(@pxref{Invoking guix system}) command./

+ @cindex container

> +The following command launches an interactive login shell inside a
> +GuixSD container
                   ^
+ started by, @command{guix system container}, and

> address@hidden
> +guix container exec 9001 /run/current-system/profile/bin/bash --login
> address@hidden example

I managed to use it since my first message: basically I was passing the
PID of dmd’s parent process (which executes ‘run-container’) instead of
dmd’s PID.  Perhaps this should be (1) clarified, and (2) gracefully
handled?

> +  (display (_ "\
> +   exec            Execute a command inside of an existing container\n"))

lower-case

[...]

> +  (let-values (((args command) (partition-args args)))
> +    (let* ((opts (parse-command-line args %options '(())
> +                                     #:argument-handler
> +                                     handle-argument))
> +           (pid  (assoc-ref opts 'pid)))
> +
> +      (unless pid
> +        (leave (_ "no pid specified~%")))
> +
> +      (when (null? command)
> +        (leave (_ "no command specified~%")))
> +
> +      (container-excursion pid
> +        (lambda ()
> +          (match command
> +            ((program . program-args)
> +             (apply execlp program program program-args))))))))

This needs to be wrapped in ‘with-error-handling’.

Also please add the two files to po/guix/POTFILES.in.

Thank you!  That was a lot of reading, but pleasant reading.  :-)

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]