1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 17:59:36 +01:00

nix-store -q --roots / --gc --print-roots: Print temporary / in-memory roots

For example,

  $ nix-store -q --roots /nix/store/7phd2sav7068nivgvmj2vpm3v47fd27l-patchelf-0.8pre845_0315148
  {temp:1}

denotes that the path is only being kept alive by a temporary root
(i.e. /nix/var/nix/temproots/). Similarly,

  $ nix-store --gc --print-roots
  ...
  {memory:9} -> /nix/store/094gpjn9f15ip17wzxhma4r51nvsj17p-curl-7.53.1

shows that curl is being used by some process.
This commit is contained in:
Eelco Dolstra 2017-09-14 14:38:36 +02:00
parent 970366266b
commit da1e4fdfb5
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 41 additions and 22 deletions

View file

@ -176,7 +176,7 @@ private:
typedef std::shared_ptr<AutoCloseFD> FDPtr;
typedef list<FDPtr> FDs;
void readTempRoots(PathSet & tempRoots, FDs & fds);
PathSet readTempRoots(FDs & fds);
public:
@ -261,7 +261,9 @@ private:
void findRoots(const Path & path, unsigned char type, Roots & roots);
void findRuntimeRoots(PathSet & roots);
Roots findRootsNoTemp();
PathSet findRuntimeRoots();
void removeUnusedLinks(const GCState & state);