/srv/irclogs.ubuntu.com/2018/06/24/#ubuntu-server.txt

arooniyou're referring to /var/log/mysql/ error log?00:00
blackflowarooni: I guess so00:00
aroonibecause i dont see any entry there00:00
blackflowarooni: is any logging configured in my.cnf? and anyway, how exactly did you change the data dir?00:01
arooniwas folllowing https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-0400:04
blackflowarooni: so first things first, put the apparmor profile in complain mode, see if that fixes it.00:08
arooniim googlign that00:10
aroonii'm not sure how to use sudo aa-complain /path/to/bin/  that would be my path to mysql?00:11
blackflowarooni: aa-complain usr.sbin.mysqld00:11
arooniok thats done00:13
arooniwhere is the output of apparmor complaints its not in my mysql error log00:13
blackflowarooni: journal, syslog.  grep for "audit"00:14
blackflowanyway, if it's in complain mode, then it won't block. if that fixes mysqld starting up, then it means you have to adjust the profile properly.00:14
blackflowlooking at that DO article, I think the problem is that it didn't reload the modified profile. I'm not sure just "restarting" AppArmor will do that.00:15
blackflowI use apparmor_parser -r   directly00:15
aroonihttps://gist.github.com/d5a532fb94c3ff118d2056091e8936db doesnt it mean its allowing stuff?00:16
aroonitoday is the first ive ever heard of apparmor00:16
arooniim a bit of a linux noob; excuse the noobness00:16
blackflowyeah in complain mode it won't actually block, but will continue auditing. so, did that fix mysql service?00:19
aroonisadly no00:20
arooniERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)00:20
aroonigawd this is annoying and frustrating00:20
arooniit shouldnt be so damn hard just to move data directory00:20
blackflowarooni: so you rsynced the original data dir to another location, changed 'datadir' directive of mysqld.conf and restarted the service?00:22
blackflowarooni: check the new dir first. that rsync command looks wrong, no trailing slash on the source directory, it'd copy the directory over to the destination00:23
aroonii did arsync the original data00:23
aroonii changed datadir00:23
arooniin the config00:23
blackflowcheck the destination dir you supposedly moved the files to, if it's correct00:23
aroonithis was my rsync command  sudo rsync -av /var/lib/mysql data/00:23
blackflowarooni: right, and now you have .../data/mysql/...     right?00:24
aroonitheres 3.6 gig there00:24
arooniso it looks to be all there00:24
arooniblackflow: its in /home/arooni/.mysql/data/mysql00:24
blackflowand that exact path is what you put into "datadir" directive of mysqld.conf?00:25
blackflownot  /home/arooni/.mysql/data/  ?00:25
aroonithat was my thought too00:26
arooni90% of the time its a typo00:26
aroonimysql starts up just fine when its in the default directory00:26
blackflowright, missing trailing slash on the src dir00:26
arooniyou mean i screwed up my rsync?00:26
blackflowarooni: oh another thing... check that all path elements are accessible to the mysqld user00:26
aroonior my path in my.cnf00:26
aroonihttps://gist.github.com/c63b27eaa35edd92c099238ebcdd4bbb00:27
blackflowlet me put it this way.....   rsync  /path/a /path/b/    will create   /path/b/a/...       and    rsync /path/a/ /path/b/       will copy files under a/ to b/00:27
arooniblackflow: so maybe i should redo the rsync00:28
arooniwith full paths00:28
blackflowdoesn't matter, if this works for you. the question is only fi you want   /home/david/.mysql/data/<files here>    or   /home/david/.mysql/data/mysql/<files here>00:29
aroonii dont honestly care00:29
aroonii think the files are all there; im just not sure why mysql cant find them00:30
blackflowalso check that /home, /home/david and /home/david/.mysql   are accessible to the mysql user. those dirs are probably owned by david, so they ALL must have read and exec rights for "others"00:30
aroonii also need to eat dinner; but i get stubborn00:30
arooniahhh00:30
aroonithats a good point00:30
arooniso lets ask this question00:30
arooniwhats a better directory00:30
blackflowwhy did you even move it?00:30
aroonimaybe /home/mysql00:30
arooniblackflow: was trying to free up space on root partition00:30
arooninever again00:30
blackflowif I had to do that, I'd create /home/mysql-data   just for those files00:31
blackflowand make it owned by "mysql:mysql"00:31
aroonisee thats what a smart person would do00:31
aroonii always though that acls worked on linux like ; as long as the group/owner was there it didnt matter where it was00:31
aroonibut i think the problem here is00:31
aroonithe mysql user doesnt have access to /home/david let alone the sub dir its in00:32
blackflowno no, i tmatters, ALL path elements must be accessible00:32
arooniahhhhhhhhhhhhh ha00:32
arooniso that was the basic lack of knowledge i had00:32
aroonilets see if moving it to /home/msyql works better00:32
blackflowyeah the kernel is checking them top-down, one by one00:32
arooniblackflow: is there anyway to test to see if the mysql user could access manually00:33
aroonii guess running su mysql00:33
arooniand then seeing if i could navigate there?00:33
blackflowyeah that's one way00:33
arooniis there a better way00:34
blackflowI wouldn't know00:35
arooniwell00:35
aroonithat fixed it00:35
aroonithanks for the hand holding :)00:35
aroonihow do i turn off that apparmor complaining thing00:35
blackflowdon't forget to adjust the apparmor profile00:35
aroonii did :)00:35
blackflowaa-enforce usr.sbin.mysqld00:35
aroonican you explain it like i'm 5 what the point of apparmor is00:35
blackflowAA is mandatory access control (MAC). unlike traditional unix (discreet access control) with users, groups and rwx, in a MAC every SUBJECT (process) is checked for access (read, write, execute, create, ......) for any OBJECT (process, file, socket, ...) it wants to interact with.00:36
blackflowso you write policies that say:   proces X can READ path Y.  or process X can execute binary Y at path Z, ...00:37
blackflowit's a bit more complex, there's more than just filesystem paths involved, but that's the gist of it00:37
aroonimakes sense;  does all linux use that00:37
aroonior is it just ubuntu00:37
arooni*all linux distros00:38
blackflowubuntu takes extensive advantage of it. CentOS, Fedora, RHEL  use another MAC system called SELinux00:38
blackflowthat's pretty much it, I don't know if any other distro makes the effort to enable and provide some default profiles for a MAC like AA or SELinux00:38
blackflowat any rate, AppArmor is good. being MAC, your MySQL could get compromised and elevated to root, but root couldn't do anything that's not allowed by the profile.00:39
blackflowthat's the whole point of it. without it, if your mysqld became root, then it could access anything, because it's root, right?   MAC doesn't care about users or groups, only about explicit access declared in the profiles.00:40
blackflowor in other words, with a MAC profile, you render root unprivileged.00:40
arooniso they all have their apparmor equivalent00:44
arooniwhen you use MAC ; what is the abbreviation youre using00:44
blackflowMandatory Access Control00:44
aroonithat makes sense00:47
aroonias i learn more about linux; seems its pretty well thought out; and secure00:47
blackflowwell, it has tools and means to make your computing environment reasonably secure, but it's never absolute.00:48
=== minipini is now known as Guest39280
=== beatzz_ is now known as beatzz
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== daughertyh90 is now known as __holden__
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance
=== havenstance1 is now known as havenstance

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!