From 36d86b0b3f7d8f9a0c9cc250b6d9015ec7dbe46d Mon Sep 17 00:00:00 2001 From: jxy_git Date: Mon, 4 Sep 2023 17:43:52 +0800 Subject: [PATCH] Add corosync-qdevice.service --- corosync-qdevice.spec | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/corosync-qdevice.spec b/corosync-qdevice.spec index 288206f..2261ad2 100644 --- a/corosync-qdevice.spec +++ b/corosync-qdevice.spec @@ -5,15 +5,13 @@ %bcond_with runautogen %bcond_without systemd -%define _unpackaged_files_terminate_build 0 - %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} Name: corosync-qdevice Summary: The Corosync Cluster Engine Qdevice Version: 3.0.3 -Release: 1 +Release: 2 License: BSD-3-Clause URL: https://github.com/corosync/corosync-qdevice Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz @@ -94,6 +92,30 @@ sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \ This package contains the Corosync Cluster Engine Qdevice, script for creating NSS certificates and an init script. +%post +%if %{with systemd} && 0%{?systemd_post:1} +%systemd_post corosync-qdevice.service +%else +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add corosync-qdevice || : +fi +%endif + +%preun +%if %{with systemd} && 0%{?systemd_preun:1} +%systemd_preun corosync-qdevice.service +%else +if [ $1 -eq 0 ]; then + /sbin/service corosync-qdevice stop &>/dev/null || : + /sbin/chkconfig --del corosync-qdevice || : +fi +%endif + +%postun +%if %{with systemd} && 0%{?systemd_postun:1} +%systemd_postun corosync-qdevice.service +%endif + %files %license LICENSE %dir %{_sysconfdir}/corosync/qdevice @@ -103,6 +125,11 @@ NSS certificates and an init script. %{_sbindir}/corosync-qdevice-net-certutil %{_sbindir}/corosync-qdevice-tool %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice +%if %{with systemd} +%{_unitdir}/corosync-qdevice.service +%else +%{_initrddir}/corosync-qdevice +%endif %{_mandir}/man8/corosync-qdevice-tool.8* %{_mandir}/man8/corosync-qdevice-net-certutil.8* %{_mandir}/man8/corosync-qdevice.8* @@ -180,6 +207,9 @@ fi %{_mandir}/man8/corosync-qnetd.8* %changelog +* Mon Sep 04 2023 jiangxinyu - 3.0.3-2 +- Add corosync-qdevice.service + * Mon Aug 21 2023 jiangxinyu - 3.0.3-1 - Upgrade version to 3.0.3 -- Gitee