LinuxQuestions.org
Visit Jeremy's Blog.
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, 06: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, 06: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 09:15 AM
Script To Check Which Scripts Are Running runnerpaul Solaris / OpenSolaris 2 08-13-2008 04:53 AM
How can I check to see if a script is running? slick_willie Programming 13 03-16-2007 11:18 AM
script to check if the service is running eyt Linux - Newbie 2 02-16-2004 08:27 AM
[script] check for a running process mikshaw Linux - Software 2 01-13-2004 09:33 PM


All times are GMT -5. The time now is 04:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration