LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2010, 01:21 PM   #1
Kraiser10
Member
 
Registered: Mar 2010
Posts: 52

Rep: Reputation: 15
Ulimit i need an explain


Code:
#!/bin/bash
ulimit -c unlimited
while true; do ./executeable; done
When i will write this in console it will run executeable file and it will generate report : core.pid after crash so i can gdb the report.
The application after crash will restart how can i prevent restarting the application after it's crash ?
 
Old 04-01-2010, 03:20 PM   #2
mikemcdonough
LQ Newbie
 
Registered: Jan 2005
Location: North Carolina
Distribution: FC4
Posts: 6

Rep: Reputation: 0
error code checking

Assuming the crash "executeable" will set the return code to something other then zero, you could test for it.
Code:
#!/bin/bash
ulimit -c unlimited
while true; do
 ./executeable
 if [ "$?" -gt 0 ]; then
  exit $?
 fi
done
 
Old 04-02-2010, 03:48 AM   #3
Kraiser10
Member
 
Registered: Mar 2010
Posts: 52

Original Poster
Rep: Reputation: 15
I have placed it to x.sh and then i wrote ./x.sh in screen and the result after crash ofc:
./x.sh: line 8: 3571 Segmentation fault (core dumped) ./executeable
Seems like this is working because it's not restarting the application .

Last edited by Kraiser10; 04-02-2010 at 03:58 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ulimit Serena Linux - Software 6 12-18-2014 12:04 AM
ulimit spivy66 Linux - General 6 01-11-2008 02:33 PM
ulimit introuble Linux - Security 1 07-22-2006 04:33 AM
ulimit -t juanbobo Linux - Security 3 06-10-2005 10:43 AM
ulimit -n evilrico Linux - Distributions 0 03-14-2003 05:23 PM


All times are GMT -5. The time now is 08:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration