NetBackup init script for 32bit Linux (SLES)

Written by - 1 comments

Published on - Listed in Backup Linux


Someone who wants to install NetBackup on a 32bit machine might rub his eyes: The latest version 7.x is not available for 32bit machines anymore.
In this case it is mandatory to install the previous version, 6.5.x on the client.

Although the installation is not that difficult, the init script which comes with the installation doesn't really work. Additionally it sets itself up in /etc/xinet.d and is therefore dependent on the xinet.d service.

The following init script is adapted to launch the necessary NetBackup services on a 32bit machine, in this case it was a SLES Linux:

#!/bin/bash
################################################################################
# Script:       netbackup (init script)                                        #
# Author:       Claudio Kuenzler                                               #
# Description:  Launches netbackup on 32bit machines (path for binaries are    #
                different in 32bit installation (6.5.x).                       #
#               NetBackup 7.x is only supported in 64bit environments.         #
#               On 32bit machines you MUST install NetBackup 6.5.x             #               
# License:      GPLv2                                                          #
# History:                                                                     #
# 20120220      Creation of script                                             #
################################################################################
### BEGIN INIT INFO
# Provides:          bar
# Required-Start:    $network
# Required-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: bar daemon, providing a useful network service
# Description:       The bar daemon is a sample network
#       service.  We want it to be active in runlevels 3
#       and 5, as these are the runlevels with the network
#       available.
### END INIT INFO

# Check for missing binaries
BPCD_BIN=/usr/openv/netbackup/bin/bpcd
VNET_BIN=/usr/openv/bin/vnetd
test -x $BPCD_BIN || { echo "$BPCD_BIN not installed";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }
test -x $VNET_BIN || { echo "$VNET_BIN  not installed";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

# Check for existence of needed config file and read it
NETBACKUP_CONFIG=/usr/openv/netbackup/bp.conf
test -r $NETBACKUP_CONFIG || { echo "$NETBACKUP_CONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 6; fi; }

# Load the rc.status script for this service.
. /etc/rc.status

# Reset status of this service
rc_reset

  case "$1" in
    start)
        echo -n "Starting Netbackup "
        ## Start daemon with startproc(8). If this fails
        ## the return value is set appropriately by startproc.
        startproc $BPCD_BIN -standalone
        startproc $VNET_BIN -standalone

        # Remember status and be verbose
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down Netbackup "
        ## Stop daemon with killproc(8) and if this fails
        ## killproc sets the return value according to LSB.

        killproc -TERM $BPCD_BIN
        killproc -TERM $VNET_BIN

        # Remember status and be verbose
        rc_status -v
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    reload)
        ## Otherwise if it does not support reload:
        rc_failed 3
        rc_status -v
        ;;
    status)
        echo -n "Checking for service Netbackup "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        # Return value is slightly different for the status command:
        # 0 - service up and running
        # 1 - service dead, but /var/run/  pid  file exists
        # 2 - service dead, but /var/lock/ lock file exists
        # 3 - service not running (unused)
        # 4 - service status unknown :-(
        # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)

        # NOTE: checkproc returns LSB compliant status values.
        checkproc $BPCD_BIN
        checkproc $VNET_BIN
        # NOTE: rc_status knows that we called this init script with
        # "status" option and adapts its messages accordingly.
        rc_status -v
        ;;
    *)
        ## If no parameters are given, print which are avaiable.
        echo "Usage: $0 {start|stop|status|restart|reload}"
        exit 1
        ;;
esac

rc_exit

You might have to adapt the path of BPCD_BIN and VNET_BIN but in a standard 6.5.x installation the paths should be correct.

Enjoy.


Add a comment

Show form to leave a comment

Comments (newest first)

Denzo from wrote on Nov 19th, 2014:

I can't understand how so stupid mistake went to production client...
Thanks a lot, man!


RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder