Compare commits

...

4 Commits

Author SHA1 Message Date
Daniel Berteaud 6d99639d6d Spec file update 2014-06-26 06:53:38 +02:00
Daniel Berteaud 3c7d17a2e5 Define HOME so cron task works on EL6 2014-06-26 06:51:52 +02:00
Daniel Berteaud 432eaa8de8 update spec file 2013-05-15 09:38:00 +02:00
Daniel Berteaud e6b501d606 Only convert to InnoDB if not already done 2013-05-15 09:37:17 +02:00
3 changed files with 16 additions and 6 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
HOME=/root
LOG=$(/sbin/e-smith/db configuration getprop qpsmtpd Log2Sql || echo 'disabled')
if [ "$LOG" != "enabled" ]; then

View File

@ -5,6 +5,12 @@ my $pass = ${'qpsmtpd'}{'DbPassword'} || 'secret';
my $dbstruct = `rpm -qd smeserver-qpsmtpd-log2sql | grep smtp_log.sql`;
my $convertInnoDB = '';
foreach my $table qw(messages message_headers message_body rcpts){
$convertInnoDB .= "ALTER TABLE $table ENGINE=InnoDB;\n"
if (-e "/var/lib/mysql/$db/$table.MYD");
}
$OUT .= <<"END";
#! /bin/sh
if [ ! -d /var/lib/mysql/$db ]; then
@ -43,11 +49,7 @@ REPLACE INTO db (
FLUSH PRIVILEGES;
USE smtp_log;
ALTER TABLE messages ENGINE=InnoDB;
ALTER TABLE message_headers ENGINE=InnoDB;
ALTER TABLE message_body ENGINE=InnoDB;
ALTER TABLE rcpts ENGINE=InnoDB;
$convertInnoDB
EOF
END

View File

@ -1,4 +1,4 @@
%define version 0.1.6
%define version 0.1.8
%define release 1
%define name smeserver-qpsmtpd-log2sql
@ -23,6 +23,12 @@ Requires: perl(DBI)
Log every smtp transaction in a database
%changelog
* Thu Jun 26 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.8-1
- Define HOME in cron task so it works on EL6
* Wed May 15 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.7-1
- Only convert to InnoDB if not already done
* Mon Apr 22 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.6-1
- Fix a typo in MySQL template