BradleyA / pi-display

Displays are Pimoroni Blinkt, Scroll-pHAT, and Scroll-pHAT-HD connected to Raspberry Pi 3 using Triple GPIO Multiplexing Expansion Board
MIT License
3 stars 0 forks source link

create-message.sh coping wrong hostname files #26

Closed BradleyA closed 6 years ago

BradleyA commented 6 years ago

create-message.sh

server six create-message.sh creates correct docker information in four-rpi3B.cptx86.com on six (Running 1) but when create-message.sh copied the file (four-rpi3b.cptx86.com) from six to four the wrong docker information is copied to four-rpi3b.cptx86.com on host four-rpi3b (Running 0)

BradleyA commented 6 years ago

26 crap what a bug,

When copying the files in the order shown below, from host six-rpi3b.cptx86.com to host four-rpi3b.cptx86.com. The first two files are copied with the correct content, four-rpi3b.cptx86.com and five-rpi3b.cptx86.com.

When the third file is copied, LOCAL-HOST, which is a symbolic link on both systems. The file LOCAL-HOST, on host six-rpi3b.cptx86.com points to the file contents of file six-rpi3b.cptx86.com. The contents of file six-rpi3b.cptx86.com is copied to file LOCAL-HOST on host four-rpi3b.cptx86.com which points to file four-rpi3b.cptx86.com. This overwrites the contents of file four-rpi3b.cptx86.com with the content of file six-rpi3b.cptx86.com, BUT only on after the first run of create-message.sh. The first run of create-message.sh creates the symbolic links for LOCAL-HOST. That is why a single run of create-message.sh did NOT allow the incident to be reproduced.

This incident #26 would have effected any host with a host name that would appear in the listing (ls -l) before LOCAL-HOST.

$ ls -l /usr/local/data/us-tx-cluster-1/
total 36
-rw-rw-r-- 1 uadmin uadmin 198 Sep 22 11:37 five-rpi3b.cptx86.com
-rw-rw-r-- 1 uadmin uadmin 201 Sep 22 11:37 four-rpi3b.cptx86.com
lrwxrwxrwx 1 uadmin uadmin  20 Sep 22 11:37 LOCAL-HOST -> four-rpi3b.cptx86.com
-rw-rw-r-- 1 uadmin uadmin  55 Sep 22 11:37 MESSAGE
-rw-rw-r-- 1 uadmin uadmin 196 Sep 22 11:37 MESSAGEHD
-rw-rw-r-- 1 uadmin uadmin 198 Sep 22 11:37 one-rpi3b.cptx86.com
-rw-rw-r-- 1 uadmin uadmin 200 Sep 22 11:37 six-rpi3b.cptx86.com
-rw-rw-r-- 1 uadmin uadmin 562 Sep 22 11:38 SYSTEMS
-rw-rw-r-- 1 uadmin uadmin 201 Sep 22 11:37 three-rpi3b.cptx86.com