From d61a5d2f31b9965c2561608db9f79ed635d4e3ee Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Thu, 18 Mar 2021 03:10:06 +0100 Subject: [PATCH] Move bits around, have all service files stuff together Shouldn't bring any changes to functionality --- mariadb.spec | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mariadb.spec b/mariadb.spec index eeae6f7..85767b3 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -969,24 +969,31 @@ rm %{_vpath_builddir}/scripts/my.cnf # use different config file name for each variant of server (mariadb / mysql) mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf -# remove SysV init script and a symlink to that, we use systemd +# Remove upstream SysV init script and a symlink to that, we use systemd rm %{buildroot}%{_libexecdir}/rcmysql +# Remove upstream Systemd service files +# We don't use this location of service files +# Note: currently there still are "mariadb" named systemd service files on this location +rm %{buildroot}%{_datadir}/%{pkg_name}/systemd/{mysql,mysqld}.service +# These may come handy in a future, but right now we use our own services +rm %{buildroot}/usr/lib/systemd/system/{mysql,mysqld}.service + # install systemd unit files and scripts for handling server startup install -D -p -m 644 %{_vpath_builddir}/scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service -# Install downstream version of tmpfiles -install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf -%if 0%{?mysqld_pid_dir:1} -echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf -%endif - # helper scripts for service starting install -p -m 755 %{_vpath_builddir}/scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade install -p -m 644 %{_vpath_builddir}/scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common +# Install downstream version of tmpfiles +install -D -p -m 0644 %{_vpath_builddir}/scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf +%if 0%{?mysqld_pid_dir:1} +echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf +%endif + # install aditional galera selinux policy %if %{with galera} install -p -m 644 -D selinux/%{name}-server-galera.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp @@ -1045,12 +1052,6 @@ install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}} install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}} install -p -m 0644 %{SOURCE71} %{basename:%{SOURCE71}} -# Delete upstreams service files -# We don't use this location of service files -rm %{buildroot}%{_datadir}/%{pkg_name}/systemd/{mysql,mysqld}.service -# These may come handy in a future, but right now we use our own services -rm %{buildroot}/usr/lib/systemd/system/{mysql,mysqld}.service - # install galera config file %if %{with galera} sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' %{_vpath_builddir}/support-files/wsrep.cnf