LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2020, 08:59 PM   #1
L1P0
Member
 
Registered: Dec 2019
Posts: 33

Rep: Reputation: Disabled
Question Why is there filename "socket" in lsof output when I use nedit command?


I just want to know why there is a file "socket" open when I use nedit command..

Quote:
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

nedit 3979 mxoper 1w FIFO 0,7 696805771 pipe
nedit 3979 mxoper 2w FIFO 0,7 696805771 pipe
nedit 3979 user1 3u unix 0xa830e180 731194794 socket


Also, Why do the node numbers reach 700,000,000+ ? It is beyond the max number set as shown by df -i.

Details on my system:
Quote:
Linux 2.6.9-67.ELhugemem #1 SMP Fri Nov 16 13:04:12 EST 2007 i686 i686 i386 GNU/Linux
Quote:
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 59932672 510982 59421690 1% /
/dev/sda1 60240 52 60188 1% /boot
none 437711 1 437710 1% /dev/shm
ulimit -a output:
Quote:
time(cpu-seconds) unlimited
file(blocks) unlimited
coredump(blocks) 0
data(kbytes) unlimited
stack(kbytes) 10240
lockedmem(kbytes) 32
memory(kbytes) unlimited
nofiles(descriptors) 2048
processes 55277
 
Old 03-03-2020, 12:24 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Because it opened a UNIX socket. Since nedit is a GUI program, this is not surprising. The socket could be used to communicate with the graphics server.

Sockets are not files, but inter-process communication channels. The offset 731194794 is probably the number of bytes that have been written to the socket so far. It's a large number, but again, if this is communication with the graphics server, not too surprising.

Last edited by berndbausch; 03-03-2020 at 12:26 AM. Reason: typo
 
Old 03-03-2020, 04:41 AM   #3
L1P0
Member
 
Registered: Dec 2019
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Because it opened a UNIX socket. Since nedit is a GUI program, this is not surprising. The socket could be used to communicate with the graphics server.

Sockets are not files, but inter-process communication channels. The offset 731194794 is probably the number of bytes that have been written to the socket so far. It's a large number, but again, if this is communication with the graphics server, not too surprising.
Thanks! About the node numbers.. I have experimented it. Tried to open a file with a 116-byte size using nedit. I grep the socket opened and it was 1451898. Then I close the nedit. Tried to open again the same file using nedit. But, this time, the node number was 1452642. It incremented!
 
Old 03-03-2020, 05:11 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
https://unix.stackexchange.com/quest...les-in-proc-fd and https://unix.stackexchange.com/quest.../190606#190606

that is not an inode number, but something like "device" number, it just identifies the socket itself.
 
Old 03-03-2020, 06:56 AM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by L1P0 View Post
I just want to know why there is a file "socket" open when I use nedit command..
NEdit can be a server and probably has this socket available (too?) for the
Quote:
nc - Client program for NEdit text editor
(from its man page)
Another quote from that man page
Quote:
If no server is running, nc will start one unless configured otherwise.
Client/server mode is useful for integrating NEdit with software development environments, mailers, and other programs; or just as a quick way to open files from the shell command line without starting a new NEdit session.
So yes, a socket is used for inter-program communication.

Because of a name conflict (with nc=netcat) I have renamed this "nc" to "nclient"
 
Old 03-03-2020, 08:26 AM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by L1P0 View Post
Thanks! About the node numbers.. I have experimented it. Tried to open a file with a 116-byte size using nedit. I grep the socket opened and it was 1451898. Then I close the nedit. Tried to open again the same file using nedit. But, this time, the node number was 1452642. It incremented!
The numbers are not node numbers. They (look like they) are under the column "SIZE". Perhaps this would be clearer if you formatted the output as code.
 
  


Reply

Tags
linux, socket



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify UDP receive socket buffer size for an open socket (not at system level, but socket level) barz_83_LQ Linux - Networking 2 11-27-2017 07:56 PM
Connecting client socket to server socket only once in socket programming srinietrx Programming 5 08-20-2017 11:53 AM
Passwd command is showing "BAD PASSWORD:" as output but there was nothing after the colon, where there should be some reason output. yogesh95 Linux - Software 4 03-31-2016 07:50 AM
[SOLVED] "tail -n 1 filename" error while "head -n 1 filename" is ok? type8code0 Linux - Newbie 3 03-21-2011 06:10 AM
how to read lsof output command many file open by root ??? b-RAM Linux - Newbie 2 10-05-2009 02:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration