Comments (3)
A good patch that definitely makes sense in my opinion.
from resource-agents.
On Thu, Sep 20, 2012 at 06:40:14AM -0700, Timur Bakeyev wrote:
I was trying to use named RA from the GIT repository to get redundant DNS server(s) in my environment. Cluster is running on Debian 6.0 Squeeze with the stock corosync/pacemaker.
Configuration looks like:
primitive named ocf:heartbeat:named \ params named_user="bind" named_config="/etc/bind/named.conf" monitor_request="ns.domain.nl" monitor_response="10.0.0.201" \ op monitor interval="20s" timeout="30s" \ op start interval="0" timeout="60s" \ op stop interval="0" timeout="60s" clone run_named named \ meta clone-max="2" clone-node-max="1" target-role="Started" colocation use_named inf: ip_int run_named order activate_named inf: ip_int:start run_named:start
Log file showed that named is starting normally, but immediately gets killed. A bit of debugging of the RA revealed that although named is starting OK the following code that supposed to find it in the list of running processes fails to do so on whatever reason and named considered dead, effectively disabling RA:
pid=`ps -e -o pid,command,args | grep "$pattern" | grep -v grep | awk '{print $1}'`
It would be interesting to find out why this didn't work. Was
there "grep" somewhere in the ps output? Did you try to debug
this peace of code (if you 'set -x/set +x' surround the critical
part, it would be captured by lrmd and logged).
Running the same sequence(with expanded $pattern) from the command line perfectly worked and returned the PID of the named process.
I've tried to simplify the expression and replaced it with:
pid=`pgrep -f "$pattern"`
Which is a functional equivalent of the previous command.
Amusingly enough it worked fine and RA for the last two months didn't cause any problems.
Grepping RAs shows that at least 10 of them use "pgrep", so I'd consider it's presence in the system a hard dependency anyhow.
--- /root/GIT/resource-agents/heartbeat/named 2012-03-13 18:35:01.000000000 +0100 +++ named 2012-08-03 06:10:01.000000000 +0200 @@ -247,7 +247,7 @@ pattern="$pattern.*-c $OCF_RESKEY_named_config" fi - pid=`ps -e -o pid,command,args | grep "$pattern" | grep -v grep | awk '{print $1}'` + pid=`pgrep -f "$pattern"` echo $pid }
This patch looks fine to me.
from resource-agents.
Applied:
commit 7f2c3e9
Author: Serge Dubrouski [email protected]
Date: Wed Oct 3 15:46:49 2012 +0200
Medium: named: use pgrep instead of searching in ps(1) output (thanks to Timur Bakeyev)
from resource-agents.
Related Issues (20)
- ERROR: LXC container name not set! HOT 23
- How to use the parameter of monitor_script?
- Unable to get metadata for resource agent 'stonith:fence_watchdog' (SyntaxError:JSON.parse:unexpected character at line 1) HOT 2
- master-pgsql attribute disappear HOT 1
- AWS Pacemaker awsvip failing with different errors HOT 4
- Resource agent - AWS Lambda support HOT 2
- Postfix RA continuously fails validate check HOT 1
- iSCSITarget - don't create default portal HOT 4
- resource-agents/heartbeat/ZFS - '-f' to option HOT 1
- "ocf : heartbeat : docker" does not exists in resource-agent v4.10 HOT 1
- How can I create a galera resource with two nodes?
- Filesystem in RHEL9.3 takes considerably longer to complete its stop operation compared to RHEL9.2. HOT 12
- Discusses the VirtualDomain_start function HOT 5
- fails to build on Arch Linux HOT 2
- ocf : heartbeat : pgsql - 3-node PG HA Cluster with async streaming replication HOT 1
- `ocf_local_nodename` incorrectly detect pacemaker version causing incorrect behavior HOT 1
- ocf:heartbeat:Filesystem kills unrelated processes
- Avoid deprecated validate-with="none" usage in CIB
- IPaddr2/findif: new "fail when matching more than 1 route" breaks in my environment HOT 7
- ocf:heartbeat:docker-compose fails with docker compose HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resource-agents.