David Thompson <dthomps...@worcester.edu> 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.

[...]

> +@node Invoking guix container
> +@section 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

> +@example
> +guix container exec 9001 /run/current-system/profile/bin/bash --login
> +@end 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