summaryrefslogtreecommitdiff
path: root/nix/scripts/list-runtime-roots.in
Commit message (Collapse)AuthorAge
* daemon: Invoke 'guix gc --list-busy' instead of 'list-runtime-roots'.Ludovic Courtès2019-09-08
| | | | | | | | | | | | | | | | | | | | | | | * nix/scripts/list-runtime-roots.in: Remove. * guix/store/roots.scm (%proc-directory): New variable. (proc-file-roots, proc-exe-roots, proc-cwd-roots) (proc-fd-roots, proc-maps-roots, proc-environ-roots) (referenced-files, canonicalize-store-item, busy-store-items): New procedures, taken from 'list-runtime-roots.in'. * nix/libstore/globals.hh (Settings)[guixProgram]: New field. * nix/libstore/globals.cc (Settings::processEnvironment): Initialize 'guixProgram'. * nix/libstore/gc.cc (addAdditionalRoots): Drop code related to 'NIX_ROOT_FINDER'. Run "guix gc --list-busy". * nix/local.mk (nodist_pkglibexec_SCRIPTS): Remove 'scripts/list-runtime-roots'. * config-daemon.ac: Don't output nix/scripts/list-runtime-roots. * build-aux/pre-inst-env.in: Don't set 'NIX_ROOT_FINDER'. Set 'GUIX'. * doc/guix.texi (Invoking guix gc): Document '--list-busy'. * guix/scripts/gc.scm (show-help, %options): Add "--list-busy". (guix-gc)[list-busy]: New procedure. Handle the 'list-busy' action.
* list-runtime-root: Fix off-by-one in 'strip-drop' call.Ludovic Courtès2017-12-31
| | | | | | | | | Fixes <https://bugs.gnu.org/29862>. Reported by Danny Milosavljevic <dannym@scratchpost.org>. * nix/scripts/list-runtime-roots.in (canonicalize-store-item): Define 'store' with a trailing "/". Have the 'string-prefix?' call match the 'string-drop' call.
* list-runtime-roots: Ignore ESRCH while reading from /proc.Ludovic Courtès2017-11-26
| | | | | | | Fixes <https://bugs.gnu.org/29368>. Reported by Martin Castillo <castilma@uni-bremen.de>. * nix/scripts/list-runtime-roots.in (referenced-files): Ignore ESRCH.
* list-runtime-roots: Ignore PIDs we cannot access.Ludovic Courtès2017-11-12
| | | | | | | | This allows running as non-root. Fixes a regression introduced in b8f59cdc20e9d83ce63523ef917e95fcee07f134. * nix/scripts/list-runtime-roots.in (referenced-files): Handle EACCES in addition to ENOENT.
* list-runtime-roots: Canonicalize store items.Ludovic Courtès2017-11-12
| | | | | | | | | | Looking at 'addAdditionalRoots' in libstore/gc.cc, it looks like it should always have been this way. In practice it probably doesn't make much of a difference. * nix/scripts/list-runtime-roots.in (canonicalize-store-item): New procedure. <top level>: Use it.
* list-runtime-roots: Do not use 'lsof'.Ludovic Courtès2017-11-12
| | | | | | | | | This makes things a bit faster (0.8s instead of 1.4s on my laptop). * nix/scripts/list-runtime-roots.in (lsof-roots): Remove. (proc-fd-roots): Return the empty list when 'scandir' returns #f. (referenced-files): New procedure. Use it at the top level.
* list-runtime-roots: Bufferize the lsof pipe.Ludovic Courtès2017-03-08
| | | | | * nix/scripts/list-runtime-roots.in (lsof-roots): Add 'setvbuf' call for PIPE.
* list-runtime-roots: Don't display a backtrace on 2.0.5 when lsof is lacking.Ludovic Courtès2014-05-16
| | | | | | * nix/scripts/list-runtime-roots.in (lsof-roots): Fix typo in 'catch' tag. Add 'parent' variable. Wrap 'open-pipe*' call in 'catch'. Reported by Andreas Enge <andreas@enge.fr>.
* list-runtime-roots: List files referenced by environment variables.Ludovic Courtès2013-10-29
| | | | | | | | Inspired by <https://github.com/NixOS/nix/compare/772b70952f75...4ddd077bfa9a>. * nix/scripts/list-runtime-roots.in (%store-directory): New variable. (proc-environ-roots): New procedure. (<top-level>): Use it.
* Update license headers.Ludovic Courtès2013-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all license headers, except guix/build/* and ld-wrapper.scm, with this code: (use-modules (guix build utils) (srfi srfi-1)) (fluid-set! %default-port-encoding "UTF-8") (substitute* (remove (lambda (f) (or (string-contains f ".tar.") (string-contains f ".git/") (string-contains f ".so") (string-suffix? ".o" f) (string-suffix? ".a" f) (string-suffix? ".go" f) (string-suffix? ".pdf" f) (string-suffix? ".png" f) (string-suffix? ".info" f) (equal? (basename f) "guix-daemon") (equal? (basename f) "nix-setuid-helper") (string-contains f "nix-upstream/") (string-contains f "distro/packages/bootstrap/"))) (find-files "." "\\.[a-z]+$")) (("^([[:graph:]]+) This file is part of Guix." _ comment-start) (string-append comment-start " This file is part of GNU Guix.")) (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start) (string-append comment-start " GNU Guix --- Functional package management for GNU\n")) (("^([[:graph:]]+) Guix is " _ comment-start) (string-append comment-start " GNU Guix is ")) (("^([[:graph:]]+) along with Guix." _ comment-start) (string-append comment-start " along with GNU Guix.")) (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start) (string-append comment-start " Copyright ©"))) Change headers using C-style comments manually.
* daemon: Add `list-runtime-roots' script.Ludovic Courtès2012-12-05
* nix/scripts/list-runtime-roots.in: New file. * config-daemon.ac: Add `AC_CONFIG_FILES' invocation for it. * daemon.am (nodist_pkglibexec_SCRIPTS): New variable. (AM_TESTS_ENVIRONMENT): Define `top_builddir'. * tests/guix-daemon.sh: Export `NIX_ROOT_FINDER'. * nix/sync-with-upstream: Substitute the path to the root finder in libstore/gc.cc.