Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Jan 2019, 06:27
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Can I just delete a stale file handle?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 1327

PostPosted: Thu 03 Jan 2019, 18:59    Post subject:  Can I just delete a stale file handle?  

If I accidently start freenet as the wrong user, kill the process and try to re-start it as the correct user, it won't bind to the fproxy port due to a stale file handle.

In my example I set the fproxy port to 8889

For diagnostic purposes I deleted the busybox version of lsof and installed lsof from the package manager.

I can then type:
Code:

# /usr/bin/lsof -i :8889
COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
java       1443 spot   20u  IPv4 9957491      0t0  TCP localhost:8889 (LISTEN)
java       1443 spot   23u  IPv4 9962045      0t0  TCP localhost:8889->localhost:48948 (CLOSE_WAIT)
java       1443 spot   24u  IPv4 9963979      0t0  TCP localhost:8889->localhost:48949 (CLOSE_WAIT)
java       1443 spot   25u  IPv4 9965114      0t0  TCP localhost:8889->localhost:48952 (CLOSE_WAIT)
java       1443 spot   26u  IPv4 9968846      0t0  TCP localhost:8889->localhost:48971 (CLOSE_WAIT)
java       1443 spot   27u  IPv4 9974682      0t0  TCP localhost:8889->localhost:48978 (CLOSE_WAIT)
java       1443 spot   28u  IPv4 9981105      0t0  TCP localhost:8889->localhost:48994 (CLOSE_WAIT)
java       1443 spot   29u  IPv4 9984912      0t0  TCP localhost:8889->localhost:49009 (CLOSE_WAIT)
java       1443 spot   30u  IPv4 9986211      0t0  TCP localhost:8889->localhost:49010 (CLOSE_WAIT)
java       1443 spot   31u  IPv4 9991422      0t0  TCP localhost:8889->localhost:49053 (ESTABLISHED)
firefox-e 26692 root   72u  IPv4 9990734      0t0  TCP localhost:49053->localhos


If I try to [url="https://superuser.com/questions/307624/how-to-close-or-unbind-a-port-left-open-by-a-rogue-application"]kill the process tying up my port with fuser[/url] I get.

Code:

# fuser -k 1443/tcp
Cannot stat file /proc/1443/fd/7: Stale file handle
Cannot stat file /proc/1443/fd/18: Stale file handle


if I navigate to the difectory:
Code:

/proc/1443/fd/


I see the symlinks named 7 and 18 are broken. Can I just delete these two symlinks or will that mess somthing up?

Note that rebooting the computer solves the issue but I don't want to do that.
Back to top
View user's profile Send private message 
Peterm321

Joined: 29 Jan 2009
Posts: 398
Location: UK

PostPosted: Mon 14 Jan 2019, 13:04    Post subject:  

I cannot comment reliably on freenet itself (I don't use). I am getting similar stale file handle message when I UMOUNT for example a USB thumb drive.

I tend to ignore them as I am assuming stale file handles are orphaned entries which will not interfere with the system.

What I would say on killing processes is after determining the PID of the process I tend to prefer to send the process the HUP signal first in the hope that this is the cleanest way to tell a process to terminate gracefully. If HUP does not close it then perhaps SIGINT or SIGTERM and as a last resort SIGKILL, see

Code:
kill -l
for a list of signals.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1112s ][ Queries: 11 (0.0210s) ][ GZIP on ]