blog'o thnet

To content | To menu | To search

Thursday 16 November 2006

How to Add a NewTSM Scheduler Daemon Service on RHEL4

  • dsmc sched represents the TSM scheduler daemon

Create the TSM service file:

# cat /etc/rc.d/init.d/tsm
#!/usr/bin/env sh

# chkconfig: 345 56 24
# description: TSM scheduler daemon
# processname: /usr/bin/dsmc

# Source functions library.
. /etc/rc.d/init.d/functions

LC_ALL=en_US; export LC_ALL
dsmc="/usr/bin/dsmc"
options="sched"
rc=0

start() {
  echo -n $"Starting `basename ${dsmc}`:"
  # Doesn't behave as expected because of the launching command
  # of the `tsm' scheduler :-(
  #initlog -c "${dsmc} ${options}  "    success || failure
  # So...
  [ -x ${dsmc} ]    (${dsmc} ${options}  ) > /dev/null 2> 1
  rc=$?
  if [ ${rc} -eq 0 ]; then
    success $"Starting `basename ${dsmc}`"
  else
    failure $"Starting `basename ${dsmc}`"
  fi
  echo
}

stop() {
  echo -n $"Stopping `basename ${dsmc}`:"
  if [ -n "`pidofproc ${dsmc}`" ]; then
    killproc ${dsmc} -TERM
  else
    failure $"Stopping `basename ${dsmc}`"
  fi
  rc=$?
  echo
}

case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
restart)
  stop
  start
  ;;
status)
  status ${dsmc}
  rc=$?
  ;;
*)
  echo "Usage: `basename $0` {start|stop|restart|status}"
  rc=1
  ;;
esac

exit ${rc}

Add and configure the TSM service:

# chmod 744 /etc/rc.d/init.d/tsm
# chkconfig --add tsm
# chkconfig --level 0126 tsm off
# chkconfig --level 345 tsm on

Start, or restart, the TSM service, and monitor it:

# service tsm restart
# service tsm status

Saturday 2 July 2005

Install and Configure the TSM Client on HP-UX Platform

  1. beastie is the hostname of the local system
  2. rafal is the hostname of the repository system hosting the necessary packages in the depot
  3. moliere is the hostname of the TSM backup server

Be sure to obtain the sam(1m) display:

# DISPLAY=beastie:0
# export DISPLAY

Check if the os level and product version agreed on the same specifications, and that there is sufficient disk space to install the TSM client components:

# uname -a
# model
# bdf /opt
# vgdisplay vg00
# swlist | grep OnLineJFS

Launch the System Administration Manager (see the sam(1) manual page for more information) and follow these steps:

# sam&
/*
 * Software Management
 *  Install Software to Local Host
 *   Source Depot Type: Network Directory/CDROM
 *   Source Host Name... rafal
 *   Source Depot Path... /var/spool/sw/1100
 *    select "TIVsm   5.2.2   Tivoli Storage Manager Client"
 */

Configure the new tool:

# cd /opt/tivoli/tsm/client/ba/bin
# cp dsm.sys.smp dsm.sys
# cp dsm.opt.smp dsm.opt
# nslookup moliere   /* Check that the backup server is available. */
# vi dsm.opt
# vi dsm.sys         /* Modify the `nodename' accordingly. */
# vi inclexcl.excl   /* Adapt the content following the recommendation from
                        the storage/backup team. */
# dsmc q ses         /* Tune the TSM Server Connection Information following
                        the recommendation from the storage/backup team. */

Launch the TSM scheduler at run-level #3:

# cat << EOF > /sbin/init.d/tsmsched
#!/bin/sh 

killproc() {            # kill the named process(es)
        pid=`/usr/bin/ps -ef|
             /usr/bin/grep '[d]smc sched' |
             awk '{ print $2 }'`
        if [ "$pid" != "" ];
        then
                kill $pid
                sleep 5
                kill -0 $pid
                [ $? -ne 0 ] && kill -9 $pid
        fi
}

startproc() {
        if [ -f /usr/bin/dsmc ]; then
                (/usr/bin/nohup /usr/bin/dsmc sched &) >/dev/null 2>&1
                echo  "dsmc
" 
        fi
}

case $1 in
'start_msg')
        echo  "starting TSM scheduler:" 
        ;;
'start')
        startproc
        ;;
'stop_msg')
        echo  "stopping TSM scheduler:" 
        ;;
'stop')
        killproc
        ;;
'restart')
        echo  "restarting TSM scheduler:" 
        killproc
        startproc
        ;;
*)
        echo "usage: `basename $0` {start|stop}"
        ;;
esac
EOF
# chmod 744 /sbin/init.d/tsmsched
# ln -s /sbin/init.d/tsmsched /sbin/rc3.d/S300tsmsched
# /sbin/rc3.d/S300tsmsched start

Thursday 16 June 2005

How to Add a New "tsmsched" Service on AIX 5L

Create the tsmsched service:

# mkssys -p /usr/bin/dsmc \   /* Absolute path to the subsystem executable
                                 program. */
         -s tsmsched \        /* Name that uniquely identifies the subsystem. */
         -u 0 \               /* User id for the subsystem. */
         -a sched \           /* Arguments to be passed to the command. */
         -e /dev/console \    /* Where the subsystem standard error data is
                                 placed. */
         -i /dev/console \    /* Where the subsys. standard input is routed. */
         -o /dev/console \    /* Where the subsys. standard output is placed. */
         -R \                 /* Subsystem is restarted if the subsystem stops
                                 abnormally. */
         -Q \                 /* Multiple instances of the subsystem are not
                                 allowed to run at the same time. */
         -S \                 /* Subsystem uses the signals communication
                                 method. */
         -f 9 \               /* Signal sent to the subsystem when a forced
                                 stop of the subsystem is requested. */
         -n 15 \              /* Signal sent to the subsystem when a normal
                                 stop of the subsystem is requested. */
         -E 20 \              /* Execution priority of the subsystem. */
         -G tsm \             /* Subsystem belongs to the group specified. */
         -d \                 /* Inactive subsystems are displayed when the
                                 lssrc -a command request is made. */
         -w 20                /* Time, in seconds, allowed to elapse between a
                                 stop cancel (SIGTERM) signal and a subsequent
                                 SIGKILL signal. */

Check the service's configuration:

# lssrc -S -s tsmsched
#subsysname:synonym:cmdargs:path:uid:auditid:standin:standout:standerr:action:multi:contact:svrkey:svrmtype:\
 priority:signorm:sigforce:display:waittime:grpname:
tsmsched::sched:/usr/bin/dsmc:0:0:/dev/console:/dev/console:/dev/console:-R:-Q:-S:0:0:\
 20:15:9:-d:20:tsm:

Or directly querying the ODM internal database:

# odmget -q subsysname=tsmsched SRCsubsys

SRCsubsys:
        subsysname = "tsmsched"
        synonym = ""
        cmdargs = "sched"
        path = "/usr/bin/dsmc"
        uid = 0
        auditid = 0
        standin = "/dev/console"
        standout = "/dev/console"
        standerr = "/dev/console"
        action = 1
        multi = 0
        contact = 2
        svrkey = 0
        svrmtype = 0
        priority = 20
        signorm = 15
        sigforce = 9
        display = 1
        waittime = 20
        grpname = "tsm"

Start the new service:

# startsrc -s tsmsched

Launch the TSM scheduler at run-level #2:

# cat << EOF > /etc/rc.d/rc2.d/Stsmsched
#!/usr/bin/env ksh
###############################################################
# name: {K|S}tsmsched
# purpose: script that will start or stop the tsmsched service.
###############################################################

case "$1" in
start)
  startsrc -g tsm
  ;;
stop)
  stopsrc -g tsm
  ;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0
EOF
# ln /etc/rc.d/rc2.d/Stsmsched /etc/rc.d/rc2.d/Ktsmsched
# chmod 744 /etc/rc.d/rc2.d/?tsmsched