Current time: 11-27-2024, 10:12 PM Hello There, Guest! (LoginRegister)


Post Reply 
Automatischer neustart, wenn Apache down ist.
Author Message
MoritzDorn Offline
Junior Member
*

Posts: 178
Joined: Nov 2007
Reputation: 0
Post: #5
RE: Automatischer neustart, wenn Apache down ist.
Folgende Scripte werden ausgeführt:

man-db:
Quote:#!/bin/sh
#
# man-db cron weekly

set -e

if ! [ -d /var/cache/man ]; then
# Recover from deletion, per FHS.
mkdir -p /var/cache/man
chown man:root /var/cache/man
chmod 2755 /var/cache/man
fi

# regenerate man database
if [ -x /usr/bin/mandb ]; then
# --pidfile /dev/null so it always starts; mandb isn't really a daemon,
# but we want to start it like one.
start-stop-daemon --start --pidfile /dev/null \
--startas /usr/bin/mandb --oknodo --chuid man \
-- --quiet
fi

exit 0

rkhunter:
Quote:#!/bin/sh

RKHUNTER=/usr/bin/rkhunter

if [ ! -x $RKHUNTER ]; then
exit 0
fi

# source our config
. /etc/default/rkhunter

case "$CRON_DB_UPDATE" in
[Yy]*)
OUTFILE=`mktemp` || exit 1
if [ "$DB_UPDATE_EMAIL" = "no" ]
then
$RKHUNTER --versioncheck 1>/dev/null 2>$OUTFILE
$RKHUNTER --update 1>/dev/null 2>$OUTFILE
else
(
echo "Subject: [rkhunter] Weekly database update"
echo ""
$RKHUNTER --versioncheck
$RKHUNTER --update
) | /usr/sbin/sendmail $REPORT_EMAIL
fi
if [ $(stat -c %s $OUTFILE) -ne 0 ]; then
(
echo "Subject: [rkhunter] Weekly database update"
echo ""
cat $OUTFILE
) | /usr/sbin/sendmail $REPORT_EMAIL
fi
rm -f $OUTFILE
;;
*)
exit 0
;;
esac

sysklogd:
Quote:#! /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.10 2004-03-31 16:18:15 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
for LOG in `syslogd-listfiles --weekly`
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
02-25-2008 01:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Automatischer neustart, wenn Apache down ist. - MoritzDorn - 02-25-2008 01:31 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)