Serf does not start from cloudynitzar.sh because PUBLIC_IP is not found in /etc/init.d/serf:
ip addr show dev eth0 called from /etc/init.d/serf can have the work "dynamic" or not between "global" and "eth0". (below examples cloudy4 and cloudy5)
but in /etc/init.d/serf the condition
PUBLIC_IP=$(ip addr show dev $SERF_INTERFACE|grep "global.* $SERF_INTERFACE\$"|awk '{print $2}'|awk -F "/" {'print $1'})
only works for the case without "dynamic" (case cloudy5), in case of cloudy4 the variable PUBLIC_IP is empty (because of "dynamic") and serf does not start.
It seems using PUBLIC_IP=$(ip addr show dev $SERF_INTERFACE|grep "global.*"|awk '{print $2}'|awk -F "/" {'print $1'})
without $SERF_INTERFACE\$ would capture the same line.
Cases: Cloudy4 does not work, cloudy5 works.
root@cloudy4:/etc/init.d# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:50:56:1c:01:0f brd ff:ff:ff:ff:ff:ff
inet 147.83.42.141/24 brd 147.83.42.255 scope global dynamic eth0
valid_lft 3429sec preferred_lft 3429sec
inet6 fe80::250:56ff:fe1c:10f/64 scope link
valid_lft forever preferred_lft forever
root@cloudy4:/etc/init.d#
root@cloudy5:/etc/init.d# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:50:56:1c:01:2b brd ff:ff:ff:ff:ff:ff
inet 147.83.42.188/24 brd 147.83.42.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe1c:12b/64 scope link
valid_lft forever preferred_lft forever
root@cloudy5:/etc/init.d#
Serf does not start from cloudynitzar.sh because PUBLIC_IP is not found in /etc/init.d/serf:
ip addr show dev eth0 called from /etc/init.d/serf can have the work "dynamic" or not between "global" and "eth0". (below examples cloudy4 and cloudy5)
but in /etc/init.d/serf the condition PUBLIC_IP=$(ip addr show dev $SERF_INTERFACE|grep "global.* $SERF_INTERFACE\$"|awk '{print $2}'|awk -F "/" {'print $1'})
only works for the case without "dynamic" (case cloudy5), in case of cloudy4 the variable PUBLIC_IP is empty (because of "dynamic") and serf does not start.
It seems using PUBLIC_IP=$(ip addr show dev $SERF_INTERFACE|grep "global.*"|awk '{print $2}'|awk -F "/" {'print $1'}) without $SERF_INTERFACE\$ would capture the same line.
Cases: Cloudy4 does not work, cloudy5 works.
root@cloudy4:/etc/init.d# ip addr show dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:1c:01:0f brd ff:ff:ff:ff:ff:ff inet 147.83.42.141/24 brd 147.83.42.255 scope global dynamic eth0 valid_lft 3429sec preferred_lft 3429sec inet6 fe80::250:56ff:fe1c:10f/64 scope link valid_lft forever preferred_lft forever root@cloudy4:/etc/init.d#
root@cloudy5:/etc/init.d# ip addr show dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:1c:01:2b brd ff:ff:ff:ff:ff:ff inet 147.83.42.188/24 brd 147.83.42.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe1c:12b/64 scope link valid_lft forever preferred_lft forever root@cloudy5:/etc/init.d#