Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 289271 Details for
Bug 418541
RFE: Make fence_ack_manual in RHEL5 branch talk to manual override socket
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Makes fence_ack_manual work as override (needs -e flag)
fence-ack-manual-override.patch (text/plain), 4.87 KB, created by
Lon Hohberger
on 2007-12-14 16:57:14 UTC
(
hide
)
Description:
Makes fence_ack_manual work as override (needs -e flag)
Filename:
MIME Type:
Creator:
Lon Hohberger
Created:
2007-12-14 16:57:14 UTC
Size:
4.87 KB
patch
obsolete
>? fenced-override-use-after-free.patch >? foo.patch >? agents/foo >? agents/apc/fence_apc >? agents/bladecenter/fence_bladecenter >? agents/brocade/fence_brocade >? agents/bullpap/fence_bullpap >? agents/drac/fence_drac >? agents/egenera/fence_egenera >? agents/ilo/fence_ilo >? agents/ipmilan/fence_ipmilan >? agents/manual/fence_ack_manual >? agents/manual/fence_manual >? agents/mcdata/fence_mcdata >? agents/rps10/fence_rps10 >? agents/rsa/fence_rsa >? agents/rsb/fence_rsb >? agents/sanbox2/fence_sanbox2 >? agents/scsi/fence_scsi >? agents/scsi/fence_scsi_test >? agents/vixel/fence_vixel >? agents/wti/fence_wti >? agents/xvm/fence_xvm >? agents/xvm/fence_xvmd >? agents/xvm/foo.out >? fence_node/fence_node >? fence_tool/fence_tool >? fenced/fenced >? fenced/fenced-override-use-after-free.patch >? make/.cvsignore >Index: agents/manual/Makefile >=================================================================== >RCS file: /cvs/cluster/cluster/fence/agents/manual/Makefile,v >retrieving revision 1.7 >diff -u -r1.7 Makefile >--- agents/manual/Makefile 11 Aug 2006 15:18:08 -0000 1.7 >+++ agents/manual/Makefile 14 Dec 2007 16:55:28 -0000 >@@ -16,7 +16,8 @@ > top_srcdir=../.. > > >-INCLUDE= -I${top_srcdir}/include -I${top_srcdir}/config -I${incdir} -I../../../cman/lib -I../../../group/lib >+INCLUDE= -I${top_srcdir}/include -I${top_srcdir}/config -I${incdir} -I../../../cman/lib -I../../../group/lib \ >+ -I../../../ccs/lib -I../../fenced > > > include ${top_srcdir}/make/defines.mk >@@ -31,10 +32,10 @@ > $(CC) $(LDFLAGS) -o $@ $^ -lcman > > manual.o: manual.c >- $(CC) $(CFLAGS) -c -o $@ $< >+ $(CC) $(CFLAGS) -c -o $@ $< > > fence_ack_manual: ack.o >- ${CC} -o $@ $^ >+ ${CC} -o $@ $^ ../../../ccs/lib/libccs.a > > ack.o: ack.c > $(CC) $(CFLAGS) -c -o $@ $< >Index: agents/manual/ack.c >=================================================================== >RCS file: /cvs/cluster/cluster/fence/agents/manual/Attic/ack.c,v >retrieving revision 1.3 >diff -u -r1.3 ack.c >--- agents/manual/ack.c 24 Nov 2004 03:46:32 -0000 1.3 >+++ agents/manual/ack.c 14 Dec 2007 16:55:28 -0000 >@@ -11,6 +11,9 @@ > ******************************************************************************* > ******************************************************************************/ > >+#include <limits.h> >+#include <sys/types.h> >+#include <sys/stat.h> > #include <unistd.h> > #include <stdio.h> > #include <stdlib.h> >@@ -19,8 +22,9 @@ > #include <errno.h> > #include <ctype.h> > #include <sys/ioctl.h> >-#include <sys/types.h> > #include <sys/wait.h> >+#include <ccs.h> >+#include <fd.h> > > #include "copyright.cf" > >@@ -30,6 +34,7 @@ > char fname[256]; > int quiet_flag = 0; > int override_flag = 0; >+int emergency_flag = 0; > > > void print_usage(void) >@@ -43,9 +48,78 @@ > " -O override\n" > " -n <nodename> Name of node that was manually fenced\n" > " -s <ip> IP address of machine that was manually fenced (deprecated)\n" >+ " -e Emergency Override (use if fencing has failed)\n" > " -V Version information\n", pname); > } > >+int do_emergency_override(char *ipaddr) >+{ >+ int fd; >+ int cd, tries = 0, error = 0; >+ char buf[PATH_MAX], path[PATH_MAX], *str = NULL; >+ struct stat st_buf; >+ >+ cd = ccs_force_connect(NULL, 1); >+ if (cd >= 0) { >+ memset(buf, 0, sizeof(buf)); >+ snprintf(buf, sizeof(buf)-1, "/cluster/fence_daemon/@override_path"); >+ error = ccs_get(cd, buf, &str); >+ ccs_disconnect(cd); >+ } >+ >+ if (error != 0) >+ str = DEFAULT_OVERRIDE_PATH; >+ >+ memset(path, 0, sizeof(path)); >+ snprintf(path, sizeof(path)-1, "%s", str); >+ >+ if (error == 0) >+ free(str); >+ >+ while (1) { >+ if (tries) { >+ if (tries == 1) >+ printf("Waiting for %s to become available...\n", path); >+ sleep(1); >+ } >+ ++tries; >+ >+ fd = open(path, O_WRONLY); >+ if (fd < 0) { >+ switch(errno) { >+ case ENOENT: >+ continue; >+ default: >+ perror("open"); >+ return 1; >+ } >+ } >+ >+ error = fstat(fd, &st_buf); >+ if (error < 0) { >+ close(fd); >+ switch(errno) { >+ case ENOENT: >+ continue; >+ default: >+ perror("fstat"); >+ return 1; >+ } >+ } >+ >+ if (!S_ISFIFO(st_buf.st_mode)) { >+ printf("WARNING: %s is not a named pipe\n", str); >+ } >+ >+ snprintf(buf, sizeof(buf)-1, "%s\n", ipaddr); >+ write(fd, buf, strlen(buf)); >+ close(fd); >+ break; >+ } >+ >+ return 0; >+} >+ > int main(int argc, char **argv) > { > int error, fd; >@@ -58,7 +132,7 @@ > > pname = argv[0]; > >- while ((c = getopt(argc, argv, "hOs:n:qV")) != -1) >+ while ((c = getopt(argc, argv, "ehOs:n:qV")) != -1) > { > switch(c) > { >@@ -70,6 +144,10 @@ > override_flag = 1; > break; > >+ case 'e': >+ emergency_flag = 1; >+ break; >+ > case 's': > ipaddr = optarg; > break; >@@ -128,6 +206,10 @@ > } > } > >+ if (emergency_flag) { >+ return do_emergency_override(ipaddr); >+ } >+ > memset(fname, 0, 256); > sprintf(fname, "%s/fence_manual.fifo", FIFO_DIR); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 418541
: 289271