Redhat/CentOS 4 init.d file

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

Redhat/CentOS 4 init.d file

Postby doug.hairfield » Thu Nov 06, 2008 5:29 pm

Does anyone have an init.d script for rsyslog for CentOS4? I have installed the latest version of rsyslog and have been trying to use one of the init.d files for Debian but I keep getting the following when I try to run /etc/init.d/rsyslogd start

/etc/rsyslog.conf: line 4: ModLoad: command not found
/etc/rsyslog.conf: line 5: imudp: command not found
/etc/rsyslog.conf: line 6: imtcp: command not found
/etc/rsyslog.conf: line 7: imuxsock: command not found
/etc/rsyslog.conf: line 8: imklog: command not found
/etc/rsyslog.conf: line 12: *.info: command not found
/etc/rsyslog.conf: line 12: mail.none: command not found
/etc/rsyslog.conf: line 12: authpriv.none: command not found
/etc/rsyslog.conf: line 12: cron.none: command not found
/etc/rsyslog.conf: line 15: authpriv.*: command not found
/etc/rsyslog.conf: line 18: mail.rc: command not found
/etc/rsyslog.conf: line 22: cron.d: command not found
/etc/rsyslog.conf: line 28: uucp,news.crit: command not found
/etc/rsyslog.conf: line 33: *.emerg: command not found
/etc/rsyslog.conf: line 34: *.alert: command not found
/etc/rsyslog.conf: line 35: *.crit: command not found
/etc/rsyslog.conf: line 36: local7.debug: command not found
/etc/init.d/rsyslog: line 85: log_daemon_msg: command not found
/etc/init.d/rsyslog: line 50: start-stop-daemon: command not found
/etc/init.d/rsyslog: line 92: log_end_msg: command not found
doug.hairfield
Avarage
 
Posts: 20
Joined: Wed Nov 05, 2008 4:28 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: Redhat/CentOS 4 init.d file

Postby prakash.akumalla » Fri Nov 07, 2008 6:13 am

Post your configuration file once.

Regards,
Prakash.
prakash.akumalla
Frequent Poster
 
Posts: 103
Joined: Thu Jun 26, 2008 2:37 pm

Re: Redhat/CentOS 4 init.d file

Postby rgerhards » Fri Nov 07, 2008 8:32 am

doug.hairfield wrote:Does anyone have an init.d script for rsyslog for CentOS4? I have installed the latest version of rsyslog and have been trying to use one of the init.d files for Debian but I keep getting the following when I try to run /etc/init.d/rsyslogd start

/etc/rsyslog.conf: line 4: ModLoad: command not found
/etc/rsyslog.conf: line 5: imudp: command not found
/etc/rsyslog.conf: line 6: imtcp: command not found
/etc/rsyslog.conf: line 7: imuxsock: command not found
/etc/rsyslog.conf: line 8: imklog: command not found
/etc/rsyslog.conf: line 12: *.info: command not found
/etc/rsyslog.conf: line 12: mail.none: command not found
/etc/rsyslog.conf: line 12: authpriv.none: command not found
/etc/rsyslog.conf: line 12: cron.none: command not found
/etc/rsyslog.conf: line 15: authpriv.*: command not found
/etc/rsyslog.conf: line 18: mail.rc: command not found
/etc/rsyslog.conf: line 22: cron.d: command not found
/etc/rsyslog.conf: line 28: uucp,news.crit: command not found
/etc/rsyslog.conf: line 33: *.emerg: command not found
/etc/rsyslog.conf: line 34: *.alert: command not found
/etc/rsyslog.conf: line 35: *.crit: command not found
/etc/rsyslog.conf: line 36: local7.debug: command not found
/etc/init.d/rsyslog: line 85: log_daemon_msg: command not found
/etc/init.d/rsyslog: line 50: start-stop-daemon: command not found
/etc/init.d/rsyslog: line 92: log_end_msg: command not found


This looks like you try to execute the config file itself... Can you post the exact steps (plus, as already said, the full config) of what you are doing?

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: Redhat/CentOS 4 init.d file

Postby vmix » Mon Nov 10, 2008 7:19 pm

I believe Rainer's correct. It appears that your init script is for some reason attempting to run the configuration file inline with the script. Here's my init script, which is pretty basic and is used on a couple hundred of our CentOS 4 servers. Hope this helps.

Dan
User avatar
vmix
Advanced
 
Posts: 35
Joined: Tue May 06, 2008 5:48 pm
Location: San Diego, CA

Re: Redhat/CentOS 4 init.d file

Postby doug.hairfield » Mon Nov 10, 2008 11:25 pm

yes, if I correct the path search for the config, line 28, file to just /etc/rsyslog.conf it tries to run instead of read my config file. I just modified the SYSLOGD_OPTIONS line to use my config file in /etc.

Oddly enough though, I get the following error now when I try to run the init script:
Starting system logger (rsyslog): execvp: No such file or directory

the only other change I have made to the file you posted was
start() {
[ -x /usr/local/sbin/rsyslogd ] || exit 5
since my binary is not in /usr/sbin
doug.hairfield
Avarage
 
Posts: 20
Joined: Wed Nov 05, 2008 4:28 pm

Re: Redhat/CentOS 4 init.d file

Postby doug.hairfield » Tue Nov 11, 2008 5:35 pm

So I figured it out. on line 37, the daemon rsyslog $SYSLOGD_OPTIONS is assuming that rsyslogd is in my path in /usr/local/sbin, which it is not. I just put the full path for rsyslogd in and it worked.

Thanks for the help.
doug.hairfield
Avarage
 
Posts: 20
Joined: Wed Nov 05, 2008 4:28 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron