Attila Rajmund Nohl <attila.r.n...@gmail.com> wrote:
> Kiss Gabor <ki...@ssg.ki.iif.hu> írta, 2011.08.24.:
> [...]
>> Újraindít, logot rotál.
> 
> Nem lehet, hogy a logrotate csinálja?

Azt is a cron indítja.

Eddig egyébként ez volt a legjobb próbálkozás! :-)
Bele is néztem a /etc/logrotate.d/mysql file-ba, és kacagtam:

------------------------------------------------------------------
# This logname can be set in /etc/my.cnf
# by setting the variable "err-log"
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
# err-log=/var/lib/mysql/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret>
# user= root
#
# where "<secret>" is the password.
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !

/var/lib/mysql/mysqld.log {
         # create 600 mysql mysql
         notifempty
  daily
         rotate 3
         missingok
         compress
     postrotate
  # just if mysqld is really running
  if test -x /usr/bin/mysqladmin && \
     /usr/bin/mysqladmin ping &>/dev/null
  then
     /usr/bin/mysqladmin flush-logs
     ret=$?
     if test $ret -ne 0
     then
        echo "/etc/logrotate.d/mysql failed, probably because" >&2
        echo "the root acount is protected by password." >&2
        echo "See comments in /etc/logrotate.d/mysql on how to fix this" >&2
        exit $ret
     fi
  fi
     endscript
}
----------------------------------------------------------

Ugyanis _nincs_ /root/.my.cnf file. Tehát ez a script le sem futhat.
Máshol van "eldugva" a jelszó a jóisten és a kompatibilitás nagyobb
dicsöségére.
Tegnap egész nap azt kerestem. :-(

Ha volna fent valami inotify-ra épülő mechanizmus, pl. incrond,
akkor megtehetném, hogy a jelszavas file megnyitásával triggerelek
egy ps-t.

g
_________________________________________________
linux lista      -      linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux

válasz