From 9e6162062ee9e601153844b9b3a7addc2614c8b27e61310d48f84684dc1afa64 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Wed, 7 Jun 2017 23:24:30 +0000 Subject: [PATCH] Accepting request 501827 from home:jfehlig:branches:Virtualization - Update to sanlock 3.5.0 - increase open file limit to 2048 - add option to log UTC timestamps - doc improvements - Remove support for old, non-systemd distros OBS-URL: https://build.opensuse.org/request/show/501827 OBS-URL: https://build.opensuse.org/package/show/Virtualization/sanlock?expand=0&rev=40 --- sanlock-3.4.0.tar.xz | 3 -- sanlock-3.5.0.tar.gz | 3 ++ sanlock.changes | 9 ++++ sanlock.init | 81 ------------------------------- sanlock.spec | 87 ++++----------------------------- suse-fix-link-errors.patch | 24 +++++----- suse-no-date-time.patch | 14 +++--- suse-systemd.patch | 18 +++---- wdmd.init | 98 -------------------------------------- 9 files changed, 48 insertions(+), 289 deletions(-) delete mode 100644 sanlock-3.4.0.tar.xz create mode 100644 sanlock-3.5.0.tar.gz delete mode 100644 sanlock.init delete mode 100644 wdmd.init diff --git a/sanlock-3.4.0.tar.xz b/sanlock-3.4.0.tar.xz deleted file mode 100644 index 3449703..0000000 --- a/sanlock-3.4.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4b18eb0af1bfc730a037f9da7dd84777c9a4ceb1a1ac2e577705124c4c9e891 -size 157016 diff --git a/sanlock-3.5.0.tar.gz b/sanlock-3.5.0.tar.gz new file mode 100644 index 0000000..2e12016 --- /dev/null +++ b/sanlock-3.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:354f2c75f28fb5d4a20474579be415d2528cc65e53c273a74689953d9d97b4b4 +size 219144 diff --git a/sanlock.changes b/sanlock.changes index d2a52c9..c911040 100644 --- a/sanlock.changes +++ b/sanlock.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jun 7 22:39:48 UTC 2017 - jfehlig@suse.com + +- Update to sanlock 3.5.0 + - increase open file limit to 2048 + - add option to log UTC timestamps + - doc improvements +- Remove support for old, non-systemd distros + ------------------------------------------------------------------- Fri Apr 7 21:53:33 UTC 2017 - jengelh@inai.de diff --git a/sanlock.init b/sanlock.init deleted file mode 100644 index 0b48bf6..0000000 --- a/sanlock.init +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: sanlock -# Required-Start: $time $syslog wdmd $remote_fs -# Required-Stop: $syslog -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 5 -# Default-Stop: 0 1 6 -# Short-Description: starts and stops sanlock daemon -# Description: starts and stops sanlock daemon -### END INIT INFO - -SANLOCKBIN=/usr/sbin/sanlock -SANLOCKRUNDIR=/var/run/sanlock -SANLOCKPIDFILE=$SANLOCKRUNDIR/sanlock.pid -SANLOCKUSER="sanlock" -SANLOCKOPTS="-U $SANLOCKUSER -G $SANLOCKUSER" - -test -x $SANLOCKBIN || { echo "$SANLOCKBIN not installed"; - if [ "$1" = "stop" ]; then exit 0; - else exit 5; fi; } - -[ -f /etc/sysconfig/sanlock ] && . /etc/sysconfig/sanlock - -. /etc/rc.status -rc_reset - - -case "$1" in - start) - if [ ! -d $SANLOCKRUNDIR ]; then - install -d -o $SANLOCKUSER -g $SANLOCKUSER -m 775 $SANLOCKRUNDIR - [ -x /sbin/restorecon ] && restorecon $SANLOCKRUNDIR - fi - if [ -e $SANLOCKPIDFILE ]; then - if checkproc $SANLOCKBIN ; then - echo -n "sanlock is already running." - rc_status -v - exit - else - echo "Removing stale PID file $SANLOCKPIDFILE." - rm -f $SANLOCKPIDFILE - fi - fi - echo -n "Starting sanlock " - startproc $SANLOCKBIN daemon $SANLOCKOPTS - rc_status -v - ;; - stop) - echo -n "Shutting down sanlock " - killproc -TERM $SANLOCKBIN > /dev/null 2>&1 - rm -f $SANLOCKPIDFILE - rc_status -v - ;; - try-restart) - $0 status >/dev/null && $0 restart - rc_status - ;; - restart) - $0 stop - $0 start - rc_status - ;; - reload) - killproc -HUP $SANLOCKBIN - rc_status -v - ;; - status) - echo -n "Checking status of sanlock " - checkproc $SANLOCKBIN - rc_status -v - ;; - *) - echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" - rc_failed 2 - rc_exit - ;; -esac -rc_exit diff --git a/sanlock.spec b/sanlock.spec index badf0fb..4fcdc18 100644 --- a/sanlock.spec +++ b/sanlock.spec @@ -16,21 +16,16 @@ # -%define with_systemd 0 %define with_fence_sanlockd 0 %define with_sanlk_reset 0 -%if 0%{?suse_version} > 1140 -%define with_systemd 1 -%endif - %if 0%{?suse_version} > 1320 %define with_fence_sanlockd 1 %define with_sanlk_reset 1 %endif Name: sanlock -Version: 3.4.0 +Version: 3.5.0 Release: 0 Summary: A shared disk lock manager License: GPL-2.0 and GPL-2.0+ and LGPL-2.1+ @@ -42,12 +37,8 @@ BuildRequires: libaio-devel BuildRequires: libblkid-devel BuildRequires: python BuildRequires: python-devel -%if %{with_systemd} BuildRequires: systemd %{?systemd_requires} -%else -Requires(pre): %insserv_prereq -%endif BuildRequires: xz Requires(pre): %fillup_prereq %if 0%{?suse_version} > 1320 @@ -57,12 +48,10 @@ Requires(pre): %{_sbindir}/groupadd Requires(pre): %{_sbindir}/useradd Requires: %{name}-lib = %{version}-%{release} Recommends: logrotate -Source0: %{name}-%{version}.tar.xz -Source1: sanlock.init -Source2: sysconfig.sanlock -Source3: wdmd.init -Source4: sysconfig.wdmd -Source5: fence_sanlockd.init +Source0: %{name}-%{version}.tar.gz +Source1: sysconfig.sanlock +Source2: sysconfig.wdmd +Source3: fence_sanlockd.init # Upstream patches # SUSE patches Patch100: sanlock-SCHED_RESET_ON_FORK-undefined.patch @@ -134,9 +123,7 @@ common sanlock lockspace. %patch100 %patch101 %patch102 -%if %{with_systemd} %patch103 -p1 -%endif %patch104 -p1 %patch105 -p1 @@ -175,32 +162,21 @@ make -C reset \ %endif install -D -m 644 src/sanlock.conf %{buildroot}/%{_sysconfdir}/sanlock/sanlock.conf -install -D -m 644 %SOURCE2 %{buildroot}/%{_localstatedir}/adm/fillup-templates/sysconfig.sanlock -install -D -m 644 %SOURCE4 %{buildroot}/%{_localstatedir}/adm/fillup-templates/sysconfig.wdmd +install -D -m 644 %SOURCE1 %{buildroot}/%{_localstatedir}/adm/fillup-templates/sysconfig.sanlock +install -D -m 644 %SOURCE2 %{buildroot}/%{_localstatedir}/adm/fillup-templates/sysconfig.wdmd -%if %{with_systemd} install -D -m 644 init.d/sanlock.service %{buildroot}/%{_unitdir}/sanlock.service ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcsanlock install -D -m 644 init.d/wdmd.service %{buildroot}/%{_unitdir}/wdmd.service ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcwdmd %if %{with_fence_sanlockd} -install -D -m 0755 %SOURCE5 %{buildroot}/usr/lib/systemd/systemd-fence_sanlockd +install -D -m 0755 %SOURCE3 %{buildroot}/usr/lib/systemd/systemd-fence_sanlockd install -D -m 0644 init.d/fence_sanlockd.service %{buildroot}/%{_unitdir}/fence_sanlockd.service ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcfence_sanlockd %endif %if %{with_sanlk_reset} install -D -m 0644 init.d/sanlk-resetd.service %{buildroot}/%{_unitdir}/sanlk-resetd.service %endif -%else -install -D -m 755 %SOURCE1 %{buildroot}/etc/init.d/sanlock -ln -s /etc/init.d/sanlock %{buildroot}%{_sbindir}/rcsanlock -install -D -m 755 %SOURCE3 %{buildroot}/etc/init.d/wdmd -ln -s /etc/init.d/wdmd %{buildroot}%{_sbindir}/rcwdmd -%if %{with_fence_sanlockd} -install -D -m 755 %SOURCE5 %{buildroot}/%{_initddir}/fence_sanlockd -ln -s /etc/init.d/fence_sanlockd %{buildroot}%{_sbindir}/rcfence_sanlockd -%endif -%endif install -Dm 0644 src/logrotate.sanlock \ %{buildroot}/etc/logrotate.d/sanlock @@ -214,28 +190,17 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d -u 179 -c "sanlock" -s /sbin/nologin -r \ -g 179 -G disk -d /var/run/sanlock sanlock -%if %{with_systemd} %service_add_pre wdmd.service %service_add_pre sanlock.service -%endif %pre -n fence-sanlock -%if %{with_systemd} %service_add_pre fence_sanlockd.service -%endif %pre -n sanlk-reset -%if %{with_systemd} %service_add_pre sanlk-resetd.service -%endif %post -%if %{with_systemd} %service_add_post wdmd.service sanlock.service -%else -%restart_on_update wdmd -%restart_on_update sanlock -%endif %fillup_only -n wdmd %fillup_only -n sanlock @@ -244,9 +209,7 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d %if %{with_fence_sanlockd} %post -n fence-sanlock -%if %{with_systemd} %service_add_post fence_sanlockd.service -%endif %restart_on_update fence_sanlockd #if [ $1 -eq 1 ] ; then #ccs_update_schema > /dev/null 2>&1 ||: @@ -254,51 +217,28 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d %endif %post -n sanlk-reset -%if %{with_systemd} %service_add_post sanlk-resetd.service -%endif %restart_on_update sanlk-resetd %preun -%if %{with_systemd} %service_del_preun wdmd.service sanlock.service -%else -%stop_on_removal wdmd -%stop_on_removal sanlock -%endif %preun -n fence-sanlock -%if %{with_systemd} %service_del_preun fence_sanlockd.service -%else -%stop_on_removal fence_sanlockd -%endif %preun -n sanlk-reset -%if %{with_systemd} %service_del_preun sanlk-resetd.service -%else -%stop_on_removal sanlk-resetd -%endif %postun -%if %{with_systemd} %service_del_postun wdmd.service sanlock.service -%else -%insserv_cleanup -%endif %postun -n libsanlock1 -p /sbin/ldconfig %postun -n fence-sanlock -%if %{with_systemd} %service_del_postun fence_sanlockd.service -%endif %postun -n sanlk-reset -%if %{with_systemd} %service_del_postun sanlk-resetd.service -%endif %files %defattr(-,root,root,-) @@ -309,13 +249,8 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d %{_localstatedir}/adm/fillup-templates/sysconfig.sanlock %{_sbindir}/rcwdmd %{_localstatedir}/adm/fillup-templates/sysconfig.wdmd -%if %{with_systemd} %{_unitdir}/sanlock.service %{_unitdir}/wdmd.service -%else -/etc/init.d/sanlock -/etc/init.d/wdmd -%endif %{_sbindir}/sanlock %{_sbindir}/wdmd %{_mandir}/man8/wdmd* @@ -351,12 +286,8 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d %files -n fence-sanlock %defattr(-,root,root,-) %{_sbindir}/fence_sanlockd -%if %{with_systemd} /usr/lib/systemd/systemd-fence_sanlockd %{_unitdir}/fence_sanlockd.service -%else -/etc/init.d/fence_sanlockd -%endif %{_sbindir}/fence_sanlock %{_sbindir}/fence_sanlockd %{_sbindir}/rcfence_sanlockd @@ -368,9 +299,7 @@ install -Dd -m 0755 %{buildroot}/etc/wdmd.d %defattr(-,root,root,-) %{_sbindir}/sanlk-reset %{_sbindir}/sanlk-resetd -%if %{with_systemd} %{_unitdir}/sanlk-resetd.service -%endif %{_mandir}/man8/sanlk-reset.8.gz %{_mandir}/man8/sanlk-resetd.8.gz %endif diff --git a/suse-fix-link-errors.patch b/suse-fix-link-errors.patch index fc5b8d3..29ef0fe 100644 --- a/suse-fix-link-errors.patch +++ b/suse-fix-link-errors.patch @@ -1,7 +1,7 @@ -Index: sanlock-3.4.0/fence_sanlock/Makefile +Index: sanlock-3.5.0/fence_sanlock/Makefile =================================================================== ---- sanlock-3.4.0.orig/fence_sanlock/Makefile -+++ sanlock-3.4.0/fence_sanlock/Makefile +--- sanlock-3.5.0.orig/fence_sanlock/Makefile ++++ sanlock-3.5.0/fence_sanlock/Makefile @@ -35,7 +35,7 @@ CFLAGS += -DVERSION=\"$(VER)\" -I../src CFLAGS += -fPIE -DPIE @@ -11,10 +11,10 @@ Index: sanlock-3.4.0/fence_sanlock/Makefile all: $(TARGET1) $(TARGET2) -Index: sanlock-3.4.0/src/Makefile +Index: sanlock-3.5.0/src/Makefile =================================================================== ---- sanlock-3.4.0.orig/src/Makefile -+++ sanlock-3.4.0/src/Makefile +--- sanlock-3.5.0.orig/src/Makefile ++++ sanlock-3.5.0/src/Makefile @@ -96,17 +96,16 @@ CFLAGS += -DVERSION=\"$(VER)\" CMD_CFLAGS = $(CFLAGS) -fPIE -DPIE @@ -37,10 +37,10 @@ Index: sanlock-3.4.0/src/Makefile ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so.$(SOMAJOR) -Index: sanlock-3.4.0/tests/Makefile +Index: sanlock-3.5.0/tests/Makefile =================================================================== ---- sanlock-3.4.0.orig/tests/Makefile -+++ sanlock-3.4.0/tests/Makefile +--- sanlock-3.5.0.orig/tests/Makefile ++++ sanlock-3.5.0/tests/Makefile @@ -34,7 +34,7 @@ CFLAGS += -D_GNU_SOURCE -g \ -fasynchronous-unwind-tables \ -fdiagnostics-show-option @@ -50,10 +50,10 @@ Index: sanlock-3.4.0/tests/Makefile all: $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) $(TARGET6) $(TARGET7) -Index: sanlock-3.4.0/reset/Makefile +Index: sanlock-3.5.0/reset/Makefile =================================================================== ---- sanlock-3.4.0.orig/reset/Makefile -+++ sanlock-3.4.0/reset/Makefile +--- sanlock-3.5.0.orig/reset/Makefile ++++ sanlock-3.5.0/reset/Makefile @@ -35,7 +35,7 @@ CFLAGS += -DVERSION=\"$(VER)\" -I../src CFLAGS += -fPIE -DPIE diff --git a/suse-no-date-time.patch b/suse-no-date-time.patch index bc2a322..b75d04b 100644 --- a/suse-no-date-time.patch +++ b/suse-no-date-time.patch @@ -1,8 +1,8 @@ -Index: sanlock-3.4.0/src/main.c +Index: sanlock-3.5.0/src/main.c =================================================================== ---- sanlock-3.4.0.orig/src/main.c -+++ sanlock-3.4.0/src/main.c -@@ -1903,8 +1903,8 @@ static int read_command_line(int argc, c +--- sanlock-3.5.0.orig/src/main.c ++++ sanlock-3.5.0/src/main.c +@@ -1904,8 +1904,8 @@ static int read_command_line(int argc, c } if (!strcmp(arg1, "--version") || !strcmp(arg1, "-V")) { @@ -13,10 +13,10 @@ Index: sanlock-3.4.0/src/main.c exit(EXIT_SUCCESS); } -Index: sanlock-3.4.0/fence_sanlock/fence_sanlockd.c +Index: sanlock-3.5.0/fence_sanlock/fence_sanlockd.c =================================================================== ---- sanlock-3.4.0.orig/fence_sanlock/fence_sanlockd.c -+++ sanlock-3.4.0/fence_sanlock/fence_sanlockd.c +--- sanlock-3.5.0.orig/fence_sanlock/fence_sanlockd.c ++++ sanlock-3.5.0/fence_sanlock/fence_sanlockd.c @@ -565,8 +565,7 @@ int main(int argc, char *argv[]) print_usage(); exit(0); diff --git a/suse-systemd.patch b/suse-systemd.patch index e333962..cbde5a3 100644 --- a/suse-systemd.patch +++ b/suse-systemd.patch @@ -1,7 +1,7 @@ -Index: sanlock-3.4.0/init.d/sanlock.service +Index: sanlock-3.5.0/init.d/sanlock.service =================================================================== ---- sanlock-3.4.0.orig/init.d/sanlock.service -+++ sanlock-3.4.0/init.d/sanlock.service +--- sanlock-3.5.0.orig/init.d/sanlock.service ++++ sanlock-3.5.0/init.d/sanlock.service @@ -5,8 +5,10 @@ Wants=wdmd.service [Service] @@ -15,10 +15,10 @@ Index: sanlock-3.4.0/init.d/sanlock.service [Install] WantedBy=multi-user.target -Index: sanlock-3.4.0/init.d/wdmd.service +Index: sanlock-3.5.0/init.d/wdmd.service =================================================================== ---- sanlock-3.4.0.orig/init.d/wdmd.service -+++ sanlock-3.4.0/init.d/wdmd.service +--- sanlock-3.5.0.orig/init.d/wdmd.service ++++ sanlock-3.5.0/init.d/wdmd.service @@ -4,8 +4,10 @@ After=syslog.target [Service] @@ -32,10 +32,10 @@ Index: sanlock-3.4.0/init.d/wdmd.service [Install] WantedBy=multi-user.target -Index: sanlock-3.4.0/init.d/fence_sanlockd.service +Index: sanlock-3.5.0/init.d/fence_sanlockd.service =================================================================== ---- sanlock-3.4.0.orig/init.d/fence_sanlockd.service -+++ sanlock-3.4.0/init.d/fence_sanlockd.service +--- sanlock-3.5.0.orig/init.d/fence_sanlockd.service ++++ sanlock-3.5.0/init.d/fence_sanlockd.service @@ -5,8 +5,8 @@ Before=corosync.service [Service] diff --git a/wdmd.init b/wdmd.init deleted file mode 100644 index 6a7c5a9..0000000 --- a/wdmd.init +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: wdmd -# Required-Start: $time $syslog $remote_fs -# Required-Stop: $syslog -# Should-Start: -# Should-Stop: -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: starts and stops wdmd daemon -# Description: starts and stops wdmd daemon -### END INIT INFO - -WDMDBIN=/usr/sbin/wdmd -WDMDRUNDIR=/var/run/wdmd -WDMDPIDFILE=$WDMDRUNDIR/wdmd.pid - -WDMDGROUP="sanlock" -WDMDOPTS="-G $WDMDGROUP" - -test -x $WDMDBIN || { echo "$WDMDBIN not installed"; - if [ "$1" = "stop" ]; then exit 0; - else exit 5; fi; } - -[ -f /etc/sysconfig/wdmd ] && . /etc/sysconfig/wdmd - -. /etc/rc.status -rc_reset - - -watchdog_check() { - if [ ! -c /dev/watchdog ]; then - echo -n "Loading the softdog kernel module " - modprobe softdog && udevadm settle - if [ ! -c /dev/watchdog ]; then - rc_failed 1 - rc_status -v - rc_exit - fi - rc_status -v - fi -} - -case "$1" in - start) - watchdog_check - - if [ ! -d $WDMDRUNDIR ]; then - install -d -g $WDMDGROUP -m 775 $WDMDRUNDIR - [ -x /sbin/restorecon ] && restorecon $WDMDRUNDIR - fi - - if [ -e $WDMDPIDFILE ]; then - if checkproc $WDMDBIN; then - echo -n "wdmd is already running." - rc_status -v - rc_exit - else - echo "Removing stale PID file $WDMDPIDFILE." - rm -f $WDMDPIDFILE - fi - fi - echo -n "Starting wdmd " - startproc $WDMDBIN $WDMDOPTS - rc_status -v - ;; - stop) - echo -n "Shutting down wdmd " - killproc -TERM $WDMDBIN > /dev/null 2>&1 - rm -f $WDMDPIDFILE - rc_status -v - ;; - try-restart) - $0 status >/dev/null && $0 restart - rc_status - ;; - restart) - $0 stop - $0 start - rc_status - ;; - reload) - killproc -HUP $WDMDBIN - rc_status -v - ;; - status) - echo -n "Checking status of wdmd " - checkproc $WDMDBIN - rc_status -v - ;; - *) - echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" - rc_failed 2 - rc_exit - ;; -esac -rc_exit