Close file descriptor without terminating process


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Close file descriptor without terminating process
# 1  
Old 06-27-2012
Close file descriptor without terminating process

Can any help me in finding the way to close opened file descriptor in Solaris ,without killing process. As accidently a file was removed which was opened by a process.

Much thanks in advance Smilie
# 2  
Old 06-28-2012
This is not possible.
# 3  
Old 06-28-2012
Okay. What is the real problem you are trying to solve? Generally terminating a process is not a big deal. What you are asking is unusual to say the least, so this makes me think the problem you have must have another solution.
# 4  
Old 06-28-2012
It could be possible to attach to the process with a debugger and then make it call close().
# 5  
Old 06-28-2012
AS I mentioned accidentally a file was removed and it was opened by a process. No I want to close that file descriptor which is been using that file.

---------- Post updated at 08:43 PM ---------- Previous update was at 08:06 PM ----------

Radoulv do you have the way how can i attach that process with debugger and close?
# 6  
Old 06-28-2012
Quote:
Originally Posted by nitj
Radoulv do you have the way how can i attach that process with debugger and close?
Nope, this is for Linux with gdb, don't know how to do it on Solaris ...
# 7  
Old 06-28-2012
Quote:
Originally Posted by jim mcnamara
Okay. What is the real problem you are trying to solve? Generally terminating a process is not a big deal. What you are asking is unusual to say the least, so this makes me think the problem you have must have another solution.
Quote:
Originally Posted by nitj
AS I mentioned accidentally a file was removed and it was opened by a process. No I want to close that file descriptor which is been using that file.
All you've done is repeat the same thing. You haven't explained why you can't terminate a process. Terminating a process isn't a big deal.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminating a process - is this code best practice?

Hi Folks - I am building a process to kill a list of services. Sometimes, there's a service that hangs therefore I need to add an additionla peice of code to kill all instances of a service if it exists. Here is that portion of code: echo... (10 Replies)
Discussion started by: SIMMS7400
10 Replies

2. UNIX for Advanced & Expert Users

Dup2 - for file descriptor opened by a different process

is it possible to duplicate file descriptors(opened by a different process) with the help of dup or dup2. the two process do not share parent child relationship as well. (2 Replies)
Discussion started by: replytoshishir
2 Replies

3. AIX

AIX6.1 Remove file descriptor from specified process

Hi, How to release file description area from specified process. Problem is that process started - open one file ( ~2GB ) - file has been removed - process still shown that file is used by process and can't release space on filesystem. It is not allowable to kill process !!! Regs,... (3 Replies)
Discussion started by: KrzysiekPi
3 Replies

4. Programming

when parent process close, how to close the child?

can someone provide an example, where if the parent process quits for any reason, then the child process will also close? (3 Replies)
Discussion started by: omega666
3 Replies

5. Shell Programming and Scripting

Usage of NOHUP - How to keep the child process running even if I close the Server connection

Hi. ! When I use the 'NOHUP' along with the '&', the process will be running in the background. Even when I attempt to close (Meaning 'EXIT') the session (say PUTTY in this case), it wont exit unless the process is completed. But, say when I forcefully terminate the session (SHUT DOWN the... (2 Replies)
Discussion started by: WinBarani
2 Replies

6. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

7. Shell Programming and Scripting

How can i terminating expect script without terminating SSH connection.

Hi all , i know i ask a lot of question but these are really hard to solve and important question. I send two scripts: expect.sh: #!/usr/local/bin/expect spawn ssh root@172.30.64.163 expect "login:" send "root\n" expect "password:" send "root\n^M" interact and son.sh: ... (2 Replies)
Discussion started by: fozay
2 Replies

8. UNIX for Dummies Questions & Answers

Terminating child script with terminating the parent script

Hi I was working on a shell script with randomly shows a page of text from a randomly selected topic .As soon as the page is displayed it callers a timer script which keeps on running indefinitely until the timer script is killed by the user. This is where I have the problem,if I press... (2 Replies)
Discussion started by: mervin2006
2 Replies

9. UNIX for Dummies Questions & Answers

File Descriptor Help

What is a file descriptor in Unix?? How to find a file descriptor of a file in Unix?? Does it have anything to do with the Inode numbers?? (3 Replies)
Discussion started by: rahulrathod
3 Replies

10. UNIX for Dummies Questions & Answers

Should a UNIX daemon process close open fds?

I have a UNIX daemon process that's been started by a parent process, an application server. The behavior of this daemon process is to inherit and use the app server's file descriptors (ports/sockets). When I shutdown the app server, the daemon continues to run, because there may be other... (1 Reply)
Discussion started by: kunalashar
1 Replies
Login or Register to Ask a Question