This seems to be a reoccurring problem for me on each install that I forget about. The above solution sort of solves the problem, but I wonder if there is another way. At this point, Ubuntu 11.10 Oneiric, all you need is
sudo aa-complain usr.sbin.mysqld-akonadi
to get Aknoadi up an running. But let's analyze the problem.
Apparmor is an adminstration security utility that places restrictions on programs.
As Ubuntu is configured, the apparmor administrative utility enforces a security profile on /usr/sbin/mysqld-akonadi. This profile is in /etc/apparmor.d/usr.sbin.mysqld-akonadi", and it contains the following specification, which I've abbreviated here for the particular situation:
profile /usr/sbin/mysqld {
## [stuff snipped]
@{HOME}/.local/share/akonadi/** rwk,
}
I'm not sure, but I believe that "r" means "read", "w" means "write", and "k" means "mknod". This is saying that mysqld is allowed to create files and directories anywhere
under the user's aknoadi directory.
Where/usr/sbin/mysqld-akonadi is failing according to the /var/log/kern.log is :
Apr 11 14:14:42 adiron kernel: [572346.502653] type=1400 audit(1334168082.226:675): apparmor="ALLOWED" operation="mknod" parent=31088 profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/home/xxxxxx/.local/share/akonadi/db_data/adiron.lower-test" pid=31090 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
It is saying that it is failing exactly on the "mknod" call. Strange, since I think it's configured for it.
However, "man apparmor" contains the following lines:
"A confined process can not call mknod(2) to create character or block devices."
This restriction seems to be in place regardless of the specification in the specific profile. A "confined" process is one that is in "enforce" mode. Issuing the aforementioned "aa-complain" command "unconfines" the process and then it is allowed to create the sockets, only complaining about it, along with everything else it is allowed to do, increasing your logs.
It is unclear whether with this seemingly uncircumventable restriction of using "mknod" in creating the mysql sockets can be configured away on the akonadi side. In any case, those seem only to be "Warnings" in the Akonadi log, and it seems that the real Errors are from things like :
Apr 11 13:00:10 adiron kernel: [567875.200843] type=1400 audit(1334163610.926:57): apparmor="DENIED" operation="open" parent=15318 profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/home/xxxxx/.local/share/akonadi/db_data/ibdata1" pid=15320 comm="mysqld" requested_mask="rw" denied_mask="rw" fsuid=1000 ouid=1000
Apr 11 13:00:11 adiron kernel: [567875.355533] type=1400 audit(1334163611.078:58): apparmor="DENIED" operation="open" parent=15327 profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="//home/xxxxx/.local/share/akonadi/mysql.conf" pid=15329 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
of which Apparmor seems to be configured to allow. I'm at a loss on this one. However, switching the security OFF into complain mode makes it work. I guess you could just remove usr.sbin.mysql-akonadi from /etc/apparmor.d/ and that would be just as effective.
Best Answer
Ok I erased the content of ~/.kde/env/setlocale.sh, and it works!
Tkanks!!