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 03-09-2014, 09:11 AM   #1
74razor
Member
 
Registered: Dec 2012
Posts: 39

Rep: Reputation: Disabled
How can I get snort to run as a daemon?


I've done searching but haven't found anything that works for me. The last thing I tried was putting this in my /etc/rc.d directory:

/usr/sbin/snort -d -h 192.168.1.0/24

That I found in the snort manual

I have snort working, I'm able to see traffic. I setup some rules to see if it's working and I see my alerts, so everything seems to be good on that end. I just can't get snort to run as a service.

Any help is appreciated.
 
Old 03-09-2014, 09:26 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,349

Rep: Reputation: Disabled
You could create a script containing that command and drop it in the right directory for the init system of your distribution to pick up. You could also just add the command to rc.local.

Which distribution are you running?
 
Old 03-10-2014, 07:28 AM   #3
74razor
Member
 
Registered: Dec 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
I am running CentOS 6.5. I did put that command in my rc.local, but it doesn't seem to be working. I ran a ps -aux, but I don't see snort listed. If I issue the command 'service snort status', it says snort is unrecognized.
 
Old 03-10-2014, 09:23 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,349

Rep: Reputation: Disabled
The service command doesn't actually check running processes. Instead, it looks for an init script with the name of the "service" in question in the /etc/init.d directory.

Putting the snort command in rc.local will ensure that it's started when the system boots (provided the command syntax is 100% correct), and the process should be visible in the process list (ps ax) after the next reboot, but the CentOS init system still won't recognize it as a "service". (There really is no such thing as a "service" in Linux, at least not like there is in Windows; it's just a distribution-specific term for a background process started by a certain kind of init system.)

You need to create or obtain what's called a "SysV Init Script" for snort. If you installed snort from an rpm package, I would have expected the package to contain such a script. Have you tried running chkconfig --list?
 
Old 03-10-2014, 10:20 AM   #5
74razor
Member
 
Registered: Dec 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Thank you for your time with this, I appreciate it.

The init thing makes sense, I should have tried snortd. I know that is in my init directory. I'll have to try that with the script I have in my rc.local. Should 'service snortd status' say that snort is running if I have it setup with the correct syntax?

'Have you tried running chkconfig --list'

I have not tried this command, but will see what it gives me.
 
  


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
snort daemon do0b Debian 7 05-28-2011 10:20 PM
Enable daemon to run with service daemon start,etc baddah Programming 6 12-02-2007 05:51 PM
Snort daemon havelino Linux - Security 3 02-03-2005 05:12 AM
reconfigure snort daemon startup script hari_seldon99 Linux - Security 1 05-18-2004 01:40 AM
I want to start Snort as a service/daemon Olusegun Linux - Software 3 10-15-2002 10:35 AM

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

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