1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2026-01-06 08:21:10 +03:00

MCOL-1184 - fixed non-root logrotate issue

This commit is contained in:
david hill
2018-02-05 14:36:16 -06:00
parent c792188a5f
commit b96124a60d
4 changed files with 14 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
#
# MariaDb Columnstore Log Rotate file that gets installed in /etc/logrotate.d
# as part of the RPM installation
# MariaDB ColumnStore Log Rotate file that gets installed in /etc/logrotate.d
# as part of the package installation
#
/var/log/mariadb/columnstore/*.log {
@@ -10,14 +10,7 @@
dateext
copytruncate
olddir /var/log/mariadb/columnstore/archive
}
/var/log/mariadb/columnstore/*.log1 {
missingok
rotate 7
daily
nocreate
compress
olddir /var/log/mariadb/columnstore/archive
su root root
}
/usr/local/mariadb/columnstore/etc/Columnstore.xml {
daily
@@ -32,4 +25,5 @@
dateext
copytruncate
olddir /usr/local/mariadb/columnstore/mysql/db
su root root
}

View File

@@ -230,10 +230,6 @@ if [ $user = "root" ]; then
fi
fi
#setup MariaDB Columnstore system logging
sed -i -e s/groupname/$user/g $installdir/bin/columnstoreSyslog7
sed -i -e s/username/$user/g $installdir/bin/columnstoreSyslog7
if [ $user = "root" ]; then
$installdir/bin/syslogSetup.sh install > /tmp/syslog_install.log 2>&1
rm -f /etc/default/columnstore
@@ -255,10 +251,6 @@ else
$SUDO chmod 666 /etc/fstab
fi
# install Columnstore Log Rotate File
$SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
$SUDO chmod 644 /etc/logrotate.d/columnstore
#check if MariaDB Columnstore system logging was setup
cat /tmp/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
if [ $? -eq 0 ]; then

View File

@@ -166,17 +166,21 @@ if [ ! -z "$syslog_conf" ] ; then
#set the syslog for ColumnStore logging
# remove older version incase it was installed by previous build
$SUDO rm -rf /etc/rsyslog.d/columnstore.conf
if [ $rsyslog7 == 1 ]; then
sed -i -e s/groupname/adm/g ${columnstoreSyslogFile7}
sed -i -e s/username/syslog/g ${columnstoreSyslogFile7}
$SUDO rm -f /etc/rsyslog.d/49-columnstore.conf
$SUDO cp ${columnstoreSyslogFile7} ${syslog_conf}
else
else
$SUDO cp ${columnstoreSyslogFile} ${syslog_conf}
fi
fi
if [ $rsyslog7 == 1 ]; then
$SUDO chown -R syslog:adm /var/log/mariadb/columnstore >/dev/null 2>&1
fi
# install Columnstore Log Rotate File
$SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
$SUDO chmod 644 /etc/logrotate.d/columnstore
restartSyslog
fi

View File

@@ -58,7 +58,7 @@ const int ArgNum = 10;
const int DescNumMax = 10;
const int cmdNum = 68;
const std::string DEFAULT_LOG_FILE = "/var/log/mariadb/columnstore/uiCommands.log";
const std::string DEFAULT_LOG_FILE = "/var/log/mariadb/columnstore/mcsadmin.log";
std::ofstream logFile;
/**