[Bug 272775] procfs "file" entry pointing to nothing?

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 03 Aug 2023 11:04:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272775

--- Comment #1 from Peter Eriksson <pen@lysator.liu.se> ---
Created attachment 243821
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=243821&action=edit
Script checking that /proc/<pid>/file symlink can be read

Attached a sample test script that can be run from crontab (for example) to
check for unreadable /proc/<pid>/file symlinks.
Here's an example of it's output from one of my servers right now:

> # bin/check_procfs
> 34687: Unable to get exec path
> USER       PID %CPU %MEM   VSZ   RSS TT  STAT STARTED    TIME COMMAND
> peter    34687  0.0  0.0 21444 11040  -  S    00:40   0:00.24 sshd: peter@pts/3 (sshd)
> 47882: Unable to get exec path
> USER       PID %CPU %MEM   VSZ   RSS TT  STAT STARTED    TIME COMMAND
> peter    47882  0.0  0.0 21444 10952  -  I    Mon11   0:00.82 sshd: peter@pts/0 (sshd)

> # ls -l /proc/34687/
> total 0
> -r--r--r--  1 peter  admins  0 Aug  3 12:57 cmdline
> -r--r--r--  1 peter  admins  0 Aug  3 12:57 etype
> 
> ls: /proc/34687//file: No such file or directory
> lr--r--r--  1 peter  admins  0 Aug  3 12:57 file
> -r--r--r--  1 peter  admins  0 Aug  3 12:57 map
> -r--r--r--  1 peter  admins  0 Aug  3 12:57 rlimit
> -r--r--r--  1 peter  admins  0 Aug  3 12:57 status

-- 
You are receiving this mail because:
You are the assignee for the bug.