Script to leak file handles


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script to leak file handles
# 1  
Old 03-01-2012
Script to leak file handles

This is a strange one.

We have an issue where our system is leaking SCTP file handles. There are people working on this and in the mean time we have a monitoring script that alarms when we need to perform actions to manually clear them. For testing purposes I want to write a script that purposfully leaks file handles and fast (leaks about 4000 in a few minutes). The problem is I have absolutely no idea how to do this or where to start and (surprisingly) it is not something people commonly want to do so the internet has not been helpful.

Does anyone know if it is possible to write a script (ksh Solaris) to leak file handles?
If so, would anyone be able to give me some pointers to get me started?

---------- Post updated at 06:07 PM ---------- Previous update was at 03:44 PM ----------

Just to let you know that I found it was easier to fake the output of netstat to make it look as if more file handles were in use than actually were, so I no longer need help with this. Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Linux

The Way Systemd Handles System Calls

Hi everyone, I have a question about the process management, and deep level system functionality of system calls between SystemD and SystemV? Does SystemD use the same system calls (fork(), exec(), bind() etc...) as SystemV? or Vice Versa? If they both use the same or very very similar sys... (2 Replies)
Discussion started by: Lost in Cyberia
2 Replies

2. UNIX for Advanced & Expert Users

sendmails works, but opens 43 file handles per email -> problem

I'm using Sendmail 8.13.8 on a CentOS 5.5 vServer (Virtuozzo). I'm using a loop in PHP to send a lot of HTML-mails via sendmail. Each mail is a mail with individual statistics for our users, so its not mass mailing, bcc is not an option. It all works fine, but when I take a closer look there... (2 Replies)
Discussion started by: ZX81
2 Replies

3. UNIX for Advanced & Expert Users

How UNIX/AIX handles a file deep down, say it's being read while another one tries to rename it?

Hi Thinkers, On AIX 5.3, we have a monitor program that reads the log file and searching for a certain string pattern that we define(say "transactionException"), if it sees it then it will raise an alert by sending an email. Because the log file XXX.log is rolling into XXX.log.0, XXX.log.1,... (2 Replies)
Discussion started by: TheGunMan
2 Replies

4. Shell Programming and Scripting

memory leak in igawk script

Hi, We are having igawk statement calling gawk function and processing a master file, each gawk function have rules and action. We are using associative array to keep the output of each rule and finally printing the associative array. We are seeing the memory is growing incrementally in TOP... (1 Reply)
Discussion started by: satvelucbe
1 Replies

5. Shell Programming and Scripting

Monitor open file handles used by a process

We have a process that is running out of file handles. Is there some command line way to determine this that we can include into a cron script? Please let me know JAK (3 Replies)
Discussion started by: jakSun8
3 Replies

6. Shell Programming and Scripting

How printf handles empty variables

See attached file that includes code, input and output. I am processing a colon delimited input file and building a ":" (colon) delimited output file. My printf statement prints contents of each of 20 variables and puts them into a record file. I am pushing out approximately 120 records. The... (2 Replies)
Discussion started by: Skyybugg
2 Replies

7. Shell Programming and Scripting

perl help with pipes and file handles (simple issue)

Hello, I have a program which opens a pipe for communication using file handle and forks 5 child processes. @waitlist = (1,2,3,4,5); foreach $item (@waitlist) { pipe *{$item},RETHAND; unless ($pid = fork()) { # Child process print RETHAND... (1 Reply)
Discussion started by: the_learner
1 Replies

8. Shell Programming and Scripting

SSH in batch mode and File-Handles in a loop

Hi all I try to execute SSH commands on several hosts in a while-loop. There seems to be a problem with file-handle, first cycle works correct but no other one will follow due to the while condition is false even that there are many more host entries (lines) in all_hosts.dat. ... (3 Replies)
Discussion started by: DaveCutler
3 Replies

9. UNIX for Advanced & Expert Users

File Handles

Hi, perhaps you can answer my question.....;) How can I check, how many file handles are used and how can i increase the value for maximum file handles??? (3 Replies)
Discussion started by: sjaeger
3 Replies
Login or Register to Ask a Question
alarm_handler(3erl)					     Erlang Module Definition					       alarm_handler(3erl)

NAME
alarm_handler - An Alarm Handling Process DESCRIPTION
The alarm handler process is a gen_event event manager process which receives alarms in the system. This process is not intended to be a complete alarm handler. It defines a place to which alarms can be sent. One simple event handler is installed in the alarm handler at start-up, but users are encouraged to write and install their own handlers. The simple event handler sends all alarms as info reports to the error logger, and saves all of them in a list which can be passed to a user defined event handler, which may be installed at a later stage. The list can grow large if many alarms are generated. So it is a good reason to install a better user defined handler. There are functions to set and clear alarms. The format of alarms are defined by the user. For example, an event handler for SNMP could be defined, together with an alarm MIB. The alarm handler is part of the SASL application. When writing new event handlers for the alarm handler, the following events must be handled: {set_alarm, {AlarmId, AlarmDescr}} : This event is generated by alarm_handler:set_alarm({AlarmId, AlarmDecsr}) . {clear_alarm, AlarmId} : This event is generated by alarm_handler:clear_alarm(AlarmId) . The default simple handler is called alarm_handler and it may be exchanged by calling gen_event:swap_handler/3 as gen_event:swap_han- dler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args}) . NewHandler:init({Args, {alarm_handler, Alarms}}) is called. Refer to gen_event(3erl) for further details. EXPORTS
clear_alarm(AlarmId) -> void() Types AlarmId = term() Clears all alarms with id AlarmId . get_alarms() -> [alarm()] Returns a list of all active alarms. This function can only be used when the simple handler is installed. set_alarm(alarm()) Types alarm() = {AlarmId, AlarmDescription} AlarmId = term() AlarmDescription = term() Sets an alarm with id AlarmId . This id is used at a later stage when the alarm is cleared. SEE ALSO
error_logger(3erl), gen_event(3erl) Ericsson AB sasl 2.1.9.3 alarm_handler(3erl)