Sponsored Content
Top Forums UNIX for Advanced & Expert Users Negative values for peer inodes in ss -x output Post 303046271 by Skrynesaver on Wednesday 29th of April 2020 07:45:11 AM
Old 04-29-2020
Negative values for peer inodes in ss -x output

Hi all,

Long time no see, love what you've done with the place, been a while and asked this in the wrong forum initially...

I'm wondering how to interpret negative values for local and peer inode values for Unix sockets?

Code:
Netid  State      Recv-Q Send-Q Local Address:Port                 Peer Address:Port
...
u_str  ESTAB      0      0      /var/run/docker.sock -1847002447           * -1846996756

I can trace the local/peer relationship in the ss -xpan output for example...
grepping out known a negative inode id I get
Code:
# ss -xp | grep --  -1841560902
u_str  ESTAB      0      0      /var/run/docker.sock -1841556763           * -1841560902           users:(("dockerd",pid=29490,fd=276))
u_str  ESTAB      0      0      *                    -1841560902           * -1841556763           users:(("metricbeat",pid=5712,fd=94)

Then looking at the proc entry for the metricbeat process I get a non-negative inode for fd 94.
Code:
# ls -l /proc/5712/fd/
...
lrwx------ 1 root root 64 Apr 28 12:00 94 -> socket:[2453406394]

I'm curious as to the relationship (if any) between the "real" inode value and the negative value used for the inode in the ss output , what circumstances this value is used in (despite there being an inode for the symlink in /proc ) and general wisdom on the subject.

Thanks, Skrynesaver
 

8 More Discussions You Might Find Interesting

1. SCO

Help with negative inodes on sco 6

Hello. I just installed a SCO Openserver 6 box and it's suckin' mud. sar -v (see below) shows something that has me quite concerned... after time, it shows that the number of inodes being used as a negative value. When this happens, the server runs extremely slow until I reboot. The server... (0 Replies)
Discussion started by: debtman3535
0 Replies

2. IP Networking

Firewall stopping Peer to Peer File sharing

I am looking for advice on a router. I am new to Linux and am trying to use Limewire and Ktorent and can make no connection. Limewire indicates I have a firewall. I have a Linksys router WRK54G and my guess is that is the problem. I have spent hours upon hours trying to get it to work using info... (0 Replies)
Discussion started by: Paul K
0 Replies

3. Shell Programming and Scripting

Sorting positive and negative values

Hello, I have a list like this : 1 2 -4 0 -3 -7 5 6 etc. Is there a way to remove all the positive values and print only the negative values, without using grep, sed or awk? Thanks, Prasanna (4 Replies)
Discussion started by: prasanna1157
4 Replies

4. IP Networking

Problem with Static route through peer to peer connection

Hi, I am trying to add a static route in one of 3 server (S3) so that I can access the main application server (S1). But problem is, the server (S3) where I am trying to add static route is connected with another server (S2) which is in same private network of application server (S1). I have... (9 Replies)
Discussion started by: ImranBD
9 Replies

5. Shell Programming and Scripting

Awk+colpos+negative if for 20 values

Hi All, i have 20 Obligors when ever i dont find all of them on particular row/line from each in put i need to print it in different file. using below command but it is not working please help at earliest. Steps: set -A FILENAME $( cat... (10 Replies)
Discussion started by: rajubollas
10 Replies

6. Shell Programming and Scripting

Conavert negative values to Zeros

Can anyone please assist me? Please find the attached input and output file for ur reference. a)Incase if i get negative value (ex:-000100) in the 11th column then i have to convert the value to 0000000(7 zeros-length is 7) and then print the entire record. b)Incase if there is no... (2 Replies)
Discussion started by: vinus
2 Replies

7. Shell Programming and Scripting

How to sum the value with negative values?

Hi Gurus, I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work. awk -F"," '{if($8< 0 $8*-1 else $8) sum+=$8}{print sum, $8} END{printf("%.2f\n",sum)}' awk -F","... (4 Replies)
Discussion started by: ken6503
4 Replies

8. UNIX for Beginners Questions & Answers

Negative values for peer inodes in ss -x output

Hi all, Long time no see, love what you've done with the place! I'm wondering how to interpret negative values for local and peer inode values for Unix sockets? Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port ... u_str ESTAB 0 0 ... (0 Replies)
Discussion started by: Skrynesaver
0 Replies
CHECKPROC(8)						       The SuSE boot concept						      CHECKPROC(8)

NAME
Checkproc - Checks for a process by full path name Pidofproc - Checks for a process by exec base name SYNOPSIS
checkproc [-vLkNz] [-p pid_file] [-i ingnore_file] [-c root] /full/path/to/executable checkproc -n [-vk] name_of_kernel_thread checkproc [-vk] basename_of_executable pidofproc [-LkNz] [-p pid_file] [-i ingnore_file] [-c root] /full/path/to/executable pidofproc -n [-k] name_of_kernel_thread pidofproc [-k] basename_of_executable SYNOPSIS LSB 3.1 pidofproc [-p pid_file] /full/path/to/executable DESCRIPTION
checkproc checks for running processes that use the specified executable. checkproc does not use the pid to verify a process but the full path of the corresponding program which is used to identify the executable (see proc(5)). Only if the inode number (/proc/<pid>/exe) and the full name are unavailable (/proc/<pid>/cmdline) or if the executable changes its zeroth argument, checkproc uses the base name (/proc/<pid>/stat) to identify the running program. Note that if the option -n for kernel thread is given only (/proc/<pid>/stat) is used. For this case a existing symbolic link (/proc/<pid>/exe) indicates that the <pid> is not a kernel thread. Extended functionality is provided by the -p pid_file option (former option -f changed due to the LSB specification). If this option is specified, checkproc tries to check the pid read from this file instead of the default (/var/run/<basename>.pid). The pid read from this file is compared against the pids of the processes that uses the specified binary. If the option -k is specified, checkproc works like killproc that is that if the if the pid_file does not exist, checkproc assumes that the daemon is not running. It is possible to use a process identity number instead of a pid file. For the possibility of having two different sessions of one binary program, the option -i ignore_file allows to specify a pid file which pid number is used to ignore all processes of corresponding process session. Note that the behaviour above is changed by the option -k. With this option, the pid read from the pid file is the only used pid (see killproc(8)) and with this option also exit codes like startproc(8) or killproc(8) are used. Without this option, the pid read from the pid file is used to search the process table for a process with an executable that matches the specified pathname. In order to avoid confu- sion with stale pid files, a not up-to-date pid will be ignored (see startproc(8)). The option -v makes checkproc print out verbose messages. The same happens if pidofproc LSB variant is used. This version also accepts also the base name only of a executable. Note that this disables the comparision of the inodes of the executable and the information found within the proc table (see proc(5)). REQUIRED
/full/path/to/executable or name_of_kernel_thread Specifies the executable which processes should be found, or alternatively, if the option Or alternated, if option -n is used, the name of the kernel thread. This argument is always required. OPTIONS
-k This option makes checkproc work like killproc(8) which changes the operation mode, e.g. the exit status of the program will be that of killproc(8). Without this option, checkproc works like startproc (8) and finds all processes with an executable that matches the specified pathname, even if a given pid file (see option -p) isn't up-to-date. Nevertheless it uses its own exit status (see section EXIT CODES). -L This option causes symlinks to be followed, as the like-named option in ls(1). Note: for the file name the original name of the program is used instead of the name of the symbolic link. -p pid_file Former option -f changed due to the LSB specification.) Use an alternate pid file instead of the default /var/run/<basename>.pid. If the option is specified and the pid_file does not exist, checkproc assumes that the daemon is not running. It is possible to use a process identity number instead of a pid file. -i ignore_file The pid found in this file is used as session id of the same binary program which should be ignored by checkproc. -c root Change root directory to root for services which have been started with this option by startproc(8). -n This option indicates that a kernel thread should be checked. In this case not the executable with its full path name is required but the name of the kernel thread. -N With this option the location of the executable is checked about NFS file system and if true the stat(2) system call is not applied on the exe symbolic link under /proc(5). Otherwise checkproc or pidofproc could be locked if the corresponding NFS server is cur- rently not online or available. This implies that the inode number check between the exectuable on the command line and the exectu- able of the exec symbolic link will be skipped. -q This option is ignored. -v Verbose output. -z This option causes checkproc to see processes even if they are in the zombie state. Without this option zombies are handled as not existent because such a process isn't alive but listed in the process table and waits on its parent process. EXAMPLE
checkproc /usr/sbin/sendmail returns all pids of running sendmail processes. checkproc -p /var/myrun/lpd.pid /usr/sbin/lpd returns the command line or the basename of the process pid found in /var/run/lpd.pid. EXIT CODES
The exit codes without the option -k have the following LSB conform conditions: 0 Program is running 1 No process but pid file found 3 No process and no pid file found 101 Wrong syntax on command line 102 Other errors If the option -k is used checkproc uses exit codes like startproc(8) or killproc(8) do: 0 Program is running 1 Generic or unspecified error 2 Invalid or excess argument(s) 4 Insufficient privilege(s) 5 Program is not installed 7 Program is not running in some cases a message is send to standard error or, if no standard error available, syslogd(8) is used. NOTE
checkproc together with the option -v just like pidof(8). The only difference is the usage of an available pid file. Only if no usable pid is given with a pid file the process table will be scanned. BUGS
Identifying a process based on the executable file and the corresponding inode number only works if the process stays alive during start- proc's execution. Processes rewriting their zeroth argument or shell scripts (the inode number of the shell executable file is not identi- cal to that of the script file) may not be identified by a filename path. FILES
/proc/ path to the proc file system (see proc(5)). /etc/init.d/ path to the SuSE boot concept script base directory as required by the Linux Standard Base Specification (LSB) (see init.d(7)). SEE ALSO
startproc(8), killproc(8), insserv(8), init.d(7), kill(1), skill(1), killall(8), killall5(8), signal(7), proc(5). COPYRIGHT
1994-2005 Werner Fink, 1996-2005 SuSE GmbH Nuernberg, Germany. AUTHOR
Werner Fink <werner@suse.de> 3rd Berkeley Distribution Nov 10, 2000 CHECKPROC(8)
All times are GMT -4. The time now is 11:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy