LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-20-2002, 05:56 PM   #1
Llwyd
LQ Newbie
 
Registered: Nov 2002
Distribution: Redhat 8.0
Posts: 12

Rep: Reputation: 0
cron script to verify application is running?


Is there a built in device to verify an application is running, and if it is not running, to spit out an error to syslog or better yet restart it? I have a business critical app that dropped on me the other night and didn't run over the weekend.

If there isn't a built in device can anyone point me in the right direction on how I would go about scripting something like this?

Thanks in advance,

L
 
Old 12-20-2002, 06:13 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
is something as basic as
Code:
if [ `pidof -s applicationnamehere` ]
then
  echo application is running already
else
  echo application not found, loading now
  applicationnamehere
fi
suitable?
 
Old 12-20-2002, 06:41 PM   #3
Llwyd
LQ Newbie
 
Registered: Nov 2002
Distribution: Redhat 8.0
Posts: 12

Original Poster
Rep: Reputation: 0
Hmm, thanks for the input, but I just stopped the app and ran the check and it still said it was running.
 
Old 12-20-2002, 06:49 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Lookup "monit" at Freshmeat. It can do different kind of checks, pids, ports, sockets.
 
Old 12-20-2002, 06:52 PM   #5
Llwyd
LQ Newbie
 
Registered: Nov 2002
Distribution: Redhat 8.0
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by unSpawn
Lookup "monit" at Freshmeat. It can do different kind of checks, pids, ports, sockets.
Looks perfect, thanks man.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron NOT running php script ??!! hendrixx Programming 1 01-19-2005 05:36 AM
script not running as a cron job sanjith11 Programming 5 11-23-2004 08:42 AM
cron error when running script? meeble Linux - Software 3 09-09-2004 05:00 PM
running a 'dcop' script from 'cron' dsunger Linux - Software 0 05-10-2004 01:17 AM
script not running correctly off cron wedgeworth Linux - Software 3 10-14-2003 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:31 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
Open Source Consulting | Domain Registration