Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trigger execution of commands whenever number of file descriptors changes Post 302363076 by poweruser on Monday 19th of October 2009 10:32:49 AM
Old 10-19-2009
Thanks Jim for your suggestion. I will have a look at inotify() function and try to implement desired logic.

What I was trying to do was:
I have a program on Solaris 9 OS platform, which opens a particular file for order processing (simulation). Rate at which orders are placed is random. Higher the rate, more instances of file are opened.
Currently, FD softlimit is 256(and they say this limit cant be increased more than this value for Solaris 9).
Whenever open FDs increase more than 256, orders fail. So I want to monitor total number of file descriptors. I hope inotify() will serve the purpose (if there is Solaris equivalent for this). Smilie

Last edited by poweruser; 10-19-2009 at 11:38 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

File Descriptors

Hi, I have written a daemon process, to perform certain operations in the background. For this I have to close, the open file descriptors, Does anybody know how to find out the number of open file descriptors ? Thanks in Advance, Sheetal (2 Replies)
Discussion started by: s_chordia
2 Replies

2. UNIX for Advanced & Expert Users

File Descriptors

Hello all, A few questions on file descriptors ... scenario : Sun Ultra 30 with Sun OS 5.5.1 , E250 with Solaris 2.6 In one of my servers, the file descriptor status from the soft limit and hard limits are 64 and 1024 respectively for root user. Is the soft limit (64) represents the... (3 Replies)
Discussion started by: shibz
3 Replies

3. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies

4. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

5. UNIX for Advanced & Expert Users

multiple commands execution

Hi i have 3 sql scripts that need to be executed simultaneously, and independent of one another, how do i do that in Unix AIX 5.3 (1 Reply)
Discussion started by: yschd
1 Replies

6. Shell Programming and Scripting

Sequential execution of commands in ksh

I need to run few commands in a ksh script sequentially. Some of the commands are jobs submitted to the server and the consecutive commands are dependent on the completion of the jobs submitted to the server. It works if i separate the commands into different files like this #!/bin/ksh... (1 Reply)
Discussion started by: prashob123
1 Replies

7. Shell Programming and Scripting

Execution of Shell Commands

I have a question: Where would I put the Command line (of any command) so that it executes every time I log on? Where would I put it if I want it to execute every time I start a new shell? (5 Replies)
Discussion started by: Nabeel Nazir
5 Replies

8. Shell Programming and Scripting

Perl execution commands

I don't know to debug the program todaylive.pl program. plz someone let me know what are the commands I need to know to debug the perl programs to find out the error on it. (3 Replies)
Discussion started by: ramkumar15
3 Replies

9. Shell Programming and Scripting

Trigger the execution of a script on SFTP Disconnect

Hi Guys, I suspect what I'm trying to do isn't possible, but I'm hoping someone can either confirm this or point me in the right direction. We have a third-party application which transfers a collection of files to our SFTP server ( Ubuntu 12.04 with OpenSSH ) . Once the app disconnects, we... (13 Replies)
Discussion started by: jamesdrinkwater
13 Replies

10. Shell Programming and Scripting

Linux Commands needed for replacing variable number of spaces with a single , in a txt file

Hi I want to read a text file and replace various number of spaces between each string in to a single "," or any other character .Please let me know the command to do so. My input file is a txt file which is the output of a SQL table extract so it contains so many spaces between each column of the... (2 Replies)
Discussion started by: Hari Prasanth
2 Replies
INOTIFY_INIT(2) 					     Linux Programmer's Manual						   INOTIFY_INIT(2)

NAME
inotify_init, inotify_init1 - initialize an inotify instance SYNOPSIS
#include <sys/inotify.h> int inotify_init(void); int inotify_init1(int flags); DESCRIPTION
For an overview of the inotify API, see inotify(7). inotify_init() initializes a new inotify instance and returns a file descriptor associated with a new inotify event queue. If flags is 0, then inotify_init1() is the same as inotify_init(). The following values can be bitwise ORed in flags to obtain different behavior: IN_NONBLOCK Set the O_NONBLOCK file status flag on the new open file description. Using this flag saves extra calls to fcntl(2) to achieve the same result. IN_CLOEXEC Set the close-on-exec (FD_CLOEXEC) flag on the new file descriptor. See the description of the O_CLOEXEC flag in open(2) for reasons why this may be useful. RETURN VALUE
On success, these system calls return a new file descriptor. On error, -1 is returned, and errno is set to indicate the error. ERRORS
EINVAL (inotify_init1()) An invalid value was specified in flags. EMFILE The user limit on the total number of inotify instances has been reached. EMFILE The per-process limit on the number of open file descriptors has been reached. ENFILE The system-wide limit on the total number of open files has been reached. ENOMEM Insufficient kernel memory is available. VERSIONS
inotify_init() first appeared in Linux 2.6.13; library support was added to glibc in version 2.4. inotify_init1() was added in Linux 2.6.27; library support was added to glibc in version 2.9. CONFORMING TO
These system calls are Linux-specific. SEE ALSO
inotify_add_watch(2), inotify_rm_watch(2), inotify(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 INOTIFY_INIT(2)
All times are GMT -4. The time now is 11:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy