From ce69fa182f34e97c5016c2b50e43f9f81c0feb9a Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Fri, 14 May 2021 16:01:43 +0800 Subject: [PATCH 1/2] libisns: remove sighold and sigrelse The man page says that these are deprecated. Use sugprocmask as a replacement. Signed-off-by: Wenchao Hao --- ...-libisns-remove-sighold-and-sigrelse.patch | 44 +++++++++++++++++++ open-isns.spec | 6 ++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 0004-libisns-remove-sighold-and-sigrelse.patch diff --git a/0004-libisns-remove-sighold-and-sigrelse.patch b/0004-libisns-remove-sighold-and-sigrelse.patch new file mode 100644 index 0000000..d1d2dd0 --- /dev/null +++ b/0004-libisns-remove-sighold-and-sigrelse.patch @@ -0,0 +1,44 @@ +From e7dac76ce61039fefa58985c955afccb60dabe87 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Wed, 29 Apr 2020 15:55:55 -0700 +Subject: [PATCH] libisns: remove sighold and sigrelse + +The man page says that these are deprecated. Use sugprocmask as a replacement. +--- + include/libisns/util.h | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/include/libisns/util.h b/include/libisns/util.h +index e5ed037..f1b97f0 100644 +--- a/include/libisns/util.h ++++ b/include/libisns/util.h +@@ -41,14 +41,22 @@ char * print_size(unsigned long); + */ + static inline void signals_hold(void) + { +- sighold(SIGTERM); +- sighold(SIGINT); ++ sigset_t s; ++ ++ sigemptyset(&s); ++ sigaddset(&s, SIGTERM); ++ sigaddset(&s, SIGINT); ++ sigprocmask(SIG_BLOCK, &s, 0); + } + + static inline void signals_release(void) + { +- sigrelse(SIGTERM); +- sigrelse(SIGINT); ++ sigset_t s; ++ ++ sigemptyset(&s); ++ sigaddset(&s, SIGTERM); ++ sigaddset(&s, SIGINT); ++ sigprocmask(SIG_UNBLOCK, &s, 0); + } + + /* +-- +1.8.3.1 + diff --git a/open-isns.spec b/open-isns.spec index fbfd816..74a9954 100644 --- a/open-isns.spec +++ b/open-isns.spec @@ -1,6 +1,6 @@ Name: open-isns Version: 0.100 -Release: 3 +Release: 4 Summary: The iSNS server and client programs License: LGPLv2+ URL: https://www.github.com/open-iscsi/open-isns @@ -9,6 +9,7 @@ Source0: https://www.github.com/open-iscsi/open-isns/archive/v%{version}. Patch1: 0001-Fix-the-issue-of-ignoring-the-return-value.patch Patch2: 0002-Fix-compiler-issue-when-not-in-security-mode.patch Patch3: 0003-Fix-586-compile-issue-and-remove-Werror.patch +Patch4: 0004-libisns-remove-sighold-and-sigrelse.patch BuildRequires: gcc git systemd automake autoconf make BuildRequires: openssl-devel systemd-devel @@ -96,6 +97,9 @@ install -p -m 644 isnsd.service %{buildroot}%{_unitdir}/isnsd.service %{_mandir}/man8/* %changelog +* Fri May 14 2021 Wenchao Hao - 0.100-4 +- libisns: remove sighold and sigrelse + * Wed Nov 4 2020 lixiaokeng - 0.100-3 - add make tests -- Gitee From 43e5bd69a091e82f196fcd3be69eadb6bf81a65d Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Thu, 29 Apr 2021 16:13:30 +0800 Subject: [PATCH 2/2] Fix systemd error message when enable isnsd.service Signed-off-by: Wenchao Hao --- ...nstall-isnsd.socket-in-isnsd.service.patch | 25 +++++++++++++++++++ open-isns.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0005-Do-not-install-isnsd.socket-in-isnsd.service.patch diff --git a/0005-Do-not-install-isnsd.socket-in-isnsd.service.patch b/0005-Do-not-install-isnsd.socket-in-isnsd.service.patch new file mode 100644 index 0000000..30d32e9 --- /dev/null +++ b/0005-Do-not-install-isnsd.socket-in-isnsd.service.patch @@ -0,0 +1,25 @@ +From 040ee0d91adb8b2f6dd3705e3c193a77b40e69c5 Mon Sep 17 00:00:00 2001 +From: Wenchao Hao +Date: Thu, 29 Apr 2021 16:07:59 +0800 +Subject: [PATCH] Do not install isnsd.socket in isnsd.service + +isnsd.socket is removed from rpm package, so here remove it from isnsd.service +to fix systemd error message + +Signed-off-by: Wenchao Hao +--- + isnsd.service | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/isnsd.service b/isnsd.service +index 76eac6c..3f5fb21 100644 +--- a/isnsd.service ++++ b/isnsd.service +@@ -12,4 +12,3 @@ LimitCORE=infinity + + [Install] + WantedBy=sysinit.target +-Also=isnsd.socket +-- +1.8.3.1 + diff --git a/open-isns.spec b/open-isns.spec index 74a9954..f26d5d5 100644 --- a/open-isns.spec +++ b/open-isns.spec @@ -1,6 +1,6 @@ Name: open-isns Version: 0.100 -Release: 4 +Release: 5 Summary: The iSNS server and client programs License: LGPLv2+ URL: https://www.github.com/open-iscsi/open-isns @@ -10,6 +10,7 @@ Patch1: 0001-Fix-the-issue-of-ignoring-the-return-value.patch Patch2: 0002-Fix-compiler-issue-when-not-in-security-mode.patch Patch3: 0003-Fix-586-compile-issue-and-remove-Werror.patch Patch4: 0004-libisns-remove-sighold-and-sigrelse.patch +Patch5: 0005-Do-not-install-isnsd.socket-in-isnsd.service.patch BuildRequires: gcc git systemd automake autoconf make BuildRequires: openssl-devel systemd-devel @@ -97,6 +98,9 @@ install -p -m 644 isnsd.service %{buildroot}%{_unitdir}/isnsd.service %{_mandir}/man8/* %changelog +* Fri May 14 2021 Wenchao Hao - 0.100-5 +- Do not install isnsd.socket in isnsd.service + * Fri May 14 2021 Wenchao Hao - 0.100-4 - libisns: remove sighold and sigrelse -- Gitee