X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/949d940b5f75114f86d381c347f0ba8f26b3e9b9..de9a5e2703cca69b0ba6e8e3e6102ee267b7447e:/services/crunch-run/background.go?ds=sidebyside diff --git a/services/crunch-run/background.go b/services/crunch-run/background.go index a508538370..0d4612908c 100644 --- a/services/crunch-run/background.go +++ b/services/crunch-run/background.go @@ -155,8 +155,11 @@ func kill(uuid string, signal syscall.Signal, stdout, stderr io.Writer) error { // List UUIDs of active crunch-run processes. func ListProcesses(stdout, stderr io.Writer) int { - return exitcode(stderr, filepath.Walk(lockdir, func(path string, info os.FileInfo, err error) error { - if info.IsDir() { + // filepath.Walk does not follow symlinks, so we must walk + // lockdir+"/." in case lockdir itself is a symlink. + walkdir := lockdir + "/." + return exitcode(stderr, filepath.Walk(walkdir, func(path string, info os.FileInfo, err error) error { + if info.IsDir() && path != walkdir { return filepath.SkipDir } if name := info.Name(); !strings.HasPrefix(name, lockprefix) || !strings.HasSuffix(name, locksuffix) {