How to handle broken link after file deletion.in /proc//fd directory? The 2019 Stack Overflow Developer Survey Results Are InFile delete versus overwrite and link at /proc/pid/fdHow to determine how many files are within a directory without counting?Machine keeps backups of files that I have already deletedHow can a log program continue to log to a deleted file?Solaris 10 system - used disc space keeps on increasing even after deleting the directoryBroken files after moving them back and forthDeleted file being written to by running process, can I recreate it?Problem with system wide file handle countHow does the act of closing shared file descriptors with a write-blocked process cause it to unblock?Cannot pass argument through /proc/<pid>/fd/0
How did passengers keep warm on sail ships?
Is bread bad for ducks?
Currents/voltages graph for an electrical circuit
Deal with toxic manager when you can't quit
APIPA and LAN Broadcast Domain
Why doesn't UInt have a toDouble()?
Getting crown tickets for Statue of Liberty
Mathematics of imaging the black hole
Keeping a retro style to sci-fi spaceships?
Worn-tile Scrabble
What is the meaning of Triage in Cybersec world?
How to obtain a position of last non-zero element
If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?
Why isn't the black hole white?
Why “相同意思的词” is called “同义词” instead of "同意词"?
How to charge AirPods to keep battery healthy?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
What do hard-Brexiteers want with respect to the Irish border?
Ubuntu Server install with full GUI
Why are there uneven bright areas in this photo of black hole?
Does HR tell a hiring manager about salary negotiations?
Button changing its text & action. Good or terrible?
If I can cast sorceries at instant speed, can I use sorcery-speed activated abilities at instant speed?
How to type this arrow in math mode?
How to handle broken link after file deletion.in /proc//fd directory?
The 2019 Stack Overflow Developer Survey Results Are InFile delete versus overwrite and link at /proc/pid/fdHow to determine how many files are within a directory without counting?Machine keeps backups of files that I have already deletedHow can a log program continue to log to a deleted file?Solaris 10 system - used disc space keeps on increasing even after deleting the directoryBroken files after moving them back and forthDeleted file being written to by running process, can I recreate it?Problem with system wide file handle countHow does the act of closing shared file descriptors with a write-blocked process cause it to unblock?Cannot pass argument through /proc/<pid>/fd/0
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
A process is creating huge number of log files and also deleting it.
Many of those deleted files are having broken links in the /proc/pid/fd directory.
Do these file handles need to be closed by process? So that i shouldn't see the broken links.
I am calculating the number of file descriptors by using below command:
ls /proc/<pid>/fd | wc -l
files process limit file-descriptors
add a comment |
A process is creating huge number of log files and also deleting it.
Many of those deleted files are having broken links in the /proc/pid/fd directory.
Do these file handles need to be closed by process? So that i shouldn't see the broken links.
I am calculating the number of file descriptors by using below command:
ls /proc/<pid>/fd | wc -l
files process limit file-descriptors
What doesls -l /proc/$pid/fdshow? There shouldn't be broken links.
– ams
Mar 16 '16 at 15:04
add a comment |
A process is creating huge number of log files and also deleting it.
Many of those deleted files are having broken links in the /proc/pid/fd directory.
Do these file handles need to be closed by process? So that i shouldn't see the broken links.
I am calculating the number of file descriptors by using below command:
ls /proc/<pid>/fd | wc -l
files process limit file-descriptors
A process is creating huge number of log files and also deleting it.
Many of those deleted files are having broken links in the /proc/pid/fd directory.
Do these file handles need to be closed by process? So that i shouldn't see the broken links.
I am calculating the number of file descriptors by using below command:
ls /proc/<pid>/fd | wc -l
files process limit file-descriptors
files process limit file-descriptors
edited Mar 16 '16 at 15:35
Lucas
2,033818
2,033818
asked Mar 16 '16 at 14:34
Gaurav KSGaurav KS
3442613
3442613
What doesls -l /proc/$pid/fdshow? There shouldn't be broken links.
– ams
Mar 16 '16 at 15:04
add a comment |
What doesls -l /proc/$pid/fdshow? There shouldn't be broken links.
– ams
Mar 16 '16 at 15:04
What does
ls -l /proc/$pid/fd show? There shouldn't be broken links.– ams
Mar 16 '16 at 15:04
What does
ls -l /proc/$pid/fd show? There shouldn't be broken links.– ams
Mar 16 '16 at 15:04
add a comment |
1 Answer
1
active
oldest
votes
If a process has a file open and that file is deleted, the file appears as a broken link in /proc/PID/fd. That's perfectly normal. A broken link is not in itself an indication that something is wrong.
If a program is keeping a lot of files open but not doing anything with them, that might indicate a bug in the program. Keeping a deleted file open has some uses, but for a log file, it doesn't make any sense, so if those are indeed log files, there's probably a bug in the program. You'll have to contact the program's author to get it fixed (or do it yourself if you have the source).
There's no way to act on the process via /proc. You can attach a debugger to the process and make it close the files, but the results are not guaranteed. It's like removing the ladder under someone who's climbing onto a roof: they're likely to fall and get badly hurt. If you want to reclaim the disk space, you can truncate the files via /proc: the shell command : >/proc/PID/fd/NUMBER will do the trick. If the program keeps writing to the file, this will again start using disk space; a way to avoid that would be to use a debugger to cause the process to dup2 a file descriptor that's open to /dev/null, but we're back to results that are not guaranteed.
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f270211%2fhow-to-handle-broken-link-after-file-deletion-in-proc-pid-fd-directory%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If a process has a file open and that file is deleted, the file appears as a broken link in /proc/PID/fd. That's perfectly normal. A broken link is not in itself an indication that something is wrong.
If a program is keeping a lot of files open but not doing anything with them, that might indicate a bug in the program. Keeping a deleted file open has some uses, but for a log file, it doesn't make any sense, so if those are indeed log files, there's probably a bug in the program. You'll have to contact the program's author to get it fixed (or do it yourself if you have the source).
There's no way to act on the process via /proc. You can attach a debugger to the process and make it close the files, but the results are not guaranteed. It's like removing the ladder under someone who's climbing onto a roof: they're likely to fall and get badly hurt. If you want to reclaim the disk space, you can truncate the files via /proc: the shell command : >/proc/PID/fd/NUMBER will do the trick. If the program keeps writing to the file, this will again start using disk space; a way to avoid that would be to use a debugger to cause the process to dup2 a file descriptor that's open to /dev/null, but we're back to results that are not guaranteed.
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
add a comment |
If a process has a file open and that file is deleted, the file appears as a broken link in /proc/PID/fd. That's perfectly normal. A broken link is not in itself an indication that something is wrong.
If a program is keeping a lot of files open but not doing anything with them, that might indicate a bug in the program. Keeping a deleted file open has some uses, but for a log file, it doesn't make any sense, so if those are indeed log files, there's probably a bug in the program. You'll have to contact the program's author to get it fixed (or do it yourself if you have the source).
There's no way to act on the process via /proc. You can attach a debugger to the process and make it close the files, but the results are not guaranteed. It's like removing the ladder under someone who's climbing onto a roof: they're likely to fall and get badly hurt. If you want to reclaim the disk space, you can truncate the files via /proc: the shell command : >/proc/PID/fd/NUMBER will do the trick. If the program keeps writing to the file, this will again start using disk space; a way to avoid that would be to use a debugger to cause the process to dup2 a file descriptor that's open to /dev/null, but we're back to results that are not guaranteed.
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
add a comment |
If a process has a file open and that file is deleted, the file appears as a broken link in /proc/PID/fd. That's perfectly normal. A broken link is not in itself an indication that something is wrong.
If a program is keeping a lot of files open but not doing anything with them, that might indicate a bug in the program. Keeping a deleted file open has some uses, but for a log file, it doesn't make any sense, so if those are indeed log files, there's probably a bug in the program. You'll have to contact the program's author to get it fixed (or do it yourself if you have the source).
There's no way to act on the process via /proc. You can attach a debugger to the process and make it close the files, but the results are not guaranteed. It's like removing the ladder under someone who's climbing onto a roof: they're likely to fall and get badly hurt. If you want to reclaim the disk space, you can truncate the files via /proc: the shell command : >/proc/PID/fd/NUMBER will do the trick. If the program keeps writing to the file, this will again start using disk space; a way to avoid that would be to use a debugger to cause the process to dup2 a file descriptor that's open to /dev/null, but we're back to results that are not guaranteed.
If a process has a file open and that file is deleted, the file appears as a broken link in /proc/PID/fd. That's perfectly normal. A broken link is not in itself an indication that something is wrong.
If a program is keeping a lot of files open but not doing anything with them, that might indicate a bug in the program. Keeping a deleted file open has some uses, but for a log file, it doesn't make any sense, so if those are indeed log files, there's probably a bug in the program. You'll have to contact the program's author to get it fixed (or do it yourself if you have the source).
There's no way to act on the process via /proc. You can attach a debugger to the process and make it close the files, but the results are not guaranteed. It's like removing the ladder under someone who's climbing onto a roof: they're likely to fall and get badly hurt. If you want to reclaim the disk space, you can truncate the files via /proc: the shell command : >/proc/PID/fd/NUMBER will do the trick. If the program keeps writing to the file, this will again start using disk space; a way to avoid that would be to use a debugger to cause the process to dup2 a file descriptor that's open to /dev/null, but we're back to results that are not guaranteed.
answered Mar 17 '16 at 0:32
GillesGilles
547k13011131629
547k13011131629
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
add a comment |
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
Thanks a lot . I will ask program owner to handle open file handles/descriptors.
– Gaurav KS
Mar 19 '16 at 19:33
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
@GauravKS Good! If this solves your issue, please consider "accepting" the answer. This is the best way to show gratitude on this site. Accepting an answer not only marks the question as resolved, but also signals to future readers that the accepted answer actually solved the issue. More information about this is available here: unix.stackexchange.com/help/someone-answers
– Kusalananda♦
Apr 8 at 7:05
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f270211%2fhow-to-handle-broken-link-after-file-deletion-in-proc-pid-fd-directory%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does
ls -l /proc/$pid/fdshow? There shouldn't be broken links.– ams
Mar 16 '16 at 15:04