six demon bag

Wind, fire, all that kind of thing!

2013-03-12

TSM BA Client 6.4 on Debian

Although IBM doesn't officially support its TSM client on Linux distributions other than SLES and RHEL the client works quite nicely on Debian. With version 6.4 you need at least the following 4 packages on AMD64 systems:

  • TIVsm-BA
  • TIVsm-API64
  • gskcrypt64
  • gskssl64


Use alien to convert the .rpm packages to .deb packages:

root@chrome:~/pkg/TSM-6.4.0.1 # alien --scripts TIVsm-BA.x86_64.rpm
tivsm-ba_6.4.0-2_amd64.deb generated
root@chrome:~/pkg/TSM-6.4.0.1 # alien --scripts TIVsm-API64.x86_64.rpm
tivsm-api64_6.4.0-2_amd64.deb generated
root@chrome:~/pkg/TSM-6.4.0.1 # alien --scripts gskcrypt64-8.0.14.14.linux.x86_64.rpm
gskcrypt64_8.0-15.14_amd64.deb generated
root@chrome:~/pkg/TSM-6.4.0.1 # alien --scripts gskssl64-8.0.14.14.linux.x86_64.rpm
gskssl64_8.0-15.14_amd64.deb generated

Then install the converted packages with dpkg.

dpkg -i tivsm-ba_6.4.0-2_amd64.deb
dpkg -i tivsm-api64_6.4.0-2_amd64.deb
dpkg -i gskcrypt64_8.0-15.14_amd64.deb
dpkg -i gskssl64_8.0-15.14_amd64.deb

If something's amiss with your locale settings the symbolic link to the language directory won't be created correctly and you may see a symlink like this in the program directory:

root@chrome:~ # ls -l /opt/tivoli/tsm/client/ba/bin | grep lang
lrwxrwxrwx 1 root root        16 Feb  7 14:33 ??_?? -> ../../lang/??_??

Fix it like this:

cd /opt/tivoli/tsm/client/ba/bin
rm \?\?_\?\?
ln -s ../../lang/EN_US .

Next fix the init script. The script IBM ships checks for the presence of either /etc/redhat-release or /etc/SuSE-release and exits with the message "This distribution is not supported" otherwise. Here's a diff that adds support for Debian to the script:

--- rc.dsmcad.orig  2013-02-07 19:05:21.000000000 +0100
+++ rc.dsmcad 2013-02-07 19:20:41.000000000 +0100
@@ -81,6 +81,35 @@
       rc_status -v
    }

+elif [ -f /etc/debian_version ]
+then
+  . /lib/lsb/init-functions
+
+  start_()
+  {
+    log_daemon_msg "Starting TSM Client Acceptor Daemon" "dsmcad"
+    if start-stop-daemon --start --quiet --oknodo --exec $DSMCAD_BIN; then
+      log_end_msg 0
+    else
+      log_end_msg 1
+    fi
+  }
+
+  stop_()
+  {
+    log_daemon_msg "Stopping TSM Client Acceptor Daemon" "dsmcad"
+    if start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --exec $DSMCAD_BIN; then
+      log_end_msg 0
+    else
+      log_end_msg 1
+    fi
+  }
+
+  status_()
+  {
+    status_of_proc $DSMCAD_BIN dsmcad && exit 0 || exit $?
+  }
+
 else
    echo "This distribution is not supported"
    exit 2

Create the configuration files:

/opt/tivoli/tsm/client/ba/bin/dsm.opt:

SERVERNAME            TSM_SERVER

COMPRESSALWAYS        YES
FOLLOWSYMBOLIC        NO
REPLACE               PROMPT

LANGUAGE              AMENG
DATEFORMAT            3

/opt/tivoli/tsm/client/ba/bin/dsm.sys:

SERVERNAME            TSM_SERVER
COMMMETHOD            tcpip
TCPSERVERADDRESS      tsm.example.org
TCPPORT               1500

NODENAME              CHROME
PASSWORDACCESS        generate
SCHEDMODE             polling
MANAGEDServices       schedule

SCHEDLOGNAME          /var/log/dsmsched.log
ERRORLOGNAME          /var/log/dsmerror.log
SCHEDLOGRETENTION     5
ERRORLOGRETENTION     5

PREschedulecmd '/usr/local/sbin/get_selections.sh'
INCLEXCL /etc/inclexcl.opt

VIRTUALMOUNTPOINT     /dir1
DOMAIN                /dir1

VIRTUALMOUNTPOINT     /dir2
DOMAIN                /dir2

*...

/etc/inclexcl.opt:

INCLUDE '/dir1/*'   MGMT_CLASS
INCLUDE '/dir2/*'   MGMT_CLASS
*...

EXCLUDE '/.../dsmsched.log'
EXCLUDE '/.../dsmerror.log'
EXCLUDE.DIR '/dir1/foo'
*...

* Exclude udev net rules to avoid tampering with network
* interfaces after a restore.
EXCLUDE '/etc/udev/rules.d/70-persistent-net.rules'

Set the access password for the TSM server and you're set:

root@chrome:~ # dsmc set password

Usually I don't backup /.../*, because I don't see much point in creating backups of stuff that can easily be re-installed from a distribution repository. Therefore I limit my backups to user and configuration data only (/etc, /home, /var/log, …). "Configuration data" includes a list of the installed packages, which is generated by the script run via PREschedulecmd:

#!/bin/sh
PATH=/usr/bin:/usr/sbin:/bin:/sbin
dpkg --get-selections > /etc/installed_packages.list || exit $?

With this I can do a full system restore in five steps:

  1. Install the base OS.

  2. Install the TSM client and (re-)create the configuration files. I keep the TSM configuration files for my servers in a repository, so I have them at hand when an emergency arises.

    Note: The client must be the same version that was used to create the backup!

  3. Restore sources.list and installed_packages.list:

    cd /opt/tivoli/tsm/client/ba/bin
    dsmc restore "/etc/apt/sources.list" -replace=all
    dsmc restore "/etc/installed_packages.list" -replace=all
    
  4. Re-install the packages that were installed before:

    dpkg --set-selections < /etc/installed_packages.lst
    apt-get dselect-upgrade
    
  5. Restore the rest of your data from backup:

    for d in $(awk '/^INCLUDE/ {print $2}' dsm.sys); do
      dsmc restore $d -replace=all -subdir=yes
    done
    

Posted 00:46 [permalink]