Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Should a UNIX daemon process close open fds? Post 30570 by kunalashar on Thursday 24th of October 2002 01:30:30 AM
Old 10-24-2002
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 applications that want to use it.
However, the app server won't restart, because the daemon process is holding its parents' ports.
There is a debate as to whether its the app server's or the daemon's responsibility to close the file descriptors (say, using fcntl(...)).
Which process has the responsibility of closing the open file
descriptors?
Richard Steven, in his Advanced Unix programming book says that the daemon should do it, but the people who created the daemon say the Posix way is better.
Any takers?
Thanks in advance,
Kunal
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File status - open/close ??

Is there any commands in UNIX, like isopen(),isclose() to know whether a file has been opened for read/write purpose.? Thanks (3 Replies)
Discussion started by: Pal
3 Replies

2. Solaris

close open files before remove

Hi I have a script to remove log files when it reaches %70 usage in order to descending order of dates. But sometimes it happens to remove open - being processes files , so makes them unlinked from the directors and results them disappeared. How can I solve this problem , simple scenario I... (9 Replies)
Discussion started by: xramm
9 Replies

3. UNIX for Advanced & Expert Users

Number of open files (Dir's) how to close?

I am having a client/server application which will download files from server. If server has directories, it will create directories/sub directories and then download files. In this process, I observed that number of open files are more than 400 (which is approxmately same as number of dir/subdir... (1 Reply)
Discussion started by: satyam90
1 Replies

4. Windows & DOS: Issues & Discussions

Can DOS close an open file?

I'm trying to setup a cron job for my brother that goes out to the web and retrieves an excel file and overwrites the existing copy on his desktop. The problem I'm facing is I have to kill the process (excel.exe) if the file is open while the batch file runs, otherwise, it will create another copy... (2 Replies)
Discussion started by: quattro20v
2 Replies

5. 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

6. 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

7. IP Networking

Open/close of ports

Hi, I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing? I have commented out a port /etc/services, one application uses then when i use the telnet <hostname> <port_blocked> it shows connected..... (1 Reply)
Discussion started by: balamv
1 Replies

8. UNIX for Advanced & Expert Users

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 :) (11 Replies)
Discussion started by: nitj
11 Replies

9. Shell Programming and Scripting

Work with setsid to open a session and close it correctly

I would like to create the following script: run a python script with setsid python may or may not fail with exception check if all of the group processes were terminated correctly if not, kill the remaining processes How can I do that? Thanks a lot (3 Replies)
Discussion started by: ASF Studio
3 Replies

10. Shell Programming and Scripting

How to get value from a close and open parenthesis?

Hi Gurus, I have an input like the one below. What i wanted to achieved is to create a select statement based from that information INPUTInsert into table_name (col1,col2,col3,col4,col5,DATE1,DATE2,col6,col7,col8,col9,col10,col11) values (6752,14932156,24,'ALL','Staff',to_date('04/17/2017... (6 Replies)
Discussion started by: ernesto
6 Replies
vxiod(7)						 Miscellaneous Information Manual						  vxiod(7)

NAME
vxiod - Veritas Volume Manager I/O daemon process control device DESCRIPTION
The vxiod device in Veritas Volume Manager (VxVM) is used to control the number of volume I/O daemons active on the system. A process con- text is necessary to implement the plex consistency recovery and writeback error handling policies for multi-plex volumes, and for continu- ing normal I/O after a log write if the volume has logging enabled. It is also required for the plex recovery performed with a mirrored volume in the read/writeback mode. There are three aspects of I/O daemon operations: o General I/O o Error handling o Log handling I/O handling is achieved by an ioctl command that does not return, but instead calls the vxiod routine to wait for errors or I/O requests and process them. When an error occurs, if there are no I/O daemons active, the I/O simply turns into a failure on that plex. If a gen- eral I/O request is queued up when no daemons exist, then the I/O will hang forever until a daemon process is created. If I/O daemons are active, then the I/O is put on a work queue and the daemons are awakened. A daemon takes an error request and tries to read other plexes until a read succeeds or all plexes have been tried. Then, if the writeback facility is enabled, the daemon tries to write the good data to each plex that failed on the read. If the write is successful, the read error is nullified. An I/O request is handled in a similar manner. Logging is handled in a similar manner. An ioctl command, which does not return, is issued to create a daemon for each volume which has logging enabled. This daemon monitors two queues: one queue of I/O which was started while the log was busy (the ``log'' queue), and another queue of requests which have been logged and now need to be started (the ``ready'' queue). I/O requests are taken from the log queue when the log is no longer busy, and another log write is started. Completion of a log write results in all I/O requests which have just been logged being placed on the I/O daemon's ready queue where they are immediately started. One mechanism finds out how many I/O error daemons are running, and another mechanism allows a process to become an I/O daemon. Before a process becomes an I/O daemon, it should close all open files and detach from the controlling tty. An I/O or logging daemon cannot be killed except through an explicit ioctl. FILES
/dev/vx/iod vxiod control device SEE ALSO
vxiod(1M), ioctl(2) VxVM 5.0.31.1 24 Mar 2008 vxiod(7)
All times are GMT -4. The time now is 10:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy