Remove mariadb-wait-ready call from systemd unit, we have now systemd notify support

Make mariadb@.service similar to mariadb.service
This commit is contained in:
Honza Horak 2016-02-11 11:58:28 +01:00
parent f7a17ba600
commit 2caa773538
3 changed files with 83 additions and 3 deletions

View File

@ -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 <hhorak@redhat.com> - 1:10.1.11-4
- Use systemd unit file more compatible with upstream

View File

@ -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

77
mysql@.service.in Normal file
View File

@ -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