# /etc/init.d/mysql start Authenticating root. Password: * Starting mysql ... stops not returning to prompt # ls -lZ /run | grep mysql drwxr-xr-x. 2 mysql root system_u:object_r:initrc_var_run_t 40 Jul 23 16:00 mysqld Reproducible: Always
From the label (initrc_var_run_t) I can imagine that the directory is created from the init script, but looking at dev-db/mysql/files/mysql.init I don't immediately see how this would be. Can you take a look and see where it is created?
Seems like you looked at wrong file % equery b /etc/init.d/mysql * Searching for /etc/init.d/mysql ... dev-db/mysql-init-scripts-2.0_pre1-r2 (/etc/init.d/mysql) anyway from /etc/init.d/mysql => MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}" .... local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1) local socket=$(get_config "${MY_CNF}" socket | tail -n1) .... start-stop-daemon \ ${DEBUG/*/"--verbose"} \ --start \ --exec "${basedir}"/sbin/mysqld \ --pidfile "${pidfile}" \ --background \ --wait ${startup_early_timeout} \ ${tmpnice} \ ${tmpionice} \ -- --defaults-file="${MY_CNF}" ${MY_ARGS} and /etc/mysql/my.cnf % cat /etc/mysql/my.cnf | grep pid-file pid-file = /var/run/mysqld/mysqld.pid % cat /etc/mysql/my.cnf | grep socket socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock # using "localhost" in connects uses sockets by default It seems to correspond with files I can find inside it # ls -Z /run/mysqld system_u:object_r:initrc_var_run_t mysqld.pid system_u:object_r:initrc_var_run_t mysqld.sock
Will be in rev16
Is in the 2.20120725-r1, now in hardened-dev overlay
There is still minor problem # /etc/init.d/mysql start Authenticating root. Password: * Starting mysql ... chown: changing ownership of ‘/var/run/mysqld’: Permission denied * Directory /var/run/mysqld for pidfile does not exist and cannot be created * ERROR: mysql failed to start Both in enforcing and permissive: Jul 30 18:58:03 lain kernel: [25498.604408] type=1400 audit(1343667483.272:119): avc: denied { setattr } for pid=12554 comm="chown" name="mysqld" dev="tmpfs" ino=2611792 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:mysqld_var_run_t tclass=dir After audit2allow everything works ok
Thanks, I'll add this privilege to it as well
r2 is now in hardened-dev overlay
In main tree, ~arch'ed (rev 5)
stabilized