LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-23-2005, 09:21 AM   #1
Pastorino
Member
 
Registered: Jul 2004
Distribution: RHEL 6.2
Posts: 35

Rep: Reputation: 17
How to create a service that monitors a file


Hi everyone,

I would like to create a service that monitors a file.

For example, the service would monitor the /var/log/messages file, waiting for a line that contains the word "sshd". When it finds it, it takes a certain action.

Can anyone help me?

Thanks!
 
Old 09-23-2005, 11:22 AM   #2
BoozerBill
LQ Newbie
 
Registered: Sep 2005
Location: UK
Distribution: Slack 10.1, Suse 9.3
Posts: 4

Rep: Reputation: 0
Perhaps swatch is what you're looking for? The homepage seems to be down but you should be able to find an RPM. Take a look at this page for more information.
Failing that a simple script would do the job nicely.
 
Old 09-23-2005, 08:29 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
The 'service' you refer to is called a daemon. You might want to look up HOWTOs and Tutorials on writing daemons.
 
  


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
how to create service phoenix_fei Programming 2 07-13-2005 05:56 PM
Create header file for existing .c file hk_michael Programming 5 02-25-2005 06:26 PM
Red Hat XF386config File to support three monitors kboggs Linux - Hardware 0 03-10-2004 08:59 AM
File monitors concoran Linux - Software 5 04-21-2003 06:10 PM
Program that monitors file access like SNOOPDOS for the amiga The Jesus Linux - Software 0 10-25-2002 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:52 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