#985 Issue closed: TSM parameters containing a dot

Labels: enhancement, fixed / solved / done, minor bug

stermeau opened issue at 2016-08-25 13:52:

  • rear version (/usr/sbin/rear -V): Relax-and-Recover 1.17.2
  • OS version (cat /etc/rear/os.conf or lsb_release -a): RHEL 6
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    PROGS=( "${PROGS[@]}" screen )
    GRUB_RESCUE=n
    USE_STATIC_NETWORKING=y
    BACKUP=TSM
    OUTPUT=ISO
    TIMESYNC=NTP
    AUTOEXCLUDE_MULTIPATH=y
    COPY_AS_IS=( "${COPY_AS_IS[@]}" )
    COPY_AS_IS_TSM=( "${COPY_AS_IS_TSM[@]}" /.tsm /.tsm_ora)
    POST_RECOVERY_SCRIPT='cp /etc/adsm/TSM.PWD /mnt/local/etc/adsm'
    SSH_ROOT_PASSWORD="XXXXX"
    ISO_PREFIX="rear-XXXX"
  • Brief description of the issue
    If dsm.sys includes an option that has a dot in its name, 'rear recover' fails with
    /usr/share/rear/verify/TSM/default/40_verify_tsm.sh: line 12: export: `TSM_SYS_INCLUDE.ENCRYPT=/.../*': not a valid identifier
  • Work-around, if any
    Replace 'tr a-z A-Z' by 'tr a-z. A-Z_' in 40_verify_tsm.sh
    See
    https://github.com/stermeau/rear/commit/f14bdce3f3529c27497338afd70926e46db59f68

gdha commented at 2016-08-25 14:09:

@stermeau How do we know it won't break other users rear/TSM setups?

stermeau commented at 2016-08-26 07:27:

@gdha This script loads all the TSM options in variables called TSM_SYS_XXX but only TSM_SYS_TCPSERVERADDRESS is ever used.
`
$ grep -r TSM_SYS /usr/share/rear/

/usr/share/rear/verify/TSM/default/40_verify_tsm.sh:while read KEY VALUE ; do echo "$KEY" | grep -q '*' && continue ; test -z "$KEY" && continue ; KEY="$(echo "$KEY" | tr a-z A-Z)" ; export TSM_SYS_$KEY="${VALUE//"}" ; done </opt/tivoli/tsm/client/ba/bin/dsm.sys

/usr/share/rear/verify/TSM/default/40_verify_tsm.sh:[ "${TSM_SYS_TCPSERVERADDRESS}" ]

/usr/share/rear/verify/TSM/default/40_verify_tsm.sh: ping -c 1 "${TSM_SYS_TCPSERVERADDRESS}" >&8 2>&1

/usr/share/rear/verify/TSM/default/40_verify_tsm.sh: StopIfError "Sorry, but cannot reach TSM Server ${TSM_SYS_TCPSERVERADDRESS}"

/usr/share/rear/verify/TSM/default/40_verify_tsm.sh: Log "TSM Server ${TSM_SYS_TCPSERVERADDRESS} seems to be up and running."
`

TSM has several options with a dot in their name like INCLUDE.FS or INCLUDE.ENCRYPT. The patch itself just replaces dots by underscores in the key name. If someone is using an option like this rear will fail during a restore

gdha commented at 2016-08-26 07:29:

@stermeau OK you can request a pull request

stermeau commented at 2016-08-26 07:37:

@gdha Thanks. I have opened the pull request #986


[Export of Github issue for rear/rear.]