Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/intesco.ru/d59ed/
Upload File :
Current File : /var/www/iplanru/data/www/intesco.ru/d59ed/sysklogd.tar

etc/init.d/sysklogd000066600000005204150771261340010301 0ustar00#! /bin/sh
# /etc/init.d/sysklogd: start the system log daemon.

### BEGIN INIT INFO
# Provides:             sysklogd
# Required-Start:       $remote_fs $time
# Required-Stop:        $remote_fs $time
# Should-Start:         $network
# Should-Stop:          $network
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    System logger
### END INIT INFO

PATH=/bin:/usr/bin:/sbin:/usr/sbin

pidfile=/var/run/syslogd.pid
binpath=/sbin/syslogd

test -x $binpath || exit 0

test ! -r /etc/default/syslogd || . /etc/default/syslogd

. /lib/lsb/init-functions

create_xconsole()
{
    # Only proceed if /dev/xconsole is used at all
    if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
    then
	return
    fi

    if [ ! -e /dev/xconsole ]; then
	mknod -m 640 /dev/xconsole p
    else
	chmod 0640 /dev/xconsole
    fi
    chown root:adm /dev/xconsole
    test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
}

running()
{
    # No pidfile, probably no daemon present
    #
    if [ ! -f $pidfile ]
    then
	return 1
    fi

    pid=`cat $pidfile`

    # No pid, probably no daemon present
    #
    if [ -z "$pid" ]
    then
	return 1
    fi

    if [ ! -d /proc/$pid ]
    then
	return 1
    fi

    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`

    # No syslogd?
    #
    if [ "$cmd" != "$binpath" ]
    then
	return 1
    fi

    return 0
}

case "$1" in
  start)
    log_begin_msg "Starting system log daemon..."
    create_xconsole
    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
    log_end_msg $?
    test -d /lib/init/rw/sendsigs.omit.d || mkdir -p /lib/init/rw/sendsigs.omit.d
    test ! -f /lib/init/rw/sendsigs.omit.d/sysklogd || rm -f /lib/init/rw/sendsigs.omit.d/sysklogd
    ln -s $pidfile /lib/init/rw/sendsigs.omit.d/sysklogd
    ;;
  stop)
    log_begin_msg "Stopping system log daemon..."
    start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
    log_end_msg $?
    ;;
  reload|force-reload)
    log_begin_msg "Reloading system log daemon..."
    start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd
    log_end_msg $?
    ;;
  restart)
    log_begin_msg "Restarting system log daemon..."
    start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd
    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
    log_end_msg $?
    ;;
  reload-or-restart)
    if running
    then
	$0 reload
    else
	$0 start
    fi
    ;;
  *)
    log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}"
    exit 1
esac

exit 0
etc/cron.weekly/sysklogd000066600000002155150771477250011367 0ustar00#! /bin/sh

# sysklogd	Cron script to rotate system log files weekly.
#
#		If you want to rotate logfiles daily, edit
#		this script and /etc/cron.daily/sysklogd to get
#		the logfiles in sync (they must not occur in both
#		files).
#
#		This is a configration file.  You are invited to edit
#		it and maintain it on your own.  You'll have to do
#		that if you don't like the default policy
#		wrt. rotating logfiles (i.e. with large logfiles
#		weekly and daily rotation may interfere).  If you edit
#		this file and don't let dpkg upgrade it, you have full
#		control over it.  Please read the manpage to
#		syslogd-listfiles.
#
#		Written by Ian A. Murdock <imurdock@debian.org>.
#		$Id: cron.weekly,v 1.11 2007-05-28 16:33:34 joey Exp $

test -x /usr/sbin/syslogd-listfiles || exit 0
test -x /sbin/syslogd || exit 0
test -f /usr/share/sysklogd/dummy || exit 0

set -e

cd /var/log

logs=$(syslogd-listfiles --weekly)

test -n "$logs" || exit 0

for LOG in $logs
do
   if [ -s $LOG ]; then
      savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null
   fi
done

# Restart syslogd
#
/etc/init.d/sysklogd reload-or-restart > /dev/null
dummy000066600000000325150772047130005634 0ustar00Do not remove this file or your log files won't be rotated anymore.
This is a control file to ensure that the sysklogd package is
installed so that the cronjobs don't have to parse the dpkg database
for each run.