conga/ricci common/daemon_init.c ricci/Makefil ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-02-19 03:14:12
Modified files:
ricci/common : daemon_init.c
ricci/ricci : Makefile Ricci.cpp main.cpp
Added files:
ricci/test_suite/ricci: self_fence.xml
Log message:
add support for quick and dirty fencing (a la 'reboot -fn') via a 'self_fence' or 'force_reboot' function
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/daemon_init.c.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Makefile.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Ricci.cpp.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/main.cpp.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/ricci/self_fence.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1
ricci/common/daemon_init.c +1 -2
@@ -20,7 +20,7 @@/** @file * daemon_init function, does sanity checks and calls daemon(). * -* $Id: daemon_init.c,v 1.4 2008/01/02 20:47:34 rmccabe Exp $ +* $Id: daemon_init.c,v 1.5 2008/02/19 03:14:11 rmccabe Exp $ * * Author: Jeff Moyer <[email protected]> */
@@ -232,5 +232,4 @@update_pidfile (prog);nice (-1 ); -//mlockall(MCL_CURRENT | MCL_FUTURE); }
ricci/ricci/Makefile +1 -1
@@ -39,7 +39,7 @@ INCLUDE += `pkg-config --cflags dbus-1` -I../common CFLAGS += CXXFLAGS += -DDBUS_MAJOR_VERSION="${dbus_major_version}" -DDBUS_MINOR_VERSION="${dbus_minor_version}" -DPARANOIA=$(PARANOID) -LDFLAGS += `pkg-config --libs dbus-1` +LDFLAGS += -lcap `pkg-config --libs dbus-1` ifeq ($(PARANOID), 1) LDFLAGS += ${top_srcdir}/common/paranoid/*.o
ricci/ricci/Ricci.cpp +6 -0
@@ -34,6 +34,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <sys/reboot.h> #include <fcntl.h> #include <errno.h> #include <dirent.h>
@@ -160,6 +161,11 @@ remove_cert = true; } authenticated = false; + } else if (function == "force_reboot" || function == "self_fence") { + if (reboot(RB_AUTOBOOT) == 0) + success = RRC_SUCCESS; + else + success = RRC_INTERNAL_ERROR; } else if (function == "list_modules") { // available modules if (!authenticated) {
ricci/ricci/main.cpp +80 -12
132 lines not on this page · raw message
/cvs/cluster/conga/ricci/test_suite/ricci/self_fence.xml,v --> standard output revision 1.1
- renamed from ricci/test_suite/ricci/self_fence.xml +2 -0
@@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<ricci version="1.0" function="self_fence"/>