LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2011, 07:22 PM   #1
MikeP1990
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
klogd wont start on VPS


I'm trying to get klogd to work on my VPS but I'm having some issues with it. I have searched around but haven't been able to fix it...

syslog configuration

Code:
#!/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

RETVAL=0

start() {
	[ -x /sbin/syslogd ] || exit 5
	[ -x /sbin/klogd ] || exit 5

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

	if [ -z "$SYSLOG_UMASK" ] ; then
	      SYSLOG_UMASK=077;
	fi
	umask $SYSLOG_UMASK
 	echo -n $"Starting system logger: "
	daemon syslogd $SYSLOGD_OPTIONS
	RETVAL=$?
	echo
	echo -n $"Starting kernel logger: "
	#passed klogd skipped daemon klogd $KLOGD_OPTIONS
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog
	return $RETVAL
}	
stop() {
	echo -n $"Shutting down kernel logger: "
	#passed klogd skipped 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
}	
reload()  {
    RETVAL=1
    syslog=`cat /var/run/syslogd.pid 2>/dev/null`
    echo -n "Reloading syslogd..."
    if [ -n "${syslog}" ] && [ -e /proc/"${syslog}" ]; then
	kill -HUP "$syslog";
	RETVAL=$?
    fi
    if [ $RETVAL -ne 0 ]; then
	failure
    else
	success
    fi
    echo
    RETVAL=1
    echo -n "Reloading klogd..."
    klog=`cat /var/run/klogd.pid 2>/dev/null`
    if [ -n "${klog}" ] && [ -e /proc/"${klog}" ]; then
	kill -USR2 "$klog";
        RETVAL=$?
    fi
    if [ $RETVAL -ne 0 ]; then
	failure
    else
	success
    fi
    echo    
    return $RETVAL
}
case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  status)
  	rhstatus
	;;
  restart)
  	restart
	;;
  reload)
	reload
	;;
  condrestart)
  	[ -f /var/lock/subsys/syslog ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
	exit 2
esac

exit $?
This is what I get when I try restarting syslog

Code:
root@orbit [~]# service syslog restart
Shutting down kernel logger:
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
Starting kernel logger:
Can anyone advise as to how I can fix this?

Operating System is CentOS 5.5.

Thanks.

Last edited by MikeP1990; 02-01-2011 at 07:24 PM.
 
Old 02-02-2011, 04:43 PM   #2
goodhombre
Member
 
Registered: Mar 2010
Location: Ungheni, Rep. Moldova
Distribution: Ubuntu
Posts: 89

Rep: Reputation: 22
hi,

try to replace
Code:
#passed klogd skipped daemon klogd $KLOGD_OPTIONS
line with
Code:
daemon klogd $KLOGD_OPTIONS
in /etc/init.d/syslog
 
Old 02-02-2011, 04:47 PM   #3
MikeP1990
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Original Poster
Rep: Reputation: 0
I feel stupid now lol... Thanks, it worked a treat!
 
  


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
Unable to Start X in Centos - VPS - SSH mselvaprakash Linux - General 1 10-19-2010 07:40 AM
klogd won't start pobbz Debian 5 08-24-2007 05:37 AM
Xvnc will not start (CentOS vps) WojtekO Linux - Software 1 11-09-2006 05:51 PM
Where can I download UML VPS or Xen VPS to make a virtual private server? abefroman Linux - Software 3 12-09-2005 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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