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

3
votes
1answer
96 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
1k views

Is there an easy way to log all commands executed, including command line arguments?

I am trying to find how to log a specific instantiation of rrdtool to see whether the path it is receiving is incorrect. I know I could wrap the executable in a shell script that would log the ...
3
votes
3answers
360 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 ...
3
votes
1answer
303 views

How to get the actual keyboard device given the output of /proc/bus/input/devices?

When I run: cat /proc/bus/input/devices ...I receive the following output: ... I: Bus=0003 Vendor=040b Product=2000 Version=0110 N: Name="Generic USB Keyboard" P: Phys=usb-0000:00:1d.0-1/input0 ...
3
votes
1answer
716 views

Do I have PCLMUL instruction set support?

Here are the flags from /proc/cpuinfo: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc ...
3
votes
1answer
100 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 ...
3
votes
1answer
257 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
576 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
211 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 ...
3
votes
1answer
947 views

When do jiffies increment? How a process runs in a jiffy?

I know that jiffies length is selected at kernel compile time and it is defaulted to 250 (4ms). Source: man 7 time - The Software Clock, HZ, and Jiffies I wonder what happens inside a jiffy. What are ...
3
votes
1answer
371 views

Plotting the sleep/wait chain of a process

I often want to know why a process in the middle of a pipeline is sleeping and not busy processing data. My current method is: find the pid of interest sudo strace -pt pid to get the blocking ...
3
votes
2answers
1k views

How can I test whether a block device is read-only from /sys or /proc?

On a CentOS6 system I have /dev/block/sr0 (read only) and /dev/block/sda (read/write). How can I find out programmatically which devices are read-only? There is a ro file in there, but it's '0' for ...
3
votes
1answer
999 views

Timer interrupts count in `/proc/interrupts` is updated very slowly and is very small

There is the result of cat /proc/interrupts|grep timer on my Ubuntu 11.04 machine: 0: 63 0 0 0 IO-APIC-edge timer LOC: 59 44 27 ...
3
votes
1answer
42 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 ...
3
votes
1answer
596 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 ...
3
votes
1answer
123 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 ...
2
votes
2answers
109 views

How to get environmental variables of a very short process?

I have a very short process for which i want to check the environmental variables for debugging purposes. The process is instant from a human perspective. The example illustrates it better. Example ...
2
votes
2answers
851 views

Is it possible to tell df to use /proc/mounts instead of /etc/mtab?

Installing gentoo in chroot I found that commands like mount and df doesn't work: they try to read file /etc/mtab (which of course is empty). Can I (for future use) setup or even recompile them so, ...
2
votes
2answers
526 views

No /proc in a Busybox-based embedded Linux distribution

I am making an embedded Linux distribution and my board is a Raspberry Pi. My kernel version is 3.2.27 without initramfs and my root file system as follows: /lib /* contains ...
2
votes
1answer
381 views

System IDLE Time > System Uptime?

I was testing out the linux api while working on something but got stuck on the following output. [Abhii@localhost net]$ cat /proc/uptime 39135.53 149657.73 As per specs the first number should be ...
2
votes
1answer
547 views

Is there a utility that interprets /proc/interrupts data in time?

is there something out there ? Like top is for ps
2
votes
2answers
535 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 ...
2
votes
2answers
92 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 ...
2
votes
2answers
1k views

File delete versus overwrite and link at /proc/pid/fd

It is well known that UNIX systems won't actually delete a file on disk while the file is in use. So if a file is being accessed by process 1 and process 2 deletes the file using rm, process 1 ...
2
votes
1answer
44 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 ...
2
votes
3answers
672 views

Is there a way to identify which process turns into Zombie process

One of the ubuntu server has 82 zombie processes. All processes shows '[sh] defunct' as process command. Is there a way to find out which process is becoming a zombie process? I tried checking the ...
2
votes
1answer
2k views

parsing process ID/names from /proc, thread IDs

When I'm parsing process IDs from /proc, obviously each thread of a process gets its own ID. And I realize that all the threads in that same process can be gathered from /proc/${pid}/task/. But my ...
2
votes
2answers
284 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 ...
2
votes
3answers
324 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 ...
2
votes
2answers
699 views

Chroot Risks w/ /dev and /proc

I am planning to set up a few chroot jails for some users to run/test Java applications (lets just assume each application is untrusted). Is there any risk involved with mounting /dev and /proc into ...
2
votes
2answers
701 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
1answer
286 views

What is the connection between jiffies and IPS? How to convert jiffies to IPS?

Reading from /proc/PID/stat a lot of information can be processed. I would like to see how many percentages has been used of CPU power by this process. There are a lot of variable around here (utime, ...
2
votes
0answers
30 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
35 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 ...
2
votes
0answers
143 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 ...
2
votes
1answer
756 views

/proc/cpuinfo showing zero cpu clock speed

I saw an interesting issue where the cpuinfo file from /proc filesystem shows the cpu clock speed as zero. It is a physical host with no virtualization. Can someone explain to me some probable reasons ...
2
votes
3answers
368 views

files in /proc/$PID (e.g. ssh-agent, Chrome) are not owned by user but by root

I am just answering another question here :-) and thus had a look – wanted to have a look at /proc/$PID/fd of ssh-agent in order to find out which socket it uses. But I can't. I am quite surprised to ...
2
votes
0answers
154 views

/proc/net/wireless does not show values unless run as root

cat /proc/net/wireless does not show statistics for wireless devices unless it is run as root, even though the permissions on the file are 444. The same seems to apply when accessing statistics via ...
2
votes
1answer
98 views

“ps” output and comments

I'm pretty sure you cant do this but maybe someone has some weird hack... Is there a way to get comments (#blahblah) to show up in ps output? My problem is that i have a script, lets call it ...
1
vote
2answers
526 views

How can I disable /proc pseudo-filesystem on a shared Linux environment?

Is it possible to disable the /proc pseudo-filesystem to prevent w, ps, top, etc, from showing what other users are doing? Of course, I still want "everything else" to work correctly. Is there a ...
1
vote
2answers
106 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 ...
1
vote
2answers
306 views

Making Bootable USB, problems copying /proc

I'm creating a bootable usb as a cloned partition and am running into problems copying /proc to the usb. I know /proc contains a lot of virtual files, but I'm not sure how to copy them over. It seems ...
1
vote
1answer
365 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
1answer
38 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 ...
1
vote
1answer
380 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 ...
1
vote
1answer
512 views

How to clone a read-only portion of /proc file system

The problem with reading /proc file system is that it is not atomic. I tried using a library (procfs in Python) that wishes to read it, but it has glitches about 5% of the time because the process ...
1
vote
1answer
143 views

Looking for /procfs documentation, describing values and units of measurement

Surprisingly, comprehensive documentation for /procfs is hard to find. For my specific question, I am looking at: cat /proc/1/statm (let's use pid=1 because it seems to be always there). I just ran ...
1
vote
1answer
419 views

vmstat on virtual machine and large values

Hi I'm using vmstat to track machine performance during some tests (jmeter). This is virtual machine running on a big machine where lots of other virtual machines are installed (about 20 virtual ...
1
vote
2answers
1k views

Is there a faster interface for info from /proc/net/tcp?

Given a linux TCP socket's inode (obtained via /proc/<pid>/fd), is there a faster way to look up the information that I can get from /proc/net/tcp about this socket? I have written a ...
1
vote
2answers
110 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 ...