Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have MySQL installed in my development machine, where I just don't need any additional security measure.

I want to move MySQL Data files to another partition, which implies a lot of change in AppAmor config, that I don't want to do since it's too much work for a simple development machine and I really don't need it.

My question is: is it safe to remove AppArmor without any side-effects to the system?

Like I said, security in this case is not really a concern.

share|improve this question
    
Sorry but this is not the way to go. Apparmor is there for a reason. And it is not that difficult. (the change is -identical- to what you did in /etc/mysql/my.cnf). –  Rinzwind May 13 '13 at 9:00

2 Answers 2

up vote 1 down vote accepted

It would not be safe to remove AppArmor in the sense of the word. You would be disabling a security system designed to be in place for protecting you. So it would indeed make you less safe. What you want to know is: yes you can remove it without side-effects but lessen that system's security with it.

But the changes to apparmor are quite minimal, if you just want to move the MySQL DataDir to another partition. In addition I would recommend moving it to /srv/mysql and mount your partition either to /srv or to /srv/mysql for that reason (depending if you have other services on that box you want to put into /srv).

Reason behind is, that ubuntu states the /srv mountpoint/directory the place for your own (custom) service data to be deployed (srv stands for service. Should contain server specific services related data. For example, /srv/cvs contains CVS related data.)

The changes to apparmor are quite minimalistic:

vi /etc/apparmor.d/usr.sbin.mysqld and search for /var/lib/mysql and insert:

  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  # new location of datadir
  /srv/mysql/ r,
  /srv/mysql/** rwk,

That is enough to satisfy apparmor and you can leave it in place without needing to fiddle around with uninstalling it.

Hope that helps!

share|improve this answer
    
The answer helped, thanks –  Psicofrenia May 15 '13 at 10:14
    
Always a pleasure. –  JeGr May 15 '13 at 13:21

You can remove AppArmor without immediately killing the system. Nothing relies on it to function.

But it is there for a reason. If security really isn't a concern, that's fair enough, but if you're just doing it for a quick convenience, consider learning how to adapt the rules.

share|improve this answer
    
Ok, I'll look a little bit more on it. –  Psicofrenia May 13 '13 at 9:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.