Nix: Add "nix processes" command that is equivalent to "guix processes"

Created on 25 Jun 2020  路  8Comments  路  Source: NixOS/nix

Guix has a feature that is missing in Nix:

https://guix.gnu.org/manual/en/html_node/Invoking-guix-processes.html

guix processes is used to list derivations that are running by the daemon. It's useful to system administrators who want to know what is using up so much of their resources.

improvement

Most helpful comment

Related to that, it would be great if nix would report back what is blocking a build when it is locked or waiting on a runner to become available.

All 8 comments

There is as an adhoc solution nix-top. But yeah, a real nix subcommand could be usefully (or at least protocol definition to query this info from the daemon)

Related to that, it would be great if nix would report back what is blocking a build when it is locked or waiting on a runner to become available.

One simple idea which would not be too complicated in implementing is writing the current build step into /nix/var/nix/userpool/${build-user}.

Is that a good idea?

I like the idea of it being discoverable via files. Though perhaps they should live in /run instead, this kind of information doesn't need to be held permanently.

I like the idea of it being discoverable via files. Though perhaps they should live in /run instead, this kind of information doesn't need to be held permanently.

Of course. My idea behind that was that it would make it easier to see if the look on the user is already held without calling flock. As the locks live under /nix/var/nix/userpool

I made a quick proof of concept here:

https://github.com/NixOS/nix/pull/3800

I think handling build steps would be useful too. Right now you can check /proc for child processes, but it only works on systems with a procfs.

I assume we limit to trusted users?

userpool is only readable by root (or whoever owns NIX_STORE_DIR) so any new information we expose would have that restriction. I don鈥檛 think it鈥檚 worth letting trusted-users see it. There鈥檚 nothing stopping them from doing pstree $(pgrep nix-daemon) though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  路  41Comments

vcunat picture vcunat  路  159Comments

edolstra picture edolstra  路  49Comments

lukego picture lukego  路  34Comments

edolstra picture edolstra  路  99Comments