Squeezecenter 7 and Hardy Heron

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

[code lang=”bash”]
[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.

[code lang=”bash”]
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 :
/usr/sbin/cupsd (5726)
/usr/sbin/mysqld (5626)
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.

I guess I’m going to have to do a bit of reading on how apparmor work and try to fix it myself. I’ve had a look both the Ubuntu forum and the slimdevices forum, both with no luck so far.


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.

[code lang=”bash”]
# ——————————————————————
# 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.
# ——————————————————————
/var/lib/squeezecenter/cache/*/ r,
/var/lib/squeezecenter/cache/MySQL/ib_logfile? krw,
/var/lib/squeezecenter/cache/MySQL/ibdata1 krw,
/var/lib/squeezecenter/cache/MySQL/linux.lower-test w,
/var/lib/squeezecenter/cache/MySQL/mysql/* rw,
/var/lib/squeezecenter/cache/MySQL/slimserver/* rw,
/var/lib/squeezecenter/cache/my.cnf r,
/var/lib/squeezecenter/cache/mysql-error-log.txt rw,
/var/lib/squeezecenter/cache/squeezecenter-mysql.pid w,
/var/lib/squeezecenter/cache/squeezecenter-mysql.sock w,

Move the file “squeezecenter” (created above) to the correct directory and changed ownership of the file to root.

[code lang=”bash”]
sudo mv squeezecenter /etc/apparmor.d/abstractions
sudo chown root.root /etc/apparmor.d/abstractions/squeezecenter

Edit the MySQL apparmor file  “usr.sbin.mysqld”

[code lang=”bash”]
sudo nano /etc/apparmor.d/usr.sbin.mysqld

Added the following line

[code lang=”bash”]#include [/code]

Save the file and reload the apparmor demon.

[code lang=”bash”]
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.

3 thoughts on “Squeezecenter 7 and Hardy Heron

  1. Thanks for sharing. This nasty problem kept me busy too long.
    Looks like Logitec made a fix in the mean time which adds these apparmour MySQL rules to the existing usr.sbin.mysqld file. Unfortunately the created backup file (usr.sbin.mysqld.squeezecenter.orig) causes trouble again. Removing this file and restarting apparmour and SqueezeCenter got everything running fine finally.

  2. …another thanks for sharing. Just ran into the same problem after an update this AM and you saved me a lot of time.

  3. Thanks for this – due to the Logitech update all you have to do now is move (or delete) /etc/apparmor.d/usr.sbin.mysqld.squeezecenter.orig and restart apparmor and squeezecenter and it fires up first time 🙂

Leave a Reply