fence-agents: master - [cleanup] Remove messages 'Due to limitations, binary dependencies ...'
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=5901c3...
Commit: 5901c326a39f68582fd0d5f5d465ced87b9e230d
Parent: ab73cbc40309f16025669f754811c8e82ea8265b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Mar 21 12:16:34 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Mar 21 12:16:34 2014 +0100
[cleanup] Remove messages 'Due to limitations,binary dependencies ...'
This message is no longer true as we ship subpackages for fence agents and users
do not have to install all 3rd party sotfware.
---
fence/agents/lib/fencing.py.py | 33 +++++++--------------------------
fence/agents/netio/fence_netio.py | 12 +++---------
fence/agents/wti/fence_wti.py | 12 +++---------
3 files changed, 13 insertions(+), 44 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 76855e1..5dd188e 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -983,14 +983,8 @@ def fence_login(options, re_login_string = "(login\s*: )|(Login Name: )|(userna
command = '%s %s %s@%s -p %s -o PubkeyAuthentication=no' % (SSH_PATH, force_ipvx, options["--username"], options["--ip"], options["--ipport"])
if options.has_key("--ssh-options"):
command += ' ' + options["--ssh-options"]
- try:
- conn = fspawn(options, command)
- except pexpect.ExceptionPexpect, ex:
- sys.stderr.write(str(ex) + "\n")
- syslog.syslog(syslog.LOG_ERR, str(ex))
- sys.stderr.write("Due to limitations, binary dependencies on fence agents "
- "are not in the spec file and must be installed separately." + "\n")
- sys.exit(EC_GENERIC_ERROR)
+
+ conn = fspawn(options, command)
if options.has_key("telnet_over_ssh"):
#This is for stupid ssh servers (like ALOM) which behave more like telnet (ignore name and display login prompt)
@@ -1013,14 +1007,8 @@ def fence_login(options, re_login_string = "(login\s*: )|(Login Name: )|(userna
command = '%s %s %s@%s -i %s -p %s' % (SSH_PATH, force_ipvx, options["--username"], options["--ip"], options["--identity-file"], options["--ipport"])
if options.has_key("--ssh-options"):
command += ' ' + options["--ssh-options"]
- try:
- conn = fspawn(options, command)
- except pexpect.ExceptionPexpect, ex:
- sys.stderr.write(str(ex) + "\n")
- syslog.syslog(syslog.LOG_ERR, str(ex))
- sys.stderr.write("Due to limitations, binary dependencies on fence agents "
- "are not in the spec file and must be installed separately." + "\n")
- sys.exit(EC_GENERIC_ERROR)
+
+ conn = fspawn(options, command)
result = conn.log_expect(options, [ "Enter passphrase for key '" + options["--identity-file"] + "':",\
"Are you sure you want to continue connecting (yes/no)?" ] + options["--command-prompt"], int(options["--login-timeout"]))
@@ -1034,16 +1022,9 @@ def fence_login(options, re_login_string = "(login\s*: )|(Login Name: )|(userna
else:
fail_usage("Failed: You have to enter passphrase (-p) for identity file")
else:
- try:
- conn = fspawn(options, TELNET_PATH)
- conn.send("set binary\n")
- conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
- except pexpect.ExceptionPexpect, ex:
- sys.stderr.write(str(ex) + "\n")
- syslog.syslog(syslog.LOG_ERR, str(ex))
- sys.stderr.write("Due to limitations, binary dependencies on fence agents "
- "are not in the spec file and must be installed separately." + "\n")
- sys.exit(EC_GENERIC_ERROR)
+ conn = fspawn(options, TELNET_PATH)
+ conn.send("set binary\n")
+ conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
result = conn.log_expect(options, re_login, int(options["--login-timeout"]))
conn.send_eol(options["--username"])
diff --git a/fence/agents/netio/fence_netio.py b/fence/agents/netio/fence_netio.py
index ffb6e30..3cbf489 100755
--- a/fence/agents/netio/fence_netio.py
+++ b/fence/agents/netio/fence_netio.py
@@ -79,15 +79,9 @@ block any necessary fencing actions."
## We can not use fence_login(), username and passwd are sent on one line
####
try:
- try:
- conn = fspawn(options, TELNET_PATH)
- conn.send("set binary\n")
- conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
- except pexpect.ExceptionPexpect, ex:
- sys.stderr.write(str(ex) + "\n")
- sys.stderr.write("Due to limitations, binary dependencies on fence agents "
- "are not in the spec file and must be installed separately." + "\n")
- sys.exit(EC_GENERIC_ERROR)
+ conn = fspawn(options, TELNET_PATH)
+ conn.send("set binary\n")
+ conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
screen = conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
conn.log_expect(options, "100 HELLO .*", int(options["--shell-timeout"]))
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 311a865..d824e7d 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -193,15 +193,9 @@ is running because the connection will block any necessary fencing actions."
if options["--action"] in ["off", "reboot"]:
time.sleep(int(options["--delay"]))
- try:
- conn = fspawn(options, TELNET_PATH)
- conn.send("set binary\n")
- conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
- except pexpect.ExceptionPexpect, ex:
- sys.stderr.write(str(ex) + "\n")
- sys.stderr.write("Due to limitations, binary dependencies on fence agents "
- "are not in the spec file and must be installed separately." + "\n")
- sys.exit(EC_GENERIC_ERROR)
+ conn = fspawn(options, TELNET_PATH)
+ conn.send("set binary\n")
+ conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE)
re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["--command-prompt"])), re.IGNORECASE)
10 years, 1 month
fence-agents: master - fence_wti: Respect --delay in telnet connection
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=ab73cb...
Commit: ab73cbc40309f16025669f754811c8e82ea8265b
Parent: a90a90cf56f713be9a4064a02c0f630425b2091c
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Mar 21 12:05:36 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Mar 21 12:05:36 2014 +0100
fence_wti: Respect --delay in telnet connection
Previously --delay was respected only in ssh connection because fence_wti uses different login
mechanism.
Resolves: rhbz#1079282
---
fence/agents/wti/fence_wti.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index c9c5237..311a865 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -190,6 +190,9 @@ is running because the connection will block any necessary fencing actions."
#####
if 0 == options.has_key("--ssh"):
try:
+ if options["--action"] in ["off", "reboot"]:
+ time.sleep(int(options["--delay"]))
+
try:
conn = fspawn(options, TELNET_PATH)
conn.send("set binary\n")
10 years, 1 month
cluster: RHEL511 - rgmanager: Fix for clustat crash when using an invalid config
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=fde6e0e3a1f...
Commit: fde6e0e3a1fc1dac3b95d7cd96315bb2231ccfd5
Parent: a2140f35bd8cd7b01cbf8c94f9fd7e12b6b59302
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 13 14:24:50 2014 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 14:24:50 2014 -0400
rgmanager: Fix for clustat crash when using an invalid config
Fix for a crash in clustat when executed with an invalid cluster
configuration file.
Resolves: rhbz#853083
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/utils/clustat.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/utils/clustat.c b/rgmanager/src/utils/clustat.c
index e9fc4ef..d0ccbf8 100644
--- a/rgmanager/src/utils/clustat.c
+++ b/rgmanager/src/utils/clustat.c
@@ -980,6 +980,10 @@ build_member_list(cman_handle_t ch, int *lid)
/* See if our config has anyone missed. If so, flag
them as missing from the config file */
+ if (!all->cml_members) {
+ all->cml_count = 0;
+ fprintf(stderr, "Error: ccs returned no members. Output may be unreliable.\n");
+ }
all = add_missing(all, part);
/* Flag online nodes */
10 years, 1 month
cluster: RHEL511 - rgmanager: lvm.sh: Prevent shell expansion when calling the find command
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=a2140f35bd8...
Commit: a2140f35bd8cd7b01cbf8c94f9fd7e12b6b59302
Parent: e6d4bcebbb938d17a5a6b31b465922ac1787229e
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 13 13:42:50 2014 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:42:50 2014 -0400
rgmanager: lvm.sh: Prevent shell expansion when calling the find command
Prevent shell expansion of * when calling the find command.
Resolves: rhbz#1020279
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/lvm.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/lvm.sh b/rgmanager/src/resources/lvm.sh
index 28cd822..7ad8865 100755
--- a/rgmanager/src/resources/lvm.sh
+++ b/rgmanager/src/resources/lvm.sh
@@ -105,7 +105,7 @@ function ha_lvm_proper_setup_check
# the control of rgmanager
##
# Fixme: we might be able to perform a better check...
- if [ "$(find /boot -name *.img -newer /etc/lvm/lvm.conf)" == "" ]; then
+ if [ "$(find /boot -name '*.img' -newer /etc/lvm/lvm.conf)" == "" ]; then
ocf_log err "HA LVM: Improper setup detected"
ocf_log err "- initrd image needs to be newer than lvm.conf"
10 years, 1 month
cluster: RHEL511 - rgmanager: vm.sh: Allow "timeout" to be specified for Xen VMs
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=e6d4bcebbb9...
Commit: e6d4bcebbb938d17a5a6b31b465922ac1787229e
Parent: 44f44766b02d5b16b9345d37d58d9184ab423889
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 13 13:38:05 2014 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:38:05 2014 -0400
rgmanager: vm.sh: Allow "timeout" to be specified for Xen VMs
Allow "timeout" to be specified when using the xm command to
match the behavior when using the virsh command.
Patch from Raphaël Enrici <raphael(a)root-42.com>
Resolves: rhbz#924694
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 7310da3..f98356f 100755
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -417,7 +417,7 @@ do_virsh_start()
do_xm_stop()
{
- declare -i timeout=60
+ declare -i timeout=$(get_timeout)
declare -i ret=1
declare st
@@ -425,7 +425,7 @@ do_xm_stop()
echo "CMD: xm $op $OCF_RESKEY_name"
xm $op $OCF_RESKEY_name
- timeout=60
+ timeout=$(get_timeout)
while [ $timeout -gt 0 ]; do
sleep 5
((timeout -= 5))
10 years, 1 month
cluster: RHEL511 - rgmanager: postgres-8.sh: Shutdown postgres with SIGINT before forcing SIGQUIT
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=44f44766b02...
Commit: 44f44766b02d5b16b9345d37d58d9184ab423889
Parent: ddb0cfbd344395f63dce31794bb7eea3f7be1ce8
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 13 13:31:47 2014 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:31:47 2014 -0400
rgmanager: postgres-8.sh: Shutdown postgres with SIGINT before forcing SIGQUIT
Apply commit 2f19b4b9a2158e0c1ccf895fef88372d6e3213d8 from resource-agents git
tree.
SIGINT should be attempted shutdown the postgres server before
issuing a SIGQUIT to force the shutdown. The shutdown signals
are documented here.
http://www.postgresql.org/docs/8.4/static/server-shutdown.html
Patch by David Vossel <dvossel(a)redhat.com>
Adjusted to make it apply over this tree.
Resolves: rhbz#1035034
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/postgres-8.metadata | 4 ++--
rgmanager/src/resources/postgres-8.sh | 5 +++--
rgmanager/src/resources/utils/ra-skelet.sh | 15 ++++++++++++---
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/rgmanager/src/resources/postgres-8.metadata b/rgmanager/src/resources/postgres-8.metadata
index b061fc5..f8d91d8 100644
--- a/rgmanager/src/resources/postgres-8.metadata
+++ b/rgmanager/src/resources/postgres-8.metadata
@@ -87,8 +87,8 @@
</parameters>
<actions>
- <action name="start" timeout="0"/>
- <action name="stop" timeout="0"/>
+ <action name="start" timeout="30"/>
+ <action name="stop" timeout="30"/>
<!-- Checks to see if it''s mounted in the right place -->
<action name="status" interval="1m" timeout="10"/>
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
index 585da6a..e2ef011 100755
--- a/rgmanager/src/resources/postgres-8.sh
+++ b/rgmanager/src/resources/postgres-8.sh
@@ -37,6 +37,7 @@ declare PSQL_CTL="/usr/bin/pg_ctl"
declare PSQL_pid_file="`generate_name_for_pid_file`"
declare PSQL_conf_dir="`generate_name_for_conf_dir`"
declare PSQL_gen_config_file="$PSQL_conf_dir/postgresql.conf"
+declare PSQL_stop_timeout="15"
declare PSQL_kill_timeout="5"
verify_all()
@@ -190,8 +191,8 @@ stop()
{
clog_service_stop $CLOG_INIT
- ## Send -KILL signal immediately
- stop_generic_sigkill "$PSQL_pid_file" 0 "$PSQL_kill_timeout"
+ ## Send -INT to close connections and stop. -QUIT is used if -INT signal does not stop process.
+ stop_generic_sigkill "$PSQL_pid_file" "$PSQL_stop_timeout" "$PSQL_kill_timeout" "-INT"
if [ $? -ne 0 ]; then
clog_service_stop $CLOG_FAILED
return $OCF_ERR_GENERIC
diff --git a/rgmanager/src/resources/utils/ra-skelet.sh b/rgmanager/src/resources/utils/ra-skelet.sh
index 171ecd1..f1c3d70 100644
--- a/rgmanager/src/resources/utils/ra-skelet.sh
+++ b/rgmanager/src/resources/utils/ra-skelet.sh
@@ -47,9 +47,14 @@ stop_generic()
{
declare pid_file="$1"
declare stop_timeout="$2"
+ declare stop_sig="$3"
declare pid;
declare count=0;
+ if [ -z "$stop_sig" ]; then
+ stop_sig="-TERM"
+ fi
+
if [ ! -e "$pid_file" ]; then
clog_check_file_exist $CLOG_FAILED_NOT_FOUND "$pid_file"
# In stop-after-stop situation there is no PID file but
@@ -74,7 +79,7 @@ stop_generic()
return 0;
fi
- kill -TERM "$pid"
+ kill $stop_sig "$pid"
if [ $? -ne 0 ]; then
return $OCF_ERR_GENERIC
@@ -100,12 +105,16 @@ stop_generic_sigkill() {
declare pid_file="$1"
declare stop_timeout="$2"
declare kill_timeout="$3"
+ declare stop_sig="$4"
declare pid
-
+
+ if [ -z "$stop_sig" ]; then
+ stop_sig="-TERM"
+ fi
## If stop_timeout is equal to zero then we do not want
## to give -TERM signal at all.
if [ $stop_timeout -ne 0 ]; then
- stop_generic "$pid_file" "$stop_timeout"
+ stop_generic "$pid_file" "$stop_timeout" "$stop_sig"
if [ $? -eq 0 ]; then
return 0;
fi
10 years, 1 month
cluster: RHEL511 - postgres-8.sh: Add "startup_wait" attribute
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=ddb0cfbd344...
Commit: ddb0cfbd344395f63dce31794bb7eea3f7be1ce8
Parent: f5e510ffc9f762093d6d83b5d5876f50b892868a
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 13 13:21:41 2014 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:21:41 2014 -0400
postgres-8.sh: Add "startup_wait" attribute
Add a "startup_wait" attribute that allows for enough time
for pg_ctl to detect a successful startup.
Patch from John Ruemker <jruemker(a)redhat.com>
Resolves: rhbz#1035023
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/postgres-8.metadata | 10 ++++++++++
rgmanager/src/resources/postgres-8.sh | 15 ++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/rgmanager/src/resources/postgres-8.metadata b/rgmanager/src/resources/postgres-8.metadata
index 67c863e..b061fc5 100644
--- a/rgmanager/src/resources/postgres-8.metadata
+++ b/rgmanager/src/resources/postgres-8.metadata
@@ -63,6 +63,16 @@
<content type="number" />
</parameter>
+ <parameter name="startup_wait">
+ <longdesc lang="en">
+ Wait X seconds for correct end of service startup
+ </longdesc>
+ <shortdesc lang="en">
+ Wait X seconds for correct end of service startup.
+ </shortdesc>
+ <content type="number" default="10"/>
+ </parameter>
+
<parameter name="service_name" inherit="service%name">
<longdesc lang="en">
Inherit the service name. We need to know
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
index f99e32d..585da6a 100755
--- a/rgmanager/src/resources/postgres-8.sh
+++ b/rgmanager/src/resources/postgres-8.sh
@@ -38,7 +38,6 @@ declare PSQL_pid_file="`generate_name_for_pid_file`"
declare PSQL_conf_dir="`generate_name_for_conf_dir`"
declare PSQL_gen_config_file="$PSQL_conf_dir/postgresql.conf"
declare PSQL_kill_timeout="5"
-declare PSQL_wait_after_start="2"
verify_all()
{
@@ -122,6 +121,7 @@ start()
{
declare ccs_fd;
declare pguser_group
+ declare count=0
clog_service_start $CLOG_INIT
@@ -167,12 +167,17 @@ start()
su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_POSTMASTER -c config_file=\"$PSQL_gen_config_file\" \
$OCF_RESKEY_postmaster_options" &> /dev/null &
- # We need to sleep for a second to allow pg_ctl to detect that we've started.
- sleep $PSQL_wait_after_start
+ # We need to sleep briefly to allow pg_ctl to detect that we've started.
# We need to fetch "-D /path/to/pgsql/data" from $OCF_RESKEY_postmaster_options
- su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_CTL status $OCF_RESKEY_postmaster_options" &> /dev/null
+ until [ "$count" -gt "$OCF_RESKEY_startup_wait" ] ||
+ [ `su - "$OCF_RESKEY_postmaster_user" -c \
+ "$PSQL_CTL status $OCF_RESKEY_postmaster_options" &> /dev/null; echo $?` = '0' ]
+ do
+ sleep 1
+ let count=$count+1
+ done
- if [ $? -ne 0 ]; then
+ if [ "$count" -gt "$OCF_RESKEY_startup_wait" ]; then
clog_service_start $CLOG_FAILED
return $OCF_ERR_GENERIC
fi
10 years, 1 month
cluster: RHEL511 - postgres-8: Improve testing if postgres started succesfully
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=f5e510ffc9f...
Commit: f5e510ffc9f762093d6d83b5d5876f50b892868a
Parent: 24d751325ef921e73dc28ba64a13d581a2ea442f
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Apr 8 15:16:58 2011 +0200
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:21:04 2014 -0400
postgres-8: Improve testing if postgres started succesfully
In previous versions we were not testing if postgres started succesfully. If
starting failed then we will encounter problem in first attempt to test
availability. This new feature proposed by Magnus Glatz uses pg_ctl to check
this directly.
Resolves: rhbz#663827 (part 2/2)
Acked-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/postgres-8.sh | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
index 8762d36..f99e32d 100755
--- a/rgmanager/src/resources/postgres-8.sh
+++ b/rgmanager/src/resources/postgres-8.sh
@@ -33,10 +33,12 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
. $(dirname $0)/utils/ra-skelet.sh
declare PSQL_POSTMASTER="/usr/bin/postmaster"
+declare PSQL_CTL="/usr/bin/pg_ctl"
declare PSQL_pid_file="`generate_name_for_pid_file`"
declare PSQL_conf_dir="`generate_name_for_conf_dir`"
declare PSQL_gen_config_file="$PSQL_conf_dir/postgresql.conf"
declare PSQL_kill_timeout="5"
+declare PSQL_wait_after_start="2"
verify_all()
{
@@ -165,6 +167,11 @@ start()
su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_POSTMASTER -c config_file=\"$PSQL_gen_config_file\" \
$OCF_RESKEY_postmaster_options" &> /dev/null &
+ # We need to sleep for a second to allow pg_ctl to detect that we've started.
+ sleep $PSQL_wait_after_start
+ # We need to fetch "-D /path/to/pgsql/data" from $OCF_RESKEY_postmaster_options
+ su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_CTL status $OCF_RESKEY_postmaster_options" &> /dev/null
+
if [ $? -ne 0 ]; then
clog_service_start $CLOG_FAILED
return $OCF_ERR_GENERIC
10 years, 1 month
cluster: RHEL511 - postgres-8: Do not send -TERM signal when killing postgres
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=24d751325ef...
Commit: 24d751325ef921e73dc28ba64a13d581a2ea442f
Parent: 1c64c5311961697a66ba3ee745e7b1d847409c8c
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Apr 8 15:03:41 2011 +0200
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 13 13:20:22 2014 -0400
postgres-8: Do not send -TERM signal when killing postgres
Sending SIGQUIT will ensure Postgres shutdowns immediately, preventing
a service failure in some scenarios. Leads to recovery of transactions
when started up again, for example on a new node - which makes sense.
Also works nice with live streaming replication setups between two databases.
Resolves: rhbz#663827 (part 1/2)
Acked-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/postgres-8.metadata | 4 +++-
rgmanager/src/resources/postgres-8.sh | 3 ++-
rgmanager/src/resources/utils/ra-skelet.sh | 10 +++++++---
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/rgmanager/src/resources/postgres-8.metadata b/rgmanager/src/resources/postgres-8.metadata
index 760e865..67c863e 100644
--- a/rgmanager/src/resources/postgres-8.metadata
+++ b/rgmanager/src/resources/postgres-8.metadata
@@ -53,10 +53,12 @@
<parameter name="shutdown_wait">
<longdesc lang="en">
- Wait X seconds for correct end of service shutdown
+ Wait X seconds for correct end of service shutdown.
+ This option is ignored in current release.
</longdesc>
<shortdesc lang="en">
Wait X seconds for correct end of service shutdown
+ This option is ignored in current release.
</shortdesc>
<content type="number" />
</parameter>
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
index c7c0e6b..8762d36 100755
--- a/rgmanager/src/resources/postgres-8.sh
+++ b/rgmanager/src/resources/postgres-8.sh
@@ -178,7 +178,8 @@ stop()
{
clog_service_stop $CLOG_INIT
- stop_generic_sigkill "$PSQL_pid_file" "$OCF_RESKEY_shutdown_wait" "$PSQL_kill_timeout"
+ ## Send -KILL signal immediately
+ stop_generic_sigkill "$PSQL_pid_file" 0 "$PSQL_kill_timeout"
if [ $? -ne 0 ]; then
clog_service_stop $CLOG_FAILED
return $OCF_ERR_GENERIC
diff --git a/rgmanager/src/resources/utils/ra-skelet.sh b/rgmanager/src/resources/utils/ra-skelet.sh
index be7b548..171ecd1 100644
--- a/rgmanager/src/resources/utils/ra-skelet.sh
+++ b/rgmanager/src/resources/utils/ra-skelet.sh
@@ -102,9 +102,13 @@ stop_generic_sigkill() {
declare kill_timeout="$3"
declare pid
- stop_generic "$pid_file" "$stop_timeout"
- if [ $? -eq 0 ]; then
- return 0;
+ ## If stop_timeout is equal to zero then we do not want
+ ## to give -TERM signal at all.
+ if [ $stop_timeout -ne 0 ]; then
+ stop_generic "$pid_file" "$stop_timeout"
+ if [ $? -eq 0 ]; then
+ return 0;
+ fi
fi
read pid < "$pid_file"
10 years, 1 month
fence-agents: master - fencing: fixed pexpect TypeError exception, when using identity file for login via ssh
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=a90a90...
Commit: a90a90cf56f713be9a4064a02c0f630425b2091c
Parent: a6f6979c26b474ac0ef2695a39e45fcf26fa57f2
Author: Ondrej Mular <omular(a)redhat.com>
AuthorDate: Fri Mar 7 09:43:00 2014 -0500
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Mar 12 16:44:59 2014 +0100
fencing: fixed pexpect TypeError exception, when using identity file for login via ssh
Previously, fence-agent failed to log in (ssh) using identity file. This caused fence-agent failure because of uncaught exception.
Resolves: rhbz#1073947
Signed-off-by: Marek 'marx' Grac <mgrac(a)redhat.com>
---
fence/agents/lib/fencing.py.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 2006f0d..76855e1 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -1022,13 +1022,12 @@ def fence_login(options, re_login_string = "(login\s*: )|(Login Name: )|(userna
"are not in the spec file and must be installed separately." + "\n")
sys.exit(EC_GENERIC_ERROR)
- result = conn.log_expect(options, [ options["--command-prompt"], \
- "Are you sure you want to continue connecting (yes/no)?", \
- "Enter passphrase for key '" + options["--identity-file"] + "':" ], int(options["--login-timeout"]))
+ result = conn.log_expect(options, [ "Enter passphrase for key '" + options["--identity-file"] + "':",\
+ "Are you sure you want to continue connecting (yes/no)?" ] + options["--command-prompt"], int(options["--login-timeout"]))
if result == 1:
conn.sendline("yes")
- conn.log_expect(options, [ options["--command-prompt"], "Enter passphrase for key '"+options["--identity-file"]+"':"] , int(options["--login-timeout"]))
- if result != 0:
+ result = conn.log_expect(options, [ "Enter passphrase for key '"+options["--identity-file"]+"':"] + options["--command-prompt"], int(options["--login-timeout"]))
+ if result == 0:
if options.has_key("--password"):
conn.sendline(options["--password"])
conn.log_expect(options, options["--command-prompt"], int(options["--login-timeout"]))
10 years, 1 month