Questions tagged [proc]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

calculating ifa flags larger then 0xFF from /proc/net/if_inet6

I have been trying to write some code for puppetlabs facter program to parse the ifa flags from /proc/net/if_inet6. currently the code works well detecting flags for values < FF but struggles ...
1
vote
1answer
28 views

Mounting proc with hidepid option doesn’t hide procs as expected, why?

I have a regular proc fs mounted at /proc by default. (I’m root for all of the following commands) I’m mounting the same again at a different location with hidepid option set like so: mount -t proc -o ...
0
votes
1answer
23 views

How to get open file descriptors/handles using libprocps in c program

I am trying to create a performance display for my IOT device. The device uses Linux so , i want to get the number of file handles programmatically using C program. Currently i am using libprocps API ...
0
votes
1answer
29 views

List open files without lsof/fuser at a particular path

On a system that doesn't have lsof or fuser, is it possible to get a list of open files at a particular path? E.g., I'm looking to dismount /volume1 (a software RAID) to run e2fsck and can't, because ...
1
vote
1answer
35 views

how to interpret octal flags in /proc/PID/fdinfo/N

The procps manpage states that the flags field in files in /proc/PID/fdinfo/ is an octal number indicating the file access mode and file status flags. The open manpage gives explanations of various ...
1
vote
0answers
45 views

How to find out how many RAM slot?

I have to extend my RAM memory, Because I need to use Android Studio. I need to find out how many RAM slot via lshw command or greping /proc contents.I don't want to open my laptop. How can I find out?...
0
votes
1answer
12 views

Is there a reliable path to specific device events?

I'm running ubuntu linux and I have a bluetooth mouse that I would like to capture evdev events from. The problem is that the event device can potentially be different any time I connect the mouse: ...
0
votes
1answer
20 views

I want to display specific infomation from /proc/cpuinfo

I want to Show the number of CPUs, the producer of the CPUs and the CPU model. I have used cat /proc/cpuinfo to show the cpuinfo. however i want to only display the needed information. e.g. processor ...
0
votes
1answer
59 views

Why cwd in /proc/nautilus_pid/cwd always points to /home/username?

I wanted to check the current directory opened in nautilus window. I check the pid of nautilus, and symbolic link proc/pid/cwd, always points to home directory. Is this expected behaviour? If so ...
1
vote
1answer
23 views

Bind-mount and cryptsetup result in truncated root-path in /proc/self/mountinfo

I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount ...
3
votes
1answer
51 views

Where does one find the total number of context switches performed since bootup?

I figured out that the number of context switches performed by a process can be found in /proc/$$/status. I have been trying to look for the total number of context switches performed since bootup. I ...
3
votes
1answer
44 views

How to access /proc/ file (procfs) via SSHFS

Using a computer with Ubuntu 16.04 (no update suggestions please) I mounted /proc/ at my Raspberry Pi 3B + (linux kernel version 4.19.88) via SSHFS: sshfs pi@192.168.0.4:/proc ~/procAtPi ls -la ~/...
2
votes
1answer
174 views

Getting the executable name in Linux from /proc/ and detect if it's truncated

The executable name is linux can be read in various ways. By reading /proc/[pid]/comm, which contains a string that's truncated after reaching 16 characters or TASK_COMM_LEN. By reading /proc/[pid]/...
1
vote
1answer
62 views

Chinese Characters in One of a File

I have found some chinese characters in one of a file on my linux mint 20.1 File - /proc/1/cmdline Chinese Characters - 猯楢⽮湩瑩猀汰獡h But when i open same file in terminal using less command, it shows : /...
1
vote
0answers
16 views

Is there a way to tell how much memory is file-backed on Linux process?

I'm looking to see how much of my memory is file-backed on a process. Unfortunately proc/pid/smap_rollup shows stats for how much memory is being used, but it doesn't seem to differentiate between ...
2
votes
0answers
32 views

Get the full path of running script from /proc

If a running script was called directly, as in not by calling its interpreter with the script's path as an argument, how can the full path to script file reliably be retrieved regardless of the ...
0
votes
0answers
43 views

Manipulate the result of uname?

Is it possible to fool Linux what CPU, the amount of memory etc it runs on? I have a NAS running an obscure custom Linux distribution (Seagate's internal) that requires a certain hardware to enable a ...
1
vote
1answer
77 views

Calculate TCP memory usage (does not add up)

I am running a Debian GNU/Linux 9.5 (stretch) with kernel: 4.9.0-7-amd64. I have found the culprit of a memory consumption problem I am facing to be an in-app mechanism for sending logs to FluentD ...
0
votes
1answer
83 views

Difference between CPU usage in top and /proc/stat

I'm trying to write a little script that, among other things, calculates the cpu usage by reading /proc/stat, and I can't seem to get consistent results. I'm basically doing a grep cpu /proc/stat and ...
0
votes
1answer
32 views

Getting a parent script name from a child script

CentOS/RHEL 7. GNU bash, version 4.2.46(2)-release I have two bash scripts, lets call them parent.sh and child.sh. The parent just calls the child thus: # parent.sh ./child.sh and in child.sh I want ...
1
vote
2answers
39 views

How can I list network devices and ipv4 address on linux without ifconfig/ip command

This is NOT a duplicate of How to get my own IP address and save it to a variable in a shell script? ; it is an attempt to revicve How can I list net work devices and ipv4 address on linux without ...
-2
votes
1answer
64 views

Do user mode processes have to change to kernel mode to access /proc and /sys filesystems

Computer Systems: a Programmer's Perspective says Processors typically provide this capability with a mode bit in some control register that characterizes the privileges that the process currently ...
0
votes
0answers
19 views

How to identify GPU processes (or processes in general) that have been idle for the last x consecutive hours?

How would one go about identifying processes (gpu processes specifically) that haven't done anything in the last 2 hours - for example? The problem I'm having stems from multiple users trying to use a ...
0
votes
0answers
30 views

Allow Special Users Accessing /proc not Working

I have a CloudLinux7 server which is using hidepid to prevent users access /proc. However, I also need the monitoring tool has the permisison. So, I set up the gid while mounting the dir. But, it ...
0
votes
0answers
30 views

Is my From-Scratch system using fstab?

I've started writing a simple, small distro, not using LFS. Everything has been going amazingly smooth so far. I only have one problem, which I address here - whenever I boot up, my system is "...
1
vote
2answers
97 views

when /proc/cpuinfo begin to update all the time, especially the field “cpu MHz”? [duplicate]

I saw that /proc/cpuinfo update all the time, especially the field "cpu MHz"? I assumed that these details should be constant. When did /proc/cpuinfo begin to update all the time, especially ...
0
votes
1answer
155 views

UDP Packet drops

I understand that the receive flow for a UDP packet is Check udp header for errors Match destination to socket Send an error message back if no such socket Put packet into appropriate socket receive ...
3
votes
1answer
248 views

Does /proc/ contains tid?

I have process id 1234. This process contains thread id 1235. When I use ls -l /proc I see only the pid (1234) but when I open the thread status file using cat /proc/1235/status I can see data. Why is ...
-1
votes
1answer
111 views

How to find out on which core a thread is running on?

Let's say we have a CPU-intensive application called multi-threaded-application.out that is running on top of Ubuntu with a PID of 10000. It has 4 threads with tid 10001, 10002, 10003, and 10004. I ...
-1
votes
1answer
39 views

Does /dev, /run and /sys exist on HDD (if so what is there location if it can be meaningfully traced)?

At the time of Linux installation, i have mentioned only one filesystem (/dev/sda1 -> ext4 -> / ). But for dev, run, proc, sys - Linux is creating addition FS which is inferable from mount. $ ...
2
votes
1answer
166 views

zsh: check whether $PWD is on tmpfs mounted filesystem

I would like to change my zsh prompt color, if $PWD is currently on tmpfs mounted filesystem. Lets say for example, /dev/shm is a tmpfs filesystem. I can confirm that: $ grep /dev/shm /proc/mounts ...
0
votes
1answer
39 views

tab completion of /proc/self/fd/ shows different completions compared with listed contents

Using zsh, if I try tab completion of the following command ls /proc/self/fd/ then I see the following: files 0@ 1@ 10@ 11@ 12@ 13 2@ 3 However, when I press enter (without completing) I ...
2
votes
0answers
134 views

How to get unix socket inode given its path?

Let /var/run/mysqld/mysqld.sock/ be an open socket. I can stat it to get inode of the file (here 1200) # stat /var/run/mysqld/mysqld.sock File: /var/run/mysqld/mysqld.sock Size: 0 ...
3
votes
1answer
151 views

What's the meaning of [socket:number] in /proc/pid/fd

UNIX domain sockets opened by given $PID are listed in /proc/$PID/fd/X as symlinks to [socket:ID]. I understand that it's an identifier of that socket, but what exactly is it? Is it an inode in sockfs?...
1
vote
1answer
36 views

Will execute time of kernel thread will be included in /proc/[pid]/stat?

My process accesses a file in disk, which is mounted with iSCSI driver. I knew iSCSI has several kernel modules and some of them run as kernel threads. As my knowledge iSCSI needs a lot of CPU time, ...
0
votes
1answer
66 views

Emulate /proc folder

I've a software that uses a few nasty algorithms to determine, wether it runs in a docker container or not. One example is, that it scans /proc/1/cgroup for non root paths (i.e. /docker/SOME-UUID ...
0
votes
1answer
288 views

Documentation for the meaning of entries in /proc/meminfo and /proc/vmstat

Where can I find documentation explaining the meaning of entries in /proc/meminfo and /proc/vmstat files? I looked up on the web and the man page of proc but could not find much. Many entries are self ...
0
votes
1answer
44 views

What can a debugger do with /proc that cannot be done with ptrace?

The Wikipedia article on ptrace says: Communications between the controller and target take place using repeated calls of ptrace, passing a small fixed-size block of memory between the two (...
0
votes
1answer
926 views

kswapd0 in ubuntu slows down the system

We don't have any service running in the ubuntu but currently, we see the system becomes very slow from the morning, When I tried top command, I see there are two new services running like below, top ...
0
votes
1answer
40 views

Is there any way to recover files from the informations in `/proc`? [duplicate]

I have just asked in an interview that if someone mistakenly deletes apache logfile from /var/log/apache/access.log while it's being written, can you recover it? After my answer interviewer said that ...
1
vote
2answers
75 views

Detailed information on a single process in a greppable format

Utilities such as ps and top are good for looking at many processes side-by-side. However, they are inconvenient for examining many fields of a single process and are not amenable to using grep. For ...
0
votes
1answer
263 views

pidstat %CPU vs htop %CPU of a process

I'm using the pidstat to monitor the cpu usage of a process and it shows 100%. For the same process the htop or top shows 200% for the same process. The system has 16 cores, and the process i am ...
2
votes
1answer
352 views

How do I restore files removed from /usr/bin?

TL;DR at the bottom. Background: The following occured on my CentOS 6.10 production server. I was using a browser based terminal program to run the program Midnight Commander which is a console-...
0
votes
1answer
17 views

Does statting /proc/PID/stat make the kernel generate the contents so that a file size is returned?

I'm implementing an alternative to top, and thought that I should preallocate an appropriately sized buffer to hold the read contents of /proc/PID/stat. However, knowing that it's a pseudo filesystem ...
0
votes
1answer
109 views

How to determine active/passive end of TCP connection

If I inspect information about established TCP connections as returned by sock_diag(7) (or in /proc/net/tcp), how can I determine whether a given connection originated with the local side owning the ...
1
vote
1answer
342 views

permission denied, even when I have permission

This may be a dumb question, but how does symbolic link preserve permission? $ls -ld /proc/1/exe ls: cannot read symbolic link '/proc/1/exe': Permission denied so I look up what the link point to ...
3
votes
0answers
131 views

failure to stat /proc/self/map_files symlink - permission denied?

I am writing some code that checksums executable mappings. Through /proc/$PID/map_files, Linux provides symlinks to the files that back memory mappings. My code is calling "stat()" on one of these ...
0
votes
1answer
37 views

autofs --force unmounts /proc

Historically I've seen autofs get into situtations where systemctl restart autofs will hang indefinitely due to stale nfs handles. As a result I've employed the --force option to make autofs play a ...
1
vote
0answers
34 views

Identify filesystem for each mtd

In /proc/mtd I can see all partition in my device dev: size erasesize name mtd0: 0xxxxx00 0xxxxx00 "yyyy" mtd1: 0xxxxx00 0xxxxx00 "yyyy" mtd2: 0xxxxx00 0xxxxx00 "yyyy" How can I know which ...
0
votes
1answer
43 views

How does OS kernel get known connected hardware configuration to save it in `/proc` files?

In my student assignment I'm asked to track how Linux kernel discovers configurations of any device connected. For instance, the system has a new printer plugged in. As far as I can see, all features ...

1
2 3 4 5
10