ClusterLabs / ClusterLabs/resource-agents

findif.sh sometimes runs into odd bugs

Open
#976 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
519
Forks
608
Avg merge
6d 1h
Merged PRs (30d)
7

Description

Hi!
I faces this strange issue several times already, both on pretty old Oracle Linux 6.x and on current CentOS 7.3. Here is basically what the issue is:
```IPaddr2(vip42)[9441]: 2017/05/09_23:15:20 ERROR: Unknown interface [eth0] No such device.
IPaddr2(vip42)[9441]: 2017/05/09_23:15:20 ERROR: [findif] failed
May 09 23:15:20 [3140] flashfon1 lrmd: notice: operation_finished: vip42_monitor_30000:9441:stderr [ /usr/lib/ocf/lib/heartbeat/findif.sh: line 11: /proc/net/dev: Not a directory ]
May 09 23:15:20 [3140] flashfon1 lrmd: notice: operation_finished: vip42_monitor_30000:9441:stderr [ ocf-exit-reason:Unknown interface [eth0] No such device. ]
May 09 23:15:20 [3143] flashfon1 crmd: info: process_lrm_event: Result of monitor operation for vip42 on flashfon1: 6 (not configured) | call=415 key=vip42_monitor_30000 confirmed=false cib-update=3139
May 09 23:15:20 [3143] flashfon1 crmd: notice: process_lrm_event: flashfon1-vip42_monitor_30000:415 [ /usr/lib/ocf/lib/heartbeat/findif.sh: line 11: /proc/net/dev: Not a directory\nocf-exit-reason:Unknown interface [eth0] N
o such device.\n ]
```
If we look into findif.sh, we see this:
```ifcheck_ipv4() {
local ifcheck=$1
local procfile="/proc/net/dev"
local ifstr rest

while read ifstr rest ; do
# Interface name may be concatenated to Receive field with ':'
case "$ifstr" in
"$ifcheck:"*) return 0;;
esac
done < $procfile
return 1
}
```
HOW is it possible to get the error mentioned above?!?
Needless to say interface is in place (and actually IP is there too).
One thing I would propose - may be we try not to split the lines like `ifstr` and `rest` but rather set `IFS` to something like '\n', and `cut -d ":" -f1`? Though I stil do not understand the error...

PS. CentOS 7.3 with updates and recent pacemaker/agents from official repo...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.