Home Man
Search
Today's Posts
Register

The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

fork: Resource temporarily unavailable - What can I check ?

Tags
solaris

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 04-11-2007
fork: Resource temporarily unavailable - What can I check ?

Hi everybody,

I have an Unix box running Solaris and every day for 1 hour or 2 the box is stuck and I can only get this error message when trying to type a command :

bash-3.00$ vmstat 5
bash: fork: Resource temporarily unavailable


How can I trace what's is going wrong with this box ? Which commands are useful to run before and after the issue ?

Thanks a lot !

Fabien
# 2  
Old 04-11-2007
Sounds like you are running out of swap, try putting a cronjob in to run "df" very 5 minutes and append to a file, then after the next time it happens go back and see if usage of /tmp was growing.

Alternatively, do the same interactively and see if someone is writing to a file or files in /tmp and filling it.
# 3  
Old 04-11-2007
If you can't fork you can't run a command in a shell to see why it can't fork, as it needs to fork to create the process to run the command in.
# 4  
Old 04-11-2007
Quote:
Originally Posted by porter
If you can't fork you can't run a command in a shell to see why it can't fork, as it needs to fork to create the process to run the command in.
First, reborg suggested arranging for a command to run every five minutes which might show /tmp filling prior to being totally filled. And it is possible for a large process to be unable to fork while smaller processes have no problem. This is actually quite common. Finally, it is not exactly true that a shell must fork to run a command. A shell is programming language with lots of built in commands. Can't launch ls?
$ myls() { while [ $# -ne 0 ] ; do echo "$1" ; shift ; done ; }
$ myls /etc/s*
/etc/services
/etc/shells
/etc/syslog.conf
$
Can't launch cat?
$ mycat() { while IFS="" read l ; do echo "$l" ; done < $1 ; }
$ mycat /etc/shells
#
# This is a list of valid login shells (single rooted).
# Ftpd must see one of these shells as a user's login shell to connect.
#
/bin/sh
/bin/ksh
/bin/csh
/bin/tcsh
/usr/local/bin/bash
$
None of that needed a single fork provided I use ksh. I can conjure up limited versions of quite a few commands this way. And if I am desperate to diagnose a stalled OS before I cycle power, I have a final trick...I can run a single command by using exec...
exec df -k
A box that cannot fork can often exec.
# 5  
Old 04-12-2007
Quote:
Originally Posted by Perderabo
And it is possible for a large process to be unable to fork while smaller processes have no problem.
Quite right of course and as an extension, some bigger process might die because it runs out of memory, leaving enough room for applications with a smaller memory footprint to run quite happily.

Both of the suggestion I posted were to run prior to the problem happening. The cron to give a general idea of what was happening, or more simply to periodically run the commands before the problem happened which might in fact point out the exact cause before the problem happened for example some application or script writing a huge log file to /tmp.

Last edited by reborg; 04-12-2007 at 06:17 PM..
# 6  
Old 04-12-2007
nice, really nice

Perderabo,

You have any other functions in that neat bag of tricks? Those functions are really helpful.

-S
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Fork: Resource temporarily unavailable clx Shell Programming and Scripting 15 05-10-2013 05:26 AM
Fork resource unavailable error, max # filehandles open? aquinom85 UNIX for Dummies Questions & Answers 6 02-25-2013 11:00 AM
[ERROR:Resource temporarily unavailable!] Serial writing by termios library enaud Programming 10 10-25-2012 04:22 AM
Fork: Resource Temporarily Unavailable monstrousturtle UNIX for Dummies Questions & Answers 3 05-03-2012 02:46 PM
fork: Resource temporarily unavailable , server unexpectedly unavailable network connection taherahmed UNIX for Advanced & Expert Users 1 09-13-2011 03:57 PM
cannot set user id: Resource temporarily unavailable (not open file/open process related) Katahdin Red Hat 0 04-26-2010 02:57 PM
Resource temporarily unavailable Error In Socket kavinsivakumar UNIX for Dummies Questions & Answers 1 03-02-2010 07:56 AM
Mmap with fork : Resource unavaialable temporarily siddharoodh Solaris 0 07-11-2009 02:20 PM
Fork:resource unavailable samos UNIX for Advanced & Expert Users 5 04-19-2009 08:25 PM
sendto failing "resource temporarily unavailable" Naanu Solaris 6 03-16-2007 05:41 PM


All times are GMT -4. The time now is 02:12 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password