Précédent: Invoquer guix weather, Monter: Utilitaires [Table des matières][Index]
guix processes
La commande guix processes
peut être utile pour les
développeur·euse·s ou les personnes qui administrent des systèmes, surtout
sur des machines multi-utilisateur·rice et sur les fermes de construction :
elle liste les sessions actuelles (les connexions au démon), ainsi que des
informations sur les processus en question24. Voici un
exemple des informations qu’elle renvoie :
$ sudo guix processes SessionPID: 19002 ClientPID: 19090 ClientCommand: guix environment --ad-hoc python SessionPID: 19402 ClientPID: 19367 ClientCommand: guix publish -u guix-publish -p 3000 -C 9 … SessionPID: 19444 ClientPID: 19419 ClientCommand: cuirass --cache-directory /var/cache/cuirass … LockHeld: /gnu/store/…-perl-ipc-cmd-0.96.lock LockHeld: /gnu/store/…-python-six-bootstrap-1.11.0.lock LockHeld: /gnu/store/…-libjpeg-turbo-2.0.0.lock ChildPID: 20495 ChildCommand: guix offload x86_64-linux 7200 1 28800 ChildPID: 27733 ChildCommand: guix offload x86_64-linux 7200 1 28800 ChildPID: 27793 ChildCommand: guix offload x86_64-linux 7200 1 28800
Dans cet exemple, on voit que guix-daemon
a trois clients directs
: guix environment
, guix publish
et l’outil
d’intégration continue Cuirass ; leur identifiant de processus (PID) est
donné par le champ ClientPID
. Le champ SessionPID
fournit le
PID du sous-processus guix-daemon
de cette session particulière.
The LockHeld
fields show which store items are currently locked by
this session, which corresponds to store items being built or substituted
(the LockHeld
field is not displayed when guix processes
is
not running as root). Last, by looking at the ChildPID
and
ChildCommand
fields, we understand that these three builds are being
offloaded (voir Réglages du délestage du démon).
La sortie est dans le format Recutils pour qu’on puisse utiliser la commande
recsel
pour sélectionner les sessions qui nous intéressent
(voir Selection Expressions dans GNU recutils manual). Par
exemple, la commande montre la ligne de commande et le PID du client qui
effectue la construction d’un paquet Perl :
$ sudo guix processes | \ recsel -p ClientPID,ClientCommand -e 'LockHeld ~ "perl"' ClientPID: 19419 ClientCommand: cuirass --cache-directory /var/cache/cuirass …
Additional options are listed below.
--format=format
-f format
Produire la sortie dans le format donné, parmi :
recutils
The default option. It outputs a set of Session recutils records that
include each ChildProcess
as a field.
normalized
Normalize the output records into record sets (voir Record Sets dans GNU recutils manual). Normalizing into record sets allows joins
across record types. The example below lists the PID of each
ChildProcess
and the associated PID for Session
that spawned
the ChildProcess
where the Session
was started using
guix build
.
$ guix processes --format=normalized | \ recsel \ -j Session \ -t ChildProcess \ -p Session.PID,PID \ -e 'Session.ClientCommand ~ "guix build"' PID: 4435 Session_PID: 4278 PID: 4554 Session_PID: 4278 PID: 4646 Session_PID: 4278
Les sessions distantes,
lorsque guix-daemon
est démarré avec --listen en
spécifiant un point d’entrée TCP, ne sont pas listées.
Précédent: Invoquer guix weather, Monter: Utilitaires [Table des matières][Index]