~ourdelta-core/ourdelta/ourdelta-percona-d6-mysql50

« back to all changes in this revision

Viewing changes to bakery/debian-5.1/mysql-server-5.1.mysql-server.logrotate

  • Committer: Arjen Lentz
  • Date: 2008-10-23 12:36:56 UTC
  • mfrom: (30.2.14 ourdelta-cafuego)
  • Revision ID: arjen@openquery.com.au-20081023123656-82g0u0qb0uo3qrok
Get bakery (OurDelta build process) files into mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - I put everything in one block and added sharedscripts, so that mysql gets 
 
2
#   flush-logs'd only once.
 
3
#   Else the binary logs would automatically increase by n times every day.
 
4
# - The error log is obsolete, messages go to syslog now.
 
5
/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {
 
6
        daily
 
7
        rotate 7
 
8
        missingok
 
9
        create 640 mysql adm
 
10
        compress
 
11
        sharedscripts
 
12
        postrotate
 
13
                test -x /usr/bin/mysqladmin || exit 0
 
14
 
 
15
                # If this fails, check debian.conf! 
 
16
                export HOME=/etc/mysql/my.cnf
 
17
                MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
 
18
                if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
 
19
                  # Really no mysqld or rather a missing debian-sys-maint user?
 
20
                  # If this occurs and is not a error please report a bug.
 
21
                  if ps cax | grep -q mysqld; then
 
22
                    exit 1
 
23
                  fi 
 
24
                else
 
25
                  $MYADMIN flush-logs
 
26
                fi
 
27
        endscript
 
28
}