FC4 Startup Script

Everything related with getting rsyslog up and running (but not beyond that point ;))

Moderator: rgerhards

FC4 Startup Script

Postby MasterJ on Mon Jan 23, 2006 8:28 am

I have read the install document, which says if there is not script iunder my distro (linux), i should just copy and edit the stock syslog startup script and make the nessecarry minor modifications using the sample as a guide.

Problem is i am new to linux, and even though i managed to copy the stock syslogd script, i have no clue what mods to make.

Does anyone have a FC4 startup script for rsyslogd?

Many Thanks
MasterJ
New
 
Posts: 4
Joined: Mon Jan 23, 2006 8:20 am

Professional Services Information

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

RE: FC4 Startup Script

Postby mmeckelein on Tue Jan 31, 2006 3:43 pm

Hello,

I am not familiar with FC4, but I guess the stock syslog startup script should also work for rsyslog. What kind of error arises? You can use -n -d in order to run it interactively with enable debug output.

Michael
mmeckelein
Adiscon Support
 
Posts: 167
Joined: Wed Mar 12, 2003 12:07 pm

RE: FC4 Startup Script

Postby MasterJ on Sun Feb 05, 2006 10:28 pm

I do not get an error message as i have not tried to run the syslog script.
My understanding is that rsyslog is a different progrm all together, and there for needs it's own startup script which references the installed files.

The installation manual says to disable syslog, which i did.
Then says to copy the startup script from the distro folder...
The is no script for Fedora Core 4, under the distro Linux...
It goes on to say i can use the standard syslog script, but need to make the neccessary minor adjustments... I have no idea what adjustments to make and looking at the sample script... i just get more lost, which is why i am hoping someone has installed rsyslog on FC4 and could provide me with the script.
MasterJ
New
 
Posts: 4
Joined: Mon Jan 23, 2006 8:20 am

RE: FC4 Startup Script

Postby rgerhards on Mon Feb 06, 2006 7:51 am

I suggest that you do a "grep syslog *" in the directory where the startup scripts reside (e.g. /etc/init.d). That should bring up the script which is responsible. If you like, you can post it and I can make the necessary adjustments.

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

Postby MasterJ on Mon Feb 06, 2006 8:49 am

Many thanks for the assistance rgerhards.

/etc/init.d/syslog


#!/bin/bash
#
# syslog Starts syslogd/klogd.
#
#
# chkconfig: 2345 12 88
# description: Syslog is the facility by which many daemons use to log \
# messages to various system log files. It is a good idea to always \
# run syslog.
### BEGIN INIT INFO

# Provides: $syslog
### END INIT INFO

# Source function library.
. /etc/init.d/functions

[ -f /sbin/syslogd ] || exit 0
[ -f /sbin/klogd ] || exit 0

# Source config
if [ -f /etc/sysconfig/syslog ] ; then
. /etc/sysconfig/syslog
else
SYSLOGD_OPTIONS="-m 0"
KLOGD_OPTIONS="-2"
fi

RETVAL=0

umask 077

start() {
echo -n $"Starting system logger: "
daemon syslogd $SYSLOGD_OPTIONS
RETVAL=$?
echo
echo -n $"Starting kernel logger: "
daemon klogd $KLOGD_OPTIONS
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog
return $RETVAL
}
stop() {
echo -n $"Shutting down kernel logger: "
killproc klogd
echo
echo -n $"Shutting down system logger: "
killproc syslogd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/syslog
return $RETVAL
}
rhstatus() {
status syslogd
status klogd
}
restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
rhstatus
;;
restart|reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/syslog ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac

exit $?
MasterJ
New
 
Posts: 4
Joined: Mon Jan 23, 2006 8:20 am

Postby graycat on Wed Feb 08, 2006 6:18 pm

looks like i've got to the same point as you, mate. Would be interested if someone with RH/FC/CentOS experience could point the way here as i've stalled ..... again :) lol

Tim.
graycat
New
 
Posts: 4
Joined: Fri Nov 18, 2005 5:36 pm

Postby rgerhards on Thu Feb 09, 2006 3:43 pm

oops.. I overlooked the post with the script. Will modify it soon...

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

Postby rgerhards on Thu Feb 09, 2006 3:45 pm

Here we go:

Code: Select all
#!/bin/bash
#
# syslog Starts syslogd/klogd.
#
#
# chkconfig: 2345 12 88
# description: Syslog is the facility by which many daemons use to log \
# messages to various system log files. It is a good idea to always \
# run syslog.
### BEGIN INIT INFO

# Provides: $syslog
### END INIT INFO

# Source function library.
. /etc/init.d/functions

[ -f /sbin/rsyslogd ] || exit 0
[ -f /sbin/klogd ] || exit 0

# Source config
if [ -f /etc/sysconfig/syslog ] ; then
. /etc/sysconfig/syslog
else
RSYSLOGD_OPTIONS="-m 0"
KLOGD_OPTIONS="-2"
fi

RETVAL=0

umask 077

start() {
echo -n $"Starting system logger: "
daemon rsyslogd $RSYSLOGD_OPTIONS
RETVAL=$?
echo
echo -n $"Starting kernel logger: "
daemon klogd $KLOGD_OPTIONS
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog
return $RETVAL
}
stop() {
echo -n $"Shutting down kernel logger: "
killproc klogd
echo
echo -n $"Shutting down system logger: "
killproc rsyslogd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/syslog
return $RETVAL
}
rhstatus() {
status rsyslogd
status klogd
}
restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
rhstatus
;;
restart|reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/syslog ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac

exit $?

In essence, I have replaced every instance of "syslogd" by "rsyslogd". You still need klogd to run (something I am thinking about supporting natively in rsyslog). That script should work, but I have had no chance to test it (due to lack of test environment).

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

Postby MasterJ on Wed Feb 15, 2006 1:11 pm

Many Thanks for the scripted.
I did compare it to the standard syslog scripted and as you said, the only changes are syslog changed to rsyslog. Before i test it i was wondering about a few instances were syslog still exixts

# Source config
if [ -f /etc/sysconfig/syslog ] ; then

start() {
....
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog

stop() {
....
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/syslog

case "$1" in
....
condrestart)
[ -f /var/lock/subsys/syslog ] && restart || :

Should i just change these from syslog to rsyslog aswell ?

Many Thanks again.
I can't wait to get this up and running, i already have the PHPCon ready to go
MasterJ
New
 
Posts: 4
Joined: Mon Jan 23, 2006 8:20 am

Postby rgerhards on Wed Feb 15, 2006 2:22 pm

I have to admit that I do not know exactly what these lines do. I'd say give it a try and see if things start up.

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

Postby Kaizen on Fri Feb 17, 2006 4:32 pm

Hi,

I did it yesterday and wrote a small tutorial. ;-)
Check this http://www.rsyslog.com/PNphpBB2-viewtopic-t-57.phtml
Kaizen
New
 
Posts: 2
Joined: Fri Feb 17, 2006 4:08 pm

Postby rgerhards on Fri Feb 17, 2006 4:34 pm

Excellent :) I think I'll copy it to the official docs, so that this excellent tutorial also becomes part of the doc set!

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

Postby brentstewart on Sun Mar 05, 2006 5:59 am

Thanks for the excellent tutorial - just one quick note. It's proabably obvious to y'all, but I needed to make /etc/rc.d/init.d/rsyslog executable. Just wanted to capture this for this next guy! Again - thanks.
brentstewart
New
 
Posts: 1
Joined: Sun Mar 05, 2006 5:56 am

Google Ads



Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests

cron