System started Syslogd

xiaoxiao2021-03-06  53

#! / bin / bash

#

# syslog starts syslogd / klogd.

#

#

# chkconfig: 2345 12 88

# Description: syslog is the facility by Which MAemons Use to log /

# Messages to Various System Log Files. It is a good idea to always /

# Run syslog.

### Begin Init Info

# Province: $ ssylog

### 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] && revart ||:

;

*)

Echo $ "Usage: $ 0 {start | stop | status | restart | condrestart}"

EXIT 1

ESAC

EXIT $?

转载请注明原文地址:https://www.9cbs.com/read-115163.html

New Post(0)