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

[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.

][ 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"

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.
/usr/sbin/mysqld
/usr/sbin/cupsd
/usr/lib/cups/backend/cups-pdf
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:

sudo /etc/init.d/apparmor stop

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.

Update:

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.
#
# ——————————————————————
/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.

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

#include <abstractions/squeezecenter>

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.

About billy

Senior IT Technician working in Edinburgh, Scotland.
This entry was posted in Computing Tips, Linux, Personal and tagged , , , . Bookmark the permalink.

3 Responses to Squeezecenter 7 and Hardy Heron

  1. Corné says:

    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. Chip Hart says:

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

  3. Matt Brewster says:

    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

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>