proc

Thread Name: Is /proc/pid/comm always identical to the Name: line of /proc/pid/status and the second field of /proc/pid/stat?

Thread Name: Is /proc/pid/comm always identical to the Name: line of /proc/pid/status and the second field of /proc/pid/stat? A Linux thread or forked process may change its name and/or its commandline as visible by ps or in the /proc filesystem. When using the python-setproctitle package, the same change occurs on /proc/pid/cmdline, /proc/pid/comm, the Name: line …

Total answers: 1

ps -o pid,ppid,stat,exe -e | grep deleted has "(deleted)" appended to the executable path

ps -o pid,ppid,stat,exe -e | grep deleted has "(deleted)" appended to the executable path ps -o pid,ppid,stat,exe -e | grep deleted generates output like this: 1777 1346 Sl /usr/bin/python3.10 (deleted) 1778 1346 Sl /usr/bin/python3.10 (deleted) 1825 1327 Ss /usr/lib/bluetooth/obexd (deleted) 2007 1 Sl /usr/bin/python3.10 (deleted) 2101 1346 S /usr/bin/python3.10 (deleted) 2199 1 Sl /usr/bin/python3.10 (deleted) …

Total answers: 2

Who mounts /proc and /sys in GNU/Linux systems?

Who mounts /proc and /sys in GNU/Linux systems? If you build a custom GNU/Linux system for an embedded device, do you need to execute mount -t proc proc /proc mount -t sysfs sysfs /sys somewhere in init process or is this done automatically by the kernel? I’ve read contradicting statements about this. An embedded Linux …

Total answers: 1

sudo cannot ls root owned files in /proc

sudo cannot ls root owned files in /proc I am on Debian 12 and I am trying to write a script to identify processes with certain inodes (from /proc/net/raw and /proc/net/packet). My original grep command is this (to get only the pid itself): inode=$(cat /proc/net/packet | sed -r ‘s/s+/,/g’ | cut -d"," -f9 | sed …

Total answers: 1

Memory total shown on Linux on 8GB memory PC is only 7038920 kB

Memory total shown on Linux on 8GB memory PC is only 7038920 kB Why linux /proc/meminfo show:" 1 MemTotal: 7038920 kB " (proc most likely is to mean Kibibyte) in a PC of 8 GB memory RAM, although its Kibibyte is 7812500 ? Asked By: Nonok cantik || Source BIOS may reserve some RAM which …

Total answers: 1

Should the use of /etc/mtab now be considered deprecated?

Should the use of /etc/mtab now be considered deprecated? I’m curious about the file or symlink /etc/mtab. I believe this is a legacy mechanism. On every modern linux I’ve used this is a symbolic link to /proc/mounts and if mtab were to be a regular file on a "normal" file system /etc there would be …

Total answers: 2

"Others" cannot read 'smaps_rollup' file with -r–r–r– permission under /proc/PID/. Why?

"Others" cannot read 'smaps_rollup' file with -r–r–r– permission under /proc/PID/. Why? I’m trying to read two specific files, namely status and smaps_rollup for all the processes under /proc. All process directories have dr-xr-xr-x permission and I’m able to enter every one of these directories. For all the processes the permissions for both of these files …

Total answers: 1

zathura and ownership of files in /proc/PID

zathura and ownership of files in /proc/PID Yesterday, while writing an answer to How to get full path names of all opened pdf files (in zathura) – like rofi does, I noticed something weird about the ownership of files the /proc/PID/ directory for zathura processes – most of them are owned by root instead of …

Total answers: 1

How Do Logs Get From "Kernel Ring Buffer" to "/proc/kmgs" and "/dev/kmsg"?

How Do Logs Get From "Kernel Ring Buffer" to "/proc/kmgs" and "/dev/kmsg"? I can not get any reliable information about how do kernel logs get from Kernel Ring Buffer to /proc/kmgs and /dev/kmsg. Is there any source I could have possbily missed or does perhaps anyone know from their head? Asked By: GabrijelOkorn || Source …

Total answers: 1

Output text file contents (/proc/interrupts) as they change

Output text file contents (/proc/interrupts) as they change Is there some command I can use to monitor changes in /proc/interrupt? For example, using head -4 I can see that the file is changing, but only if I run head again and again: > head -4 /proc/interrupts CPU0 CPU1 0: 451325 0 IO-APIC 2-edge timer 1: …

Total answers: 1

Binary format of IPv6 loopback address

Binary format of IPv6 loopback address In one terminal, I ran $ nc -l -6 ::1 5000 In another terminal, I ran $ cat /proc/net/tcp6 and saw this line: 0: 00000000000000000000000001000000:1388 00000000000000000000000000000000:0000 … Why does that say that I’m listening on ::1:0:0:0 and not ::1? Asked By: Daniel Walker || Source If you look at …

Total answers: 1

How does /proc interact with PID namespaces?

How does /proc interact with PID namespaces? I do not understand how namespaces interact with /proc. I assumed that /proc returns values based on the process that queries them. For example, let’s determine the PID of the current process inside the global PID namespace: $ bwrap –bind / / readlink /proc/self 6182 This makes sense …

Total answers: 1

kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256

kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256 After update to kernel 5.10.119, /proc/sys/kernel/random/entropy_avail became stuck to 256 and does not change when moving the mouse. It used to be greater than 3000. # cat /proc/sys/kernel/random/entropy_avail 256 Also, /proc/sys/kernel/random/poolsize went down to 256. It used to be 4096. Is this a …

Total answers: 2

What do the permissions mean in /proc/<pid>/fd/?

What do the permissions mean in /proc/<pid>/fd/? I’m looking at the result of running ls -l on /proc/<pid>/fd/: lr-x—— 1 root root 64 Apr 22 23:13 0 -> /dev/null lrwx—— 1 root root 64 Apr 22 23:13 1 -> ‘socket:[19700]’ lrwx—— 1 root root 64 Apr 22 23:13 2 -> ‘socket:[19700]’ … What do the …

Total answers: 2

How to get NSPid on kernel 3.10

How to get NSPid on kernel 3.10 In kernel 4.1 and above, /proc/[pid]/status contains these 4 lines: NStgid: 1 NSpid: 1 NSpgid: 1 NSsid: 1 This allow a process in parent namespace to know about that process’ PID in all namespaces. But those lines are only added in kernel 4.1, so kernel 3.10 doesn’t have …

Total answers: 1

Programmatically ascertain aspects of socket file

Programmatically ascertain aspects of socket file I’m trying to write a program (in C) which, as one of its features, walks the procfs to find open sockets and ascertain things like the destination/source ports/addresses (similar to what netstat and lsof do). However, I’m not sure which system call to use once I find a socket …

Total answers: 2

How to change /proc/*/environ of a bash shell

How to change /proc/*/environ of a bash shell This is the shell’s PID: nathan@guixlaptop ~ $ $$ bash: 10984: command not found I export an environment variable: nathan@guixlaptop ~ $ export TESTVAR=test The variable is not found in the shell’s environment: nathan@guixlaptop ~ $ cat /proc/10984/environ | grep TESTVAR || echo "fail" fail How do …

Total answers: 3

Format the output of "read_file uptime" in i3status

Format the output of "read_file uptime" in i3status I’m trying to display my system uptime with i3status. This is what I have in my i3status.conf file: read_file uptime { format = "%title: %content" path = "/proc/uptime" } However the output is in seconds, as can be seen in this screenshot, which is obviously not ideal: …

Total answers: 2

Permanently setting intel pstate driver to "passive"

Permanently setting intel pstate driver to "passive" My i5-11600K CPU is using the intel_pstate frequency scaling. By default, the driver is in "active" mode and will throttle up ALL 6 physical cores, even if there is only work for one core. To fix this, I do: # echo "passive" > /sys/devices/system/cpu/intel_pstate/status But after a reboot, …

Total answers: 2