Verified Commit 65f0ff4d authored by Lukáš Karas's avatar Lukáš Karas Committed by Daniel Vrátil
Browse files

Akonadi server should not expect specific mysql server process name

On Kubuntu, Akonadi is using /usr/sbin/mysqld-akonadi as mysql server. It is symlink to /usr/sbin/mysqld, but in /proc filesystem it is named as mysqld-akonadi...

Akonadi should not expect specific executable name, but should evaluate it from mMysqldPath variable. Moreover, process names in /proc filesystem is trimmed to 15 characters on Linux.

Test Plan:
Stop Akonadi

Create symlink /usr/sbin/mysqld-akonadi to /usr/sbin/mysqld, start that process

/usr/sbin/mysqld-akonadi --defaults-file=$HOME/.local/share/akonadi/mysql.conf --datadir=$HOME/.local/share/akonadi/db_data/ --socket=/run/user/$UID/akonadi/mysql.socket --pid-file=/run/user/$UID/akonadi/

Update akonadi server configuration ~/.config/akonadi/akonadiserverrc :


Start akonadi

Akonadi server should re-use existing mysql server...

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: dvratil, kde-pim

Tags: #kde_pim

Differential Revision:
parent 44093161
......@@ -320,7 +320,10 @@ bool DbConfigMysql::startInternalServer()
const QList<QByteArray> stats = stat.split(' ');
if (stats.count() > 1) {
// Make sure the PID actually belongs to mysql process
if (stats[1] == "(mysqld)") {
// Linux trims executable name in /proc filesystem to 15 characters
const QString expectedProcName = QFileInfo(mMysqldPath).fileName().left(15);
if (QString::fromLatin1(stats[1]) == QString::fromLatin1("(%1)").arg(expectedProcName)) {
// Yup, our mysqld is actually running, so pretend we started the server
// and try to connect to it
qCWarning(AKONADISERVER_LOG) << "mysqld for Akonadi is already running, trying to connect to it.";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment