As far as I see none of the ebuilds for dev-db/mysql (in portage) brings a service file for running mysqld with the systemd-init-system. I suggest to have one added ... I run one for months now, copied and modified from arch linux ... today I modified it to also wait for mysqld to be really up and ready. If other services depend on mysqld.service it is important to not only have mysqld started but also check if it is ready to serve requests. The lack of this lead to problems with mythtv here after a reboot, for example. - I found service-files doing this: https://bbs.archlinux.org/viewtopic.php?pid=1100107 https://github.com/remicollet/remirepo/blob/master/mysql55/mysqld.service Both run a check-script as ExecStartPost. I adapted the script from the first link and tested successfully. # cat /etc/systemd/system/mysqld.service [Unit] Description=mySQL Server After=network.target [Service] ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf ExecStartPost=/usr/local/bin/mysqld-post ExecStop=/bin/kill -15 $MAINPID Restart=always Timeout=30 [Install] WantedBy=multi-user.target # cat /usr/local/bin/mysqld-post #!/bin/sh while true; do response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break echo "$response" | grep -q "mysqld is alive" && break sleep 1 done While this might not be the most elegant solution ... it just works for now. Please consider adding a service-unit for mysql soon ...
A systemd unit exists in mysql-init-scripts-2.0_pre1-r6 which is stable on all arches
(In reply to Brian Evans from comment #1) > A systemd unit exists in mysql-init-scripts-2.0_pre1-r6 which is stable on > all arches oops! how embarrassing ... sorry for the noise. looks as if it does everything needed ... and I always "masked" that unit with my selfmade file in /etc/systemd/system (seems as if mysql-init-scripts came later than my own file). will test asap. thanks
*mysql-init-scripts-2.0_pre1-r4 (03 Sep 2013) 03 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/mysql.conf, +files/mysqld-prepare-db-dir, +files/mysqld-wait-ready, +files/mysqld.service, +files/mysqld_at.service, +mysql-init-scripts-2.0_pre1-r4.ebuild: Add systemd support (#466084)
*** This bug has been marked as a duplicate of bug 466084 ***