AlienGFX / AITools

Automated Installer Tools
MIT License
1 stars 0 forks source link

Bug return status code 0 with same unknow host (SSH) #1

Open AlienGFX opened 7 years ago

AlienGFX commented 7 years ago

Details

Updating on hosts : 1) a 2) b 3) c 4) unxdevtmp01

There are only unxdevtmp01 which is a real host. So return ssh status code should have 1 for a b and c hosts.

With aynchronous command ssh "$user@$host" "$cmd" > /dev/null 2>&1 &

Example : sudo ./aiss.sh update a b c

[PROD]
[0] ✓ krue@comserver ~/repository/AITools $ sudo ./aiss.sh update a b c unxdevtmp01
[20787] 2017/06/02 16:12:46 [SUCCESS] SVC_INFO   Calling AITools version 1.0 to run updater action by user[krue]
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   waitfor function has called during 2 secondes...
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   Update on a is success, more details: /tmp/.20787_20170602_161246_comserver_updater
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   Update on b is success, more details: /tmp/.20787_20170602_161246_comserver_updater
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   Update on c is success, more details: /tmp/.20787_20170602_161246_comserver_updater
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   Update on unxdevtmp01 is success, more details: /tmp/.20787_20170602_161246_comserver_updater
[20787] 2017/06/02 16:12:48 [SUCCESS] SVC_INFO   updater action has success, see more logs/20787_20170602_161246_AITools.log
[20787] 2017/06/02 16:12:49 [SUCCESS] SVC_INFO   Mail with sub AITools version 1.0 action [updater] pid [20787] has success sent to admin@rkservices.fr successfully

With synchronous command ssh "$user@$host" "$cmd" > /dev/null 2>&1

[PROD]
[0] ✓ krue@comserver ~/repository/AITools $ sudo ./aiss.sh update a b c unxdevtmp01
[20732] 2017/06/02 16:12:12 [SUCCESS] SVC_INFO   Calling AITools version 1.0 to run updater action by user[krue]
[20732] 2017/06/02 16:12:14 [SUCCESS] SVC_INFO   waitfor function has called during 2 secondes...
[20732] 2017/06/02 16:12:14 [ERROR]   SVC_ERR    Error during update on a, more details: /tmp/.20732_20170602_161212_comserver_updater
[20732] 2017/06/02 16:12:14 [ERROR]   SVC_ERR    Error during update on b, more details: /tmp/.20732_20170602_161212_comserver_updater
[20732] 2017/06/02 16:12:14 [ERROR]   SVC_ERR    Error during update on c, more details: /tmp/.20732_20170602_161212_comserver_updater
[20732] 2017/06/02 16:12:20 [SUCCESS] SVC_INFO   Update on unxdevtmp01 is success, more details: /tmp/.20732_20170602_161212_comserver_updater
[20732] 2017/06/02 16:12:20 [SUCCESS] SVC_INFO   updater action has success, see more logs/20732_20170602_161212_AITools.log
[20732] 2017/06/02 16:12:21 [SUCCESS] SVC_INFO   Mail with sub AITools version 1.0 action [updater] pid [20732] has success sent to admin@rkservices.fr successfully
AlienGFX commented 7 years ago

File lib/functions/core.sh Line 8 function RSH