LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-2008, 02:31 PM   #1
gatsby
Member
 
Registered: Jan 2006
Posts: 59

Rep: Reputation: 16
Problem when autostarting rsyslog


This is probably a pretty basic question, but I am trying to build an rsyslog server. I'm wondering how I can get this rsyslog service to automatically begin listening on a predefined TCP port at start-up.

I can get the rsyslog service to start up automatically without a problem or error message, but I'm unsure how to tell it to automatically listen on this TCP port. Only when I manually start the service with the command "rsyslogd -t514" can I then see the listener running on TCP 514 with nmap. Help?

Last edited by gatsby; 09-23-2008 at 02:38 PM.
 
Old 09-23-2008, 04:19 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please fill in your distribution information in your profile. It helps.

First thing is to find if your system starts daemons using SysV initscripts or BSD stylee. To find out where to add your setting, reading (grepping) the initialisation scripts for rsyslog will show if any additional configuration files get sourced for settings or if it's all in the initscript itself or if it's in the daemons own configuration file.
 
Old 09-24-2008, 07:30 AM   #3
gatsby
Member
 
Registered: Jan 2006
Posts: 59

Original Poster
Rep: Reputation: 16
Distro is Red Hat Enterprise Linux 5.

One thing I've tried is to add the "-t<port_number>" switch to the /etc/init.d/rsyslog script. When I start the rsyslog service with this new configuration though, an error results saying "binary operator expected".
 
Old 09-24-2008, 07:42 AM   #4
rgerhards
Member
 
Registered: Sep 2003
Distribution: Fedora/Debian
Posts: 50

Rep: Reputation: 15
I assume you use the package that comes with RHEL. That is a v2 rsyslog (that is important because v3 has different/additional syntax which you can not apply to v2 - v2 syntax is of course supported by v3 iif running in compatibility mode).

The -t switch is correct for v2. I unfortunately do not know where you must enter it, but I remember there was a shell variable that contained it. But I may be wrong...

HTH ... a bit
Rainer
 
Old 09-24-2008, 08:00 AM   #5
gatsby
Member
 
Registered: Jan 2006
Posts: 59

Original Poster
Rep: Reputation: 16
Yes, it is rsyslog 2.0.
 
Old 09-25-2008, 09:12 AM   #6
gatsby
Member
 
Registered: Jan 2006
Posts: 59

Original Poster
Rep: Reputation: 16
From the official documentation:

"The really important thing in rsyslogd configuration is that you must make it listen to tcp port 61514 (remember: this is where stunnel send the messages to). Thankfully, this is easy to achive: just add "-t 61514" to the rsyslogd startup options in your system startup script. After done so, start (or restart) rsyslogd."


Any thoughts?
 
Old 09-25-2008, 10:05 AM   #7
gatsby
Member
 
Registered: Jan 2006
Posts: 59

Original Poster
Rep: Reputation: 16
Found it. If you want rsyslog 2.0 to listen on a TCP port, you have to update the file /etc/sysconfig/rsyslog and add/modify the SYSLOGD_OPTIONS as follows:

SYSLOGD_OPTIONS="-m 0 -t<PORT_NUMBER>"

Note the lack of spaces between the -t switch and the port number paramter. Restart the service and you are good to go.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem I faced in using rsyslog prakash.akumalla Linux - Software 0 06-26-2008 03:13 AM
rsyslog issue re-iterated ... prakash.akumalla Linux - Newbie 1 06-26-2008 02:30 AM
SELinux blocks my changes in rsyslog.conf tbergfeld Linux - Newbie 1 06-17-2008 03:39 AM
rsyslog sometimes logs fqdn, sometimes just host name whysyn Linux - Software 3 06-03-2008 10:31 AM
anyone using rsyslog? slackamp Slackware 1 10-16-2007 09:55 PM

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

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