Install service files instead of init files
This commit is contained in:
parent
d3e4a616cd
commit
07c40392ed
@ -1,36 +0,0 @@
|
||||
From eabcca788b5cf8b126bd7ba24991c37f952b9a02 Mon Sep 17 00:00:00 2001
|
||||
From: David Teigland <teigland@redhat.com>
|
||||
Date: Thu, 9 Jun 2011 17:22:38 -0500
|
||||
Subject: [PATCH] sanlock: fix libwdmd linking
|
||||
|
||||
---
|
||||
src/Makefile | 6 +++---
|
||||
1 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 93d0306..9491ce1 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -61,8 +61,8 @@ CFLAGS += -D_GNU_SOURCE -g \
|
||||
-fasynchronous-unwind-tables \
|
||||
-fdiagnostics-show-option
|
||||
|
||||
-CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -lwdmd
|
||||
-LIB_LDFLAGS = -lpthread -lrt -laio -lblkid -lwdmd
|
||||
+CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
|
||||
+LIB_LDFLAGS = -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
|
||||
|
||||
all: $(SHLIB_TARGET) $(CMD_TARGET)
|
||||
@@ -73,7 +73,7 @@ $(SHLIB_TARGET): $(LIB_SOURCE)
|
||||
ln -sf $(SHLIB_TARGET) $(LIB_TARGET).so.$(SOMAJOR)
|
||||
|
||||
$(CMD_TARGET): $(SHLIB_TARGET) $(CMD_SOURCE)
|
||||
- $(CC) $(CFLAGS) $(CMD_LDFLAGS) $(CMD_SOURCE) -o $@ -L. -L../wdmd
|
||||
+ $(CC) $(CFLAGS) $(CMD_LDFLAGS) $(CMD_SOURCE) -o $@ -L.
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so *.so.* $(CMD_TARGET)
|
||||
--
|
||||
1.7.1.1
|
||||
|
@ -1,67 +0,0 @@
|
||||
From 5772bd9c4f6b38132ed834bf4e48f899946ff923 Mon Sep 17 00:00:00 2001
|
||||
From: David Teigland <teigland@redhat.com>
|
||||
Date: Thu, 9 Jun 2011 16:54:09 -0500
|
||||
Subject: [PATCH] sanlock/wdmd: shut up warnings
|
||||
|
||||
---
|
||||
src/paxos_lease.c | 4 ++--
|
||||
wdmd/main.c | 13 +++++++++----
|
||||
2 files changed, 11 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/paxos_lease.c b/src/paxos_lease.c
|
||||
index 141c61d..e842b93 100644
|
||||
--- a/src/paxos_lease.c
|
||||
+++ b/src/paxos_lease.c
|
||||
@@ -724,7 +724,7 @@ static int _leader_read_multiple(struct task *task,
|
||||
int leaders_len, leader_reps_len;
|
||||
int num_reads;
|
||||
int num_disks = token->r.num_disks;
|
||||
- int rv, d, i, found;
|
||||
+ int rv = 0, d, i, found;
|
||||
int error;
|
||||
|
||||
leaders_len = num_disks * sizeof(struct leader_record);
|
||||
@@ -978,7 +978,7 @@ static int write_new_leader(struct task *task,
|
||||
int num_disks = token->r.num_disks;
|
||||
int num_writes = 0;
|
||||
int error = SANLK_OK;
|
||||
- int rv, d;
|
||||
+ int rv = 0, d;
|
||||
|
||||
for (d = 0; d < num_disks; d++) {
|
||||
rv = write_leader(task, &token->disks[d], nl);
|
||||
diff --git a/wdmd/main.c b/wdmd/main.c
|
||||
index a020b1e..e024c82 100644
|
||||
--- a/wdmd/main.c
|
||||
+++ b/wdmd/main.c
|
||||
@@ -330,7 +330,7 @@ static int setup_listener_socket(int *listener_socket)
|
||||
|
||||
static int setup_clients(void)
|
||||
{
|
||||
- int rv, fd, ci;
|
||||
+ int rv, fd = -1, ci;
|
||||
|
||||
rv = setup_listener_socket(&fd);
|
||||
if (rv < 0)
|
||||
@@ -610,10 +610,15 @@ static int test_scripts(void) { return 0; }
|
||||
|
||||
static void close_watchdog(void)
|
||||
{
|
||||
- write(dev_fd, "V", 1);
|
||||
- close(dev_fd);
|
||||
+ int rv;
|
||||
+
|
||||
+ rv = write(dev_fd, "V", 1);
|
||||
+ if (rv < 0)
|
||||
+ log_error("/dev/watchdog disarm write error %d", errno);
|
||||
+ else
|
||||
+ log_error("/dev/watchdog disarmed");
|
||||
|
||||
- log_error("/dev/watchdog disarmed");
|
||||
+ close(dev_fd);
|
||||
}
|
||||
|
||||
static int setup_watchdog(void)
|
||||
--
|
||||
1.7.1.1
|
||||
|
21
sanlock.spec
21
sanlock.spec
@ -1,6 +1,6 @@
|
||||
Name: sanlock
|
||||
Version: 2.1
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: A shared disk lock manager
|
||||
|
||||
Group: System Environment/Base
|
||||
@ -38,8 +38,10 @@ make -C python \
|
||||
install LIBDIR=%{_libdir} \
|
||||
DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
install -D -m 755 init.d/sanlock $RPM_BUILD_ROOT/%{_initddir}/sanlock
|
||||
install -D -m 755 init.d/wdmd $RPM_BUILD_ROOT/%{_initddir}/wdmd
|
||||
install -D -m 0755 init.d/sanlock %{buildroot}/lib/systemd/systemd-sanlock
|
||||
install -D -m 0644 init.d/sanlock.service %{buildroot}/%{_unitdir}/sanlock.service
|
||||
install -D -m 0755 init.d/wdmd %{buildroot}/lib/systemd/systemd-wdmd
|
||||
install -D -m 0644 init.d/wdmd.service %{buildroot}/%{_unitdir}/wdmd.service
|
||||
|
||||
install -Dm 0644 src/limits.conf \
|
||||
$RPM_BUILD_ROOT/etc/security/limits.d/90-sanlock.conf
|
||||
@ -58,15 +60,11 @@ getent passwd sanlock > /dev/null || /usr/sbin/useradd \
|
||||
-g 179 -d /var/run/sanlock sanlock
|
||||
|
||||
%post
|
||||
/sbin/chkconfig --add sanlock
|
||||
/sbin/chkconfig --add wdmd
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/service sanlock stop > /dev/null 2>&1
|
||||
/sbin/service wdmd stop > /dev/null 2>&1
|
||||
/sbin/chkconfig --del sanlock
|
||||
/sbin/chkconfig --del wdmd
|
||||
fi
|
||||
|
||||
%postun
|
||||
@ -75,8 +73,10 @@ fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_initddir}/sanlock
|
||||
%{_initddir}/wdmd
|
||||
/lib/systemd/systemd-sanlock
|
||||
/lib/systemd/systemd-wdmd
|
||||
%{_unitdir}/sanlock.service
|
||||
%{_unitdir}/wdmd.service
|
||||
%{_sbindir}/sanlock
|
||||
%{_sbindir}/wdmd
|
||||
%{_mandir}/man8/wdmd*
|
||||
@ -141,6 +141,9 @@ developing applications that use %{name}.
|
||||
%{_includedir}/sanlock_direct.h
|
||||
|
||||
%changelog
|
||||
* Thu Apr 05 2012 David Teigland <teigland@redhat.com> - 2.1-2
|
||||
- Install service files instead of init files
|
||||
|
||||
* Wed Mar 21 2012 David Teigland <teigland@redhat.com> - 2.1-1
|
||||
- Update to sanlock-2.1
|
||||
|
||||
|
11
uuid.patch
11
uuid.patch
@ -1,11 +0,0 @@
|
||||
--- sanlock-1.6/src/Makefile.uuid 2011-08-02 12:51:51.559842071 -0500
|
||||
+++ sanlock-1.6/src/Makefile 2011-08-02 12:51:55.782943836 -0500
|
||||
@@ -61,7 +61,7 @@ CFLAGS += -D_GNU_SOURCE -g \
|
||||
-fasynchronous-unwind-tables \
|
||||
-fdiagnostics-show-option
|
||||
|
||||
-CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
|
||||
+CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd -luuid
|
||||
LIB_LDFLAGS = -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user