In /proc/pid/fd/
, there are too many file descriptors. Can I use shell command to close these file descriptors?
You can definitely close fd's of other running processes as long as you have the permissions to do so.
First, find the PID.
Then, start gdb and attach to the process:
gdb -p 1598
Then, call the close system call on the fd you want to close:
(gdb) call close(999)
$1 = 0
If the file descriptor was a leaked one, then the program will never try to use it again anyway, and it shouldn't cause any issues. The program most likely has a bug, however.