procfs (or the proc filesystem) is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure

learn more… | top users | synonyms

1
vote
0answers
21 views

How does /proc/$PID/fd actually work? [duplicate]

According to the terse documentation I managed to find, each file in /proc/$PID/fd is supposed to be a symlink to the actual file associated with that file descriptor. However, that doesn't appear to ...
0
votes
0answers
27 views

Cannot change CPU affinity on 3.13 kernel for eth0 interrupts

We are running 3.13 kernel (Ubuntu 14.04) on an IBM x3550 servers. I think I may have found a bug changing IRQ affinity for eth0 internet interface, that corresponds to IRQ 43 on this device. ...
6
votes
1answer
158 views

What's the purpose of the /proc/pid/mountinfo file?

What's the purpose of the /proc/pid/mountinfo file (with pid being numerical process id)? As far as I can see it reflects contents of the /proc/mounts file but with added information. Also the file ...
3
votes
0answers
50 views

Strange cpu usage values reported by pidstat

I have a script that reports the cpu usage of a specific program reading values from pidstat. The script launches as: pidstat -C ^frontend$ -h -l -p ALL 1 1 The values reported this way sometimes ...
2
votes
1answer
68 views

Dirty in /proc/meminfo for dd

I read from here that the below command gives me the amount of data that needs to be written to the disk. grep ^Dirty /proc/meminfo It particularly says Ever ask yourself "How much data would be ...
5
votes
3answers
467 views

Why can't I `tail -f /proc/$pid/fd/1`?

I wrote a simple script which echo-es its PID: #/bin/bash while true; do echo $$; sleep 0.5; done I'm running said script (it says 3844 over and over) in one terminal and trying to tail ...
2
votes
0answers
34 views

Why does each process folder under /proc contain the same information?

Under /proc/<PID>/net pseudo-file system each process seems to have files with the same content. For example I use cat /proc/<PID>/net/ip_tables_names to list iptables tables under the ...
2
votes
1answer
49 views

Pernicious USB-stick stall problem. Reverting workaround fix?

There's an issue with Ubuntu that hasn't been fixed yet, where the PC freezes or gets really slow whenever it is copying to an USB stick (see Why is my PC freezing while I'm copying a file to a ...
1
vote
2answers
51 views

With “find /”, skip directories like “/proc”, “/sys” and similar

There are some directories that can cause problem with find, and especially find /. These are directories in which the OS creates files which are not really files. Among these directories are /proc ...
1
vote
1answer
48 views

/proc/config.gz is of 0 bytes

I have an Android TV stck I compiled Linux for IT from https://github.com/Galland/rk3x_kernel_3.0.36 But when I booted that Image I found /proc/config.gz is of 0 bytes can some please explain how ...
6
votes
1answer
43 views

How do I know what decompression algorithms are compiled-in into the linux kernel?

If /proc/config.gz is unavailable, how do I know what decompression algorithms the running kernel is capable of using on a compressed cpio initramfs? Is the gzip algorithm always available, even when ...
3
votes
1answer
48 views

How do I find out what filesystem drivers are compiled-in into the linux kernel?

On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example ...
0
votes
2answers
56 views

Using /proc/stat for the number of processes running on the system

How does one find out the true number of processes that is running on your system. A number of articles mention using ps in order to count the number of processes. But recently I looked at cat ...
3
votes
1answer
115 views

How to programmatically retrieve the GID of a running process

I need to write some C code to check the effective GID of a running process whose PID I know. I've not found any direct way to do this. There are a number of heavyweight kludges I could use, such as ...
0
votes
2answers
143 views

Is Inactive memory related to the Commited but unused?

From the Linux procfs documentation: Active: Memory that has been used more recently and usually not reclaimed unless absolutely necessary. Inactive: Memory which has been ...
4
votes
1answer
69 views

What causes /proc/<pid>/* resources to become owned by root, despite the procs being launched as a normal user?

I've noticed that some procs, such as bash, have their entire /proc/<pid>/ resources readable by the user who created that proc. However other procs, such as chrome or gnome-keyring-daemon, have ...
1
vote
1answer
637 views

Is it possible to get process group ID from /proc?

In "http://stackoverflow.com/questions/13038143/how-to-get-pids-in-one-process-group-in-linux-os" I see all answers mentioning ps and none mentioning /proc. "ps" seems to be not very portable ...
1
vote
2answers
118 views

In Linux, why do you need to be root to write to /proc/sysrq-trigger?

WARNING: THE NEXT KEY COMBINATION WILL CRASH YOUR COMPUTER Ok, I get that this is an administrative tool and all, but I realized that any user can do ALT + SysRq + C. This link explains what I'm ...
3
votes
1answer
65 views

OOM Killer value always one less than set

I am trying to set the oom_adj value for the out of memory killer, and each time I do (regardless of the process) I get back exactly one less than I set (at least for positive integers. I haven't ...
2
votes
2answers
440 views

/proc/pid/maps addresses (and converting them)

When looking at the memory maps in /proc/pid/maps, we can see different length addresses 00400000-0042e000 r-xp 00000000 fb:01 268953 /bin/nano 0062e000-0062f000 r--p ...
17
votes
7answers
708 views

How do I source another process's environment variables?

If I examine /proc/1/environ I can see a null-byte-delimited string of process 1's environment variables. I'd like to bring these variables into my current environment. Is there an easy way to do ...
4
votes
1answer
106 views

Does pipe's link target exist somewhere in the filesystem?

I'm talking about this: $ readlink <(echo test) pipe:[80076194] Is pipe:[80076194] a path to the target or just indication that the file descriptor is connected to the pipe and doesn't exist in ...
1
vote
1answer
594 views

how to determine the max user process value?

Which value is correct?(or they are all correct, but which one will take effect?) $ cat /proc/sys/kernel/pid_max 32768 $ ulimit -a |grep processes max user processes (-u) 77301 $ cat ...
5
votes
2answers
497 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
55
votes
3answers
5k views

What happens when I run the command cat /proc/cpuinfo?

What happens when I write cat /proc/cpuinfo. Is that a named pipe (or something else) to the OS which reads the CPU info on the fly and generate that text each time I call it?
3
votes
1answer
104 views

What's the correct value to base the maximum number of CPU's to sched_setaffinity to?

I have some confusion as to what's the correct value to use for the number of CPU's I can use to make a CPU_SET for a sched_setaffinity call on my system. My /proc/cpuinfo file: processor : 0 ...
3
votes
1answer
315 views

Kernel /proc ipv6 settings precedence

I'm about to connect our network to the IPv6 Internet and need to control the kernel ipv6 settings found under /proc. I know there are configurations for each interface, for all interfaces, and the ...
3
votes
1answer
714 views

Does “syslogd” cause “cat /proc/kmsg” not to work properly?

I'm using cat /proc/kmsg to determine which process and file was involved in certain disc writes. I'm using the method given in this answer. But when I use cat /proc/kmsg, the output doesn't always ...
3
votes
1answer
782 views

Accounting for /proc/net/dev reported traffic

I noticed that according to /proc/net/dev I am constantly receiving around 6Kb/s on my wireless usb interface. But I can't account for anything even close to that with the individual connections that ...
2
votes
0answers
169 views

/proc/self/maps - 3rd mapped piece of file?

I'm running Arch linux on my laptop, which is kernel 3.12.9 right now. Something has changed about the way the kernel maps in a dynamically-linked executable and I can't figure it out. Here's the ...
1
vote
1answer
481 views

Do VmPeak & VmHWM have any measurement periods?

While reading kernel documentation I came across VmPeak & VmHWM, and it's a bit unclear to me. VmPeak in /proc/<pid>/status is described to be peak virtual memory size. Peak for what ...
0
votes
2answers
255 views

How to get total disk read/write in bytes per hdd device from /proc

How to get total disk read/write in bytes per hdd device? for example if i have sda, sdb, and sdc, is there any file on /proc that i could use similar to /proc/net/dev for networking?
2
votes
3answers
380 views

How to find out easily whether a block device (or a part of it) is mounted somehow

I want to know what the easiest way is to determine (without root privilege) whether a block device (say sdb) or any part of it is mounted (and which part of it). Checking /proc/mounts for sdb is not ...
3
votes
1answer
235 views

What is the Inverse of Idle in /proc/stat?

/proc/stat/ includes the following fields: "user", "nice", "system", "idle", "iowait", "irq", "softirq", "guest", "guest_nice", Which subset of those fields + idle accounts for 100% CPU? Is there ...
1
vote
2answers
112 views

processor(s) statistics that is one day old

I already know how to use grep -w cpu /proc/stat in order to get the cpu stats and identify the user mode. Percentage wise, I just divide it my the total time from the /proc/uptime. However, how can ...
1
vote
1answer
586 views

The amount of time since the system was last booted [duplicate]

I have used both uptime and cat /proc/uptime commands. I know the idle time in the later can be greater than running time (multiprocessors). However, when I add both running and idle times, and ...
4
votes
3answers
5k views

“echo 3 > /proc/sys/vm/drop_caches” - Permission denied as root

I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > ...
0
votes
1answer
647 views

root permission denied on /proc/1/exe

I just performed a fresh ubuntu install and i am seeing the following in lsof: userA@az1:~$ lsof COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 ...
8
votes
2answers
2k views

Determine if a specific process is 32- or 64-Bit

Given a 2.6.x or newer Linux kernel and existing userland that is capable of running both ELF32 and ELF64 binaries (i.e. well past How do I know that my CPU supports 64bit operating systems under ...
2
votes
2answers
863 views

Busybox ash script does not exit cleanly after executing cat; unable to get exit code

Consider the following script wrapcat.sh (a wrapper for cat) for illustrative purposes. It is run with busybox (ash) in an embedded Linux 2.6 box. #!/bin/sh cat $1 Under certain circumstances, this ...
2
votes
2answers
696 views

where does lspci gather its information from?

In kernel.org's documentation on proc I found "[The latest version of this document is available online". There I says: "… lspci is a synonym for cat /proc/pci". Which isn't the ...
4
votes
2answers
207 views

UUID in /etc/mtab

In some versions of Ubuntu. Disks are mounted by UUID. in My machine, /proc/mounts /dev/disk/by-uuid/UUID / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0 /etc/fstab UUID=U-U-I-D ...
4
votes
1answer
148 views

Why is UID information not in /proc/X/stat?

This is a silly question for the sake of academics; I know where to get the UID information if I need it. According to the proc(5) man page: /proc/[number]/stat Status ...
6
votes
1answer
1k views

How do I know if a serial port is actually transmitting data, without opening the device?

I have a high-availability cluster (Heartbeat) connected via serial line and two ethernet NICs. I'd like to set up a monitoring script capable of recognizing disconnected serial line (basically the ...
1
vote
0answers
85 views

Value of /proc/sys/kernel/hostname

I've set computer hostname in /etc/hostname a while ago (also there are record in /etc/hosts). Everything worked fine, but recently I've noticed that value of hostname (and /proc/sys/kernel/hostname) ...
3
votes
1answer
130 views

Is there a way to show all flags in /proc/mounts?

Some filesystem flags seem to be hidden in /proc/mounts, depending on whether they are defined as defaults. Is there a way to show all flags in /proc/mounts, also including the default ones? And if ...
1
vote
1answer
2k views

Modify 'Soft Limit' of 'Max processes'

I tried ulimit -u 2000 and ulimit -Su 2000 to modify the 'Max processes', and started up my program, but failed. I found file '/proc/pid/limit' is still: Max processes 1024 ...
6
votes
2answers
282 views

Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a “replacement” distribution?

This answer to another question basically boils down to chrooting into another Linux distribution in order to mainly use that as a replacement to its too restricted (but irreplaceable) parent. The ...
2
votes
2answers
99 views

Detecting kernel thread on pre-3.0 kernels

Looking at the proc man page (http://man7.org/linux/man-pages/man5/proc.5.html) it is possible to detect which processes are kernel threads in /proc/<pid>/stat by looking at the flags value ...
3
votes
3answers
405 views

Command line options of rackup are not shown in ps output or procfs

As you know if you wish to get command-line runtime arguments for running command you can parse ps -e or /proc/<pid>/cmdline. But I have encountered issue when this method returns only command ...