From 2caa773538c1d27e10cb86e15d76c39c20339cf9 Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Feb 11 2016 12:52:17 +0000 Subject: Remove mariadb-wait-ready call from systemd unit, we have now systemd notify support Make mariadb@.service similar to mariadb.service --- diff --git a/mariadb.spec b/mariadb.spec index 4e93667..5e6a6d6 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -148,6 +148,7 @@ Source14: mysql-check-socket.sh Source15: mysql-scripts-common.sh Source16: mysql-check-upgrade.sh Source17: mysql-wait-stop.sh +Source18: mysql@.service.in Source19: mysql.init.in Source50: rh-skipped-tests-base.list Source51: rh-skipped-tests-arm.list @@ -545,9 +546,8 @@ cat %{SOURCE52} | tee -a mysql-test/rh-skipped-tests.list %endif cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ - %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE17} %{SOURCE19} \ + %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE17} %{SOURCE18} %{SOURCE19} \ scripts -cp %{SOURCE11} scripts/mysql@.service.in %build @@ -698,6 +698,7 @@ mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my. # install systemd unit files and scripts for handling server startup %if %{with init_systemd} install -D -p -m 644 scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service +install -D -p -m 644 scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf %if 0%{?mysqld_pid_dir:1} echo "d %{_localstatedir}/run/%{mysqld_pid_dir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf @@ -1206,6 +1207,8 @@ fi Resolves: #1279753 - Re-enable using libedit, which should be now fixed Related: #1201988 +- Remove mariadb-wait-ready call from systemd unit, we have now systemd notify support +- Make mariadb@.service similar to mariadb.service * Mon Feb 08 2016 Honza Horak - 1:10.1.11-4 - Use systemd unit file more compatible with upstream diff --git a/mysql.service.in b/mysql.service.in index 0f3e823..c385b4a 100644 --- a/mysql.service.in +++ b/mysql.service.in @@ -36,10 +36,10 @@ Group=mysql ExecStartPre=@libexecdir@/mysql-check-socket ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n +# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf # Note: we set --basedir to prevent probes that might trigger SELinux alarms, # per bug #547485 ExecStart=@libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER -ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID ExecStartPost=@libexecdir@/mysql-check-upgrade ExecStopPost=@libexecdir@/mysql-wait-stop diff --git a/mysql@.service.in b/mysql@.service.in new file mode 100644 index 0000000..ab9a7cd --- /dev/null +++ b/mysql@.service.in @@ -0,0 +1,77 @@ +# Multi instance version of mariadb. For if you run mutiple verions at once. +# Also used for @DAEMON_NAME@@bootstrap to bootstrap Galera. +# +# To use multi instance variant, use [mysqld.INSTANCENAME] as sections in my.cnf +# and start the service via: +# systemctl start @DAEMON_NAME@@{instancename}.server +# +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service", +# containing +# .include /usr/lib/systemd/system/@DAEMON_NAME@.service +# ...make your changes here... +# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf", +# which doesn't need to include ".include" call and which will be parsed +# after the file @DAEMON_NAME@.service itself is parsed. +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F + +# For example, if you want to increase mysql's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, so create a file named +# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing: +# [Service] +# LimitNOFILE=10000 + +# Note: /usr/lib/... is recommended in the .include line though /lib/... +# still works. +# Don't forget to reload systemd daemon after you change unit configuration: +# root> systemctl --system daemon-reload + +# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance. + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +After=syslog.target +After=network.target + +[Service] +Type=notify +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mysql-check-socket +ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n +# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER +ExecStartPost=@libexecdir@/mysql-check-upgrade +ExecStopPost=@libexecdir@/mysql-wait-stop + +# Setting this to true can break replication and the Type=notify settings +# See also bind-address mysqld option. +PrivateNetwork=false + +KillMode=process +KillSignal=SIGTERM + +# Don't want to see an automated SIGKILL ever +SendSIGKILL=no + +# Restart crashed server only, on-failure would also restart, for example, when +# my.cnf contains unknown option +Restart=on-abort +RestartSec=5s + +UMask=007 + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +[Install] +WantedBy=multi-user.target