Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue xdcp EXECUTE of .post script not working as expected #5987 #5997

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

immarvin
Copy link
Contributor

The PR is to fix issue #5987

The .post script will be run if:

  1. <file> is updated, or
  2. <file>.post is updated

UT:

the sync list file:

[root@boston36 xCAT]# cat /install/custom/synclist
/etc/test -> /tmp/etc/test
/etc/test.post -> /tmp/etc/test.post
EXECUTE:
/etc/test.post
[root@boston36 xCAT]# cat /etc/test.post
#!/bin/bash
date >> /tmp/hosts.date
  1. perform file sync first, the /etc/test.post is invoked:
[root@boston36 xCAT]# ssh mid21tor24cn01 'echo ""> /tmp/hosts.date'
[root@boston36 xCAT]# ssh mid21tor24cn01 cat /tmp/hosts.date

[root@boston36 xCAT]# ssh mid21tor24cn01 rm  /tmp/etc/test
[root@boston36 xCAT]# ssh mid21tor24cn01 rm   /tmp/etc/test.post
[root@boston36 xCAT]# xdcp mid21tor24cn01 -v -T -F /install/custom/synclist
TRACE:Default context is XCAT.
TRACE:Fanout Value is 64.
TRACE:Timeout Value is .
TRACE:Verifying remaining targets with pping command.
 TRACE: Executing Command:/bin/sh -c /tmp/rsync_mid21tor24cn01
TRACE:Default context is XCAT
TRACE:Node RSH is
TRACE: Fanout value is 64.
TRACE: Timeout value is
TRACE: Verify value is
TRACE: Execute option specified.
TRACE:Execute: Exporting File:/usr/bin/scp -B /etc/test.post root@mid21tor24cn01:/tmp/Fb9lLdGrEN.dsh
Command name: /usr/bin/ssh -o BatchMode=yes -x root@mid21tor24cn01 export NODE=mid21tor24cn01; export LANG=en_US.UTF-8 LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C PERL_BADLANG=0 ;  /tmp/Fb9lLdGrEN.dsh ; export DSH_TARGET_RC=$?; echo ":DSH_TARGET_RC=${DSH_TARGET_RC}:";rm /tmp/Fb9lLdGrEN.dsh
[root@boston36 xCAT]# ssh mid21tor24cn01 cat /tmp/hosts.date

Tue Feb 12 03:12:42 EST 2019
[root@boston36 xCAT]#
  1. nothing will be invoked on 2nd time file sync operation, due to nothing is updated
[root@boston36 xCAT]# xdcp mid21tor24cn01 -v -T -F /install/custom/synclist
TRACE:Default context is XCAT.
TRACE:Fanout Value is 64.
TRACE:Timeout Value is .
TRACE:Verifying remaining targets with pping command.
 TRACE: Executing Command:/bin/sh -c /tmp/rsync_mid21tor24cn01
[root@boston36 xCAT]# ssh mid21tor24cn01 cat /tmp/hosts.date

Tue Feb 12 03:12:42 EST 2019
[root@boston36 xCAT]#
  1. /etc/test.post will be invoked if /etc/test is updated:
[root@boston36 xCAT]# touch /etc/test
[root@boston36 xCAT]# xdcp mid21tor24cn01 -v -T -F /install/custom/synclist
TRACE:Default context is XCAT.
TRACE:Fanout Value is 64.
TRACE:Timeout Value is .
TRACE:Verifying remaining targets with pping command.
 TRACE: Executing Command:/bin/sh -c /tmp/rsync_mid21tor24cn01
TRACE:Default context is XCAT
TRACE:Node RSH is
TRACE: Fanout value is 64.
TRACE: Timeout value is
TRACE: Verify value is
TRACE: Execute option specified.
TRACE:Execute: Exporting File:/usr/bin/scp -B /etc/test.post root@mid21tor24cn01:/tmp/Fb9lLdGrEN.dsh
Command name: /usr/bin/ssh -o BatchMode=yes -x root@mid21tor24cn01 export NODE=mid21tor24cn01; export LANG=en_US.UTF-8 LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C PERL_BADLANG=0 ;  /tmp/Fb9lLdGrEN.dsh ; export DSH_TARGET_RC=$?; echo ":DSH_TARGET_RC=${DSH_TARGET_RC}:";rm /tmp/Fb9lLdGrEN.dsh
[root@boston36 xCAT]# ssh mid21tor24cn01 cat /tmp/hosts.date

Tue Feb 12 03:12:42 EST 2019
Tue Feb 12 03:15:14 EST 2019
[root@boston36 xCAT]#
  1. /etc/test.post will be invoked if /etc/test.post is updated:
[root@boston36 xCAT]# touch /etc/test.post
[root@boston36 xCAT]# xdcp mid21tor24cn01 -v -T -F /install/custom/synclist
TRACE:Default context is XCAT.
TRACE:Fanout Value is 64.
TRACE:Timeout Value is .
TRACE:Verifying remaining targets with pping command.
 TRACE: Executing Command:/bin/sh -c /tmp/rsync_mid21tor24cn01
TRACE:Default context is XCAT
TRACE:Node RSH is
TRACE: Fanout value is 64.
TRACE: Timeout value is
TRACE: Verify value is
TRACE: Execute option specified.
TRACE:Execute: Exporting File:/usr/bin/scp -B /etc/test.post root@mid21tor24cn01:/tmp/Fb9lLdGrEN.dsh
Command name: /usr/bin/ssh -o BatchMode=yes -x root@mid21tor24cn01 export NODE=mid21tor24cn01; export LANG=en_US.UTF-8 LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C PERL_BADLANG=0 ;  /tmp/Fb9lLdGrEN.dsh ; export DSH_TARGET_RC=$?; echo ":DSH_TARGET_RC=${DSH_TARGET_RC}:";rm /tmp/Fb9lLdGrEN.dsh
[root@boston36 xCAT]# ssh mid21tor24cn01 cat /tmp/hosts.date

Tue Feb 12 03:12:42 EST 2019
Tue Feb 12 03:15:14 EST 2019
Tue Feb 12 03:16:00 EST 2019
[root@boston36 xCAT]#

@immarvin
Copy link
Contributor Author

seems the travis error has nothing to do with the PR

@wrighrc
Copy link

wrighrc commented Feb 12, 2019

Thank you for fixing this. I look forward to being able to test it again.

@cxhong
Copy link
Contributor

cxhong commented Feb 12, 2019

@immarvin , Thanks to fix this.
Maybe we should update xCAT doc and put more words for how and .post are related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants