Forum Discussion

Sid1987's avatar
Sid1987
Level 6
12 years ago

BPJOBD process temporary workaround, for automation

Hi Guys,

  I need some urgent help, I have an issue that bpjobd process gets killed every now and then, I opened a case with symantec which didn't help, they recommended to upgrade to 7.5 which is not currently been approved, However I have a strong server which can take place for the current master so it means there will be a hardware upgrade for my environment, However till that time I need a temporary fix, means I want the bpjobd to start by its own through a script I have which is in crontab to check if bpjobd is running in every 2 mins and if not, it will start the bpjobd with (bpjobd &)

When I tested this script it doesn't work, when I tried to manually run the script then also the command prompt doesn't comes back which I think is the issue, when I did ctrl+c twice the script came up and it started the bpjobd. So I thought of including trap command to issue a ctrl+c in the script which didnt work, may be because the script is not able to go pass the bpjobd & step. So please help.

Here is the script.

x=`ps -ef | grep -i bpjobd | grep -v "grep -i bpjobd" | wc -l`;
if [ $x -eq 0 ]
then
mail -s "Activity Monitor is hung, bpjobd started, please verify" email id's

/usr/openv/netbackup/bin/bpjobd &
trap "Ctrl + C" 2
trap "Ctrl + C" 2
fi
 

I have netbackup version 7.1.0.4

Thanks

Sid

  • OK, seems to work :

     

    #!/usr/bin/ksh
    /usr/openv/netbackup/bin/bpps -x |grep bpjobd >/dev/null 2>&1
    if [[ $(echo $?) -ne 0 ]] then
    nohup /usr/openv/netbackup/bin/bpjobd &
    fi
     
    Please give that a go and report back.
     
    Martin

18 Replies

  • HAving trouble with my LInux serverv (typical) - agree with wr, just realised that 'cron' doesn't have the usualy PATH variables set, so need to give everything the full path ...

    I changed the shell to bash, probably better as that is the default for Linux (I think)

     

    #!/usr/bin/ksh
    /usr/openv/netbackup/bin/bpps -x |grep bpjobd >/dev/null 2>&1
    if [[ $(echo $?) -ne 0 ]] then
    nohup /usr/openv/netbackup/bin/bpjobd &
    fi
  • Hi Martin,

    Thanks for such a prompt response. I have added the full path to the script, However I fail to understand how the script runs when I run it manually when it doesn't has complete path.

    Thanks

    Sid

  • Firstly, loks like it needs to be #!/bin/ksh - it doesn't work under bash

    (Apologies, I always use 'Korn' shell, so there must be some slight change needed for bash)

    In Unix/ Linus when you run a shell (the command line) there is a PATH variable set.

    Eg. If my .profile contains :

    PATH=/usr/local/bin:/sbin:/bin:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd

    Any command I run, located in any of those directories will work, no matter which directory I am in.

    If I ran vmoprcmd, when for example in the ./ dir, it would say no such command.  This is because vmoprcmd is in /usr/openv/volmgr/bin but this is not in the PATH and therefore  the system does no know where to look.

    When using cron, it has it's own path, which is limited, something like bin and sbin.  So any command outside that, will need the full path specifing.

    Martin

  • OK, seems to work :

     

    #!/usr/bin/ksh
    /usr/openv/netbackup/bin/bpps -x |grep bpjobd >/dev/null 2>&1
    if [[ $(echo $?) -ne 0 ]] then
    nohup /usr/openv/netbackup/bin/bpjobd &
    fi
     
    Please give that a go and report back.
     
    Martin
  • If  ksh is not installed, try this instead.

    #! /bin/sh
    pgrep -x bpjobd  >/dev/null 2>&1
    if [  -ne 0 ] then
    nohup /usr/openv/netbackup/bin/bpjobd &
    fi
    

    BTW, bpjobd does not require Ctrl+C. I guess mail command in your script cause this issue. Any mail body is not supplied in your script , so mail command wait input from stdin.

  • I could only try the script from the command line when I wrote it, and that didn't return the promt, so I stuck in the nohup.

    It works as shown in cron that I have now been able to test, so I left it alone without change.

    M

  • Hi Martin,

     I will try it manually by killing bpjobd and see if it works.

    However did you find your script in ps when you try to grep for bpjobd as defunct process.

    [bpjobd.sh] <defunct>.

    Thanks

    Sid

  • Thanks Martin,

     It seems to be working fine now.

    Thanks

    Sid