I’ve just upgraded my home linux box to Ubuntu Hardy Heron, installed Squeezecenter 7.0 and now it doesn’t seem to be working. After a bit of digging about I noticed that the logs were giving me a bit of a clue.
I had a look at the squeezecenter log in /var/log/squeezecenter/server.log
[08-05-04 20:04:07.0065] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn’t connect to database: [Can’t connect to local MySQL server through socket ‘/var/lib/squeezecenter/cache/squeezecenter-mysql.sock’ (2)]
[08-05-04 20:04:07.0081] Slim::Schema::forceCommit (1363) Warning: Trying to commit transactions before DB is initialized!
2008-05-04 20:04:07 SqueezeCenter died. Restarting.
I also had a look at syslog and noticed the following error message.
[code lang=”bash”]][ 3999.550665] audit(1209925520.012:134): type=1503 operation=”inode_permission” requested_mask=”r::” denied_mask=”r::” name=”/var/lib/squeezecenter/cache/my.cnf” pid=8858 profile=”/usr/sbin/mysqld” namespace=”default”[/code]
Apparmor is now installed as default on Hardy Heron so I wanted to find out what is being protected, my guess is that it’s MySql that’s causing the problems for Squeezecenter.
billy@linux:/etc/apparmor$ sudo apparmor_status
apparmor module is loaded.
3 profiles are loaded.
3 profiles are in enforce mode.
0 profiles are in complain mode.
2 processes have profiles defined.
2 processes are in enforce mode :
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
One way of fixing it would be to turn apparmor off with the following:
[code lang=”bash”]sudo /etc/init.d/apparmor stop[/code]
Then you’ll find that squeezecenter will suddenly work, this of course is not the fix I would use from a security perspective.
Found a possible solution on bugs.slimdevices.com going to test it and see how things work out.
I created the following file in /etc/apparmor.d/abstractions and called it squeezecenter.
# Copyright (C) Billy Dickson 5/5/08
# Filename: /etc/apparmor.d/abstractions/squeezecenter
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
Move the file “squeezecenter” (created above) to the correct directory and changed ownership of the file to root.
sudo mv squeezecenter /etc/apparmor.d/abstractions
sudo chown root.root /etc/apparmor.d/abstractions/squeezecenter
Edit the MySQL apparmor file “usr.sbin.mysqld”
sudo nano /etc/apparmor.d/usr.sbin.mysqld
Added the following line
Save the file and reload the apparmor demon.
sudo /etc/init.d/apparmor reload
At that point (with luck) it should be up and running.
Here are some documents that helped me sort the problem.