Bugzilla – Bug 17818
logitechmediaserver breaks apparmor in Ubuntu
Last modified: 2012-02-15 02:53:28 UTC
Installing LMS 7.7.1 in Ubuntu causes some odd changes to be committed to an apparmor file, breaking mysqld updates from upstream. Is that post-install script still needed, as, I understand, MySQL is not even used anymore?
Created attachment 7584 [details] A patch proposed by user "uplink" on forums
I can confirm that this does indeed happen. If you attempt to install LMS 7.7.1 (or indeed SBS 7.6.1) on an Ubuntu system where MySQL is already installed, then the AppArmor file for MySQL gets corrupted. Since these later versions of SBS/LMS don't even use MySQL, they certainly should not be messing about with any MySQL config files.
*** This bug has been confirmed by popular vote. ***
Why is this Bug still unassigned? This Bug is also in version 7.7.2~33761.
I found the actual problem. The problem is with the sed command in postinst: sed -e 's/}//' /etc/apparmor.d/usr.sbin.mysqld > /etc/apparmor.d/usr.sbin.mysqld.squeezeboxserver.new The idea is fine , but the implementation is not thought through. The idea is to remove the last sole } from the end of the file. The problem is it's not testing for a sole }, it's testing for a } in general and the apparmor config file contains a few: /{,var/}run/mysqld/mysqld.pid w, /{,var/}run/mysqld/mysqld.sock w, Which then become: /{,var/run/mysqld/mysqld.pid w, /{,var/run/mysqld/mysqld.sock w, Which is of course wrong. Fix the sed-line and the problem goes away. Regs, Jarkko
(In reply to comment #5) > I found the actual problem. The problem is with the sed command in postinst: > > sed -e 's/}//' /etc/apparmor.d/usr.sbin.mysqld > > /etc/apparmor.d/usr.sbin.mysqld.squeezeboxserver.new > If you or someone else is able to create a patch file, test it, and attach the patch file to this bug report we will probably get the solution corrected faster.
Fixing the sed command in post install is all very well, but I have to ask this: Since LMS now uses SQLite rather than MySQL, why is it touching any configuration files relating to MySQL?
(In reply to comment #7) > Fixing the sed command in post install is all very well, but I have to ask > this: > > Since LMS now uses SQLite rather than MySQL, why is it touching any > configuration files relating to MySQL? It shouldn't, so a patch that removes the code that touches apparmor MySQL related settings is probably also a good solution. I'm just saying that the chance of this bug being corrected is a lot higher if there is a tested patch attached to it.
Created attachment 7605 [details] remove mysql section from postinst file
I have added a patch file that removes the mysql section of the postinst script. I used this script in a new deb package based on the nightly build (logitechmediaserver_7.7.2~33765_all). It installed and is running fine. Problem fixed.
After a look in the actual nightly version, logitechmediaserver_7.7.2~33769_all.deb the bug is still in the postinst file! :-(
Bug is still present in 7.7.2~33774
The patch solves the problem. I checked out 7.7.1, modified the postinst to remove changing the apparmor config file, and built the package. The result installs and seems to run fine.
Just so someone at Logitech starts to clue into the severity of this bug: Logitech Media Server BREAKS OTHER SERVICES ON DEBIAN SYSTEMS!!! I.e., LMS screws up Mythbuntu and anything else that relies on MySQL. Commit the suggested change. Fix this.
== Auto-comment from SVN commit #33834 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33834 == Bug: 17818 Description: don't mess with the apparmor/mysql files. We don't use mysql any longer.
Please give the next nightly build (r33834 or later) another try. Thanks for your patches!
Thanks, Michael!
Looks good! Thanks Michael. E.