Bug 17818 - logitechmediaserver breaks apparmor in Ubuntu
: logitechmediaserver breaks apparmor in Ubuntu
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Debian
: 7.7.1
: PC Linux (other)
: -- major with 7 votes (vote)
: 7.7.2
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-15 08:48 UTC by e.bova
Modified: 2012-02-15 02:53 UTC (History)
2 users (show)

See Also:
Category: Bug


Attachments
A patch proposed by user "uplink" on forums (2.19 KB, patch)
2011-12-15 08:50 UTC, e.bova
Details | Diff
remove mysql section from postinst file (1.12 KB, patch)
2012-01-12 23:19 UTC, P
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description e.bova 2011-12-15 08:48:53 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?
Comment 1 e.bova 2011-12-15 08:50:29 UTC
Created attachment 7584 [details]
A patch proposed by user "uplink" on forums
Comment 2 Clive Backham 2011-12-21 06:31:30 UTC
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.
Comment 3 Marcus Meyer 2011-12-29 06:54:45 UTC
*** This bug has been confirmed by popular vote. ***
Comment 4 Marcus Meyer 2011-12-29 06:59:04 UTC
Why is this Bug still unassigned?
This Bug is also in version 7.7.2~33761.
Comment 5 jahonen 2012-01-08 05:37:02 UTC
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
Comment 6 Erland Isaksson 2012-01-08 05:56:19 UTC
(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.
Comment 7 Clive Backham 2012-01-08 07:04:14 UTC
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?
Comment 8 Erland Isaksson 2012-01-08 07:08:21 UTC
(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.
Comment 9 P 2012-01-12 23:19:07 UTC
Created attachment 7605 [details]
remove mysql section from postinst file
Comment 10 P 2012-01-12 23:21:58 UTC
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.
Comment 11 Marcus Meyer 2012-01-24 04:01:56 UTC
After a look in the actual nightly version, logitechmediaserver_7.7.2~33769_all.deb the bug is still in the postinst file! :-(
Comment 12 Marcus Meyer 2012-01-30 23:35:34 UTC
Bug is still present in 7.7.2~33774
Comment 13 Judd Rogers 2012-02-12 10:47:43 UTC
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.
Comment 14 Gordon Harris 2012-02-12 11:49:52 UTC
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.
Comment 15 SVN Bot 2012-02-14 04:37:51 UTC
 == 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.
Comment 16 Michael Herger 2012-02-14 04:38:22 UTC
Please give the next nightly build (r33834 or later) another try. Thanks for your patches!
Comment 17 Gordon Harris 2012-02-14 06:42:19 UTC
Thanks, Michael!
Comment 18 e.bova 2012-02-15 02:53:28 UTC
Looks good! Thanks Michael.

E.