LinuxQuestions.org
Review your favorite Linux distribution.
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 06-23-2011, 05:24 AM   #1
praveenhari
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Rep: Reputation: 0
Script to check tomcat and Pgsql running or not


Hi,

I have Linux server with cent OS.I have installed tomacat6.0 and postgresSQL8.3 on it.The thing is i wanna know whether the tomcat and postgresSQL is running or not using the script.Help me please.
 
Old 06-23-2011, 05:39 AM   #2
ssrameez
Member
 
Registered: Oct 2006
Location: bangalore
Distribution: Fedora, Ubuntu, Debian, Redhat
Posts: 82

Rep: Reputation: 6
You can write a shell/perl script.

use the "ps -ef|grep '<process name>'|grep -v grep"
"ps -ef|grep '<process name>'|grep -v grep|wc -l" - this will give you the process count

based on that you can check whether a process is running or not.

Try out something and give the code here if you are still facing any issues.

we will give you suggestions to correct/improve.

--Rameez
 
  


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
[SOLVED] Help Running a Check in Bash Script Duo11 Linux - General 14 04-04-2011 08:15 AM
Script To Check Which Scripts Are Running runnerpaul Solaris / OpenSolaris 2 08-13-2008 03:53 AM
How can I check to see if a script is running? slick_willie Programming 13 03-16-2007 10:18 AM
script to check if the service is running eyt Linux - Newbie 2 02-16-2004 07:27 AM
[script] check for a running process mikshaw Linux - Software 2 01-13-2004 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:04 PM.

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