LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-14-2017, 03:23 AM   #1
fcbman
LQ Newbie
 
Registered: Aug 2014
Posts: 15

Rep: Reputation: Disabled
delete process symbolic links


Hi,
We are using an application that has a defect and it is creating tons of files under the tmp dir.
We can delete the files, but the problem is that the process still has symbolic links to those files (under /proc/<pid>/fd and once deleted it is mentioned (deleted)).
This is causing a huge amount of symbolic links and eventually it reaches the system limitations.

Is there any way to delete those links? rm or unlink gives operation not permitted and we are pretty stuck with it.

Any work around is appreciated!

Thanks,
fcbman
 
Old 03-14-2017, 03:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
yes, duplicate post. you need to stop/kill that process.
 
Old 03-14-2017, 04:27 AM   #3
fcbman
LQ Newbie
 
Registered: Aug 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
sorry for the dup post as I was not sure if this is newbie or not...
Is there any other way to solve it without killing the process?

Thanks,
fcbman
 
Old 03-14-2017, 04:38 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
if that process is able to "drop" those files. Can you modify that application?
 
Old 03-14-2017, 07:16 AM   #5
fcbman
LQ Newbie
 
Registered: Aug 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
This is IBM product and the defect is in axis2 code.
Hence I dont have a way to change it...

not sure what you mean by "drop"... those are .mar files that are not needed for anything.
I deleted them under the /tmp, but it doesnt remove the symbolic link in the /proc/<pid>fd
 
Old 03-14-2017, 07:34 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
this is not a defect, this is how it works by design. A file is opened/accessed by processes and will be removed only when no process uses it any more _and_ it was deleted from the filesystem completely, including all the (possible) hard links.
In your case the process keeps the file open, so you can only really remove that file if the process already exited.
If you can force the process to close those files (without exiting) you can remove them without killing the process, but we do not know that process so we will not be able to tell you if that process works that way.
 
Old 03-14-2017, 08:00 AM   #7
fcbman
LQ Newbie
 
Registered: Aug 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
It is a defect. a known one:
https://www.google.pl/?gfe_rd=cr&ei=...=/tmp/_axis2&*
the problem is that it is not resolved yet and we have 50K files opened...
 
Old 03-14-2017, 08:23 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
this is not a problem of the filesystem and/or OS. This can be solved only by modifying (patching) that application, there is no other way.
 
Old 03-15-2017, 02:36 AM   #9
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,790

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
As a workaround regularly (daily or hourly) clean the /tmp files that are older than 1 day.
The symlinks in /proc/ are not real i.e. only occupy some bytes in memory.
The number is limited, see max files in /proc/<pid>/limits.
 
Old 03-15-2017, 08:29 AM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by MadeInGermany View Post
As a workaround regularly (daily or hourly) clean the /tmp files that are older than 1 day.
The symlinks in /proc/ are not real i.e. only occupy some bytes in memory.
You can remove the directory entries in /tmp, but the files will continue to occupy space until the process closes them.
 
Old 03-15-2017, 02:25 PM   #11
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Do you have access to the code that does like in the bottom post here?
http://stackoverflow.com/questions/8...out-restarting

Temp files are created whenever a new ConfigurationContext is created.
So create a ConfigurationContext **only once in a static block**
and use it in all the subsequent calls.

IF the application is dynamically linked, attach a debugger to it and make it call close(fd)
http://unix.stackexchange.com/questi...e-been-deleted

Last edited by !!!; 03-15-2017 at 03:48 PM.
 
1 members found this post helpful.
Old 03-16-2017, 08:51 PM   #12
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
well, write a script that deletes old links ? that runs on a clock and doesn't delete too many ?

BUT YES THERE IS ANOTHER ANSWER

#1 use a linux or BSD variant that compiles the World (from scratch), so you have "working" (not stale obstructive) source code for your whole system

#2 build World or LFS and all your software, excepting ones you can't (axis2 ?)

You now you have the bull by the balls.

You can insert a kernel code trap that does whatever you please when a process by that name runs, your path to compatibility is sure.

my "quick browse" of the situation suggests AXIS2 is an apache module that is not supported or made by IBM

else i'd say: hey call IBM they have good techs and stand behind their products !

Last edited by X-LFS-2010; 03-16-2017 at 08:54 PM.
 
  


Reply



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
symbolic links _Linux_Learner Linux - Newbie 2 02-26-2010 03:39 PM
Symbolic links Vs Hard links sulekha Linux - General 2 10-02-2008 07:03 AM
cp and symbolic links? sausagejohnson Linux - General 3 07-19-2005 01:25 AM
Symbolic Links petercool Linux - General 2 08-20-2003 11:15 AM
Symbolic links bkmesenbrink Linux - Newbie 2 11-13-2002 11:54 AM

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

All times are GMT -5. The time now is 01:32 AM.

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