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.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.
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.
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:
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 chown root.root /etc/apparmor.d/abstractions/squeezecenter
Edit the MySQL apparmor file ”usr.sbin.mysqld”
Added the following line
Save the file and reload the apparmor demon.
At that point (with luck) it should be up and running.
Here are some documents that helped me sort the problem.
- AppArmor Geeks – openSUSE
- Novell AppArmor – Quick Start
- Linux.com – Protect you applications with AppArmor
- Apparmor – Community Ubuntu Documentation
- Troubleshooting AppArmor
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.
…another thanks for sharing. Just ran into the same problem after an update this AM and you saved me a lot of time.
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