#637 Issue closed: NSR servername not defined causing rear to hang

Labels: bug, waiting for info, fixed / solved / done

gdha opened issue at 2015-08-14 11:44:

With BACKUP=NSR we have seen the following:

2015-08-14 11:42:23 Including rescue/NSR/default/45_prepare_networker_startup.sh
+ . /usr/share/rear/rescue/NSR/default/45_prepare_networker_startup.sh
++ cat
++ chmod +x /tmp/rear.npnyDIbtAkHKLN6/rootfs/etc/scripts/system-setup.d/90-networker.sh
++ Log 'Created the EMC NetWorker nsrexecd start-up script (90-networker.sh) for Rear'
++ test 1 -gt 0
+++ Stamp
+++ date '+%Y-%m-%d %H:%M:%S '
++ echo '2015-08-14 11:42:23 Created the EMC NetWorker nsrexecd start-up script (90-networker.sh) for Rear'
2015-08-14 11:42:23 Created the EMC NetWorker nsrexecd start-up script (90-networker.sh) for Rear
+ test 1
+ set +x
2015-08-14 11:42:23 Including rescue/NSR/default/46_save_nsr_server_name.sh
+ . /usr/share/rear/rescue/NSR/default/46_save_nsr_server_name.sh
++ [[ ! -z '' ]]
++ [[ -f /nsr/res/servers ]]
++ [[ -d /nsr/res/nsrladb/03 ]]
+++ grep servers
+++ tail -1
+++ awk '{print $2}'
+++ sed -e 's/[;,]//'

It just hangs here. Why?
Not sure why it hangs at:

elif [[ -d $NSR_ROOT_DIR/res/nsrladb/03 ]]; then
    NSRSERVER=$(grep servers $NSR_ROOT_DIR/res/nsrladb/03/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//' )

At least one user confirmed that grep: /nsr/res/nsrladb/03/*: No such file or directory

Possible solution are:

  1. create the file /nsr/res/servers manually with the hostname of the NSR server
  2. Verify if the following works for most NSR users:
grep servers /nsr/res/nsrladb/*/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//'

If this is the case we could modify the line in script /usr/share/rear/rescue/NSR/default/46_save_nsr_server_name.sh from
grep servers $NSR_ROOT_DIR/nsr/res/nsrladb/03/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//' into
grep servers $NSR_ROOT_DIR/nsr/res/nsrladb/*/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//'

keilma commented at 2015-08-19 12:05:

Hi,

maybe that helps: with NetWorker you can use nsradmin to query the database (nsrladb). The only requirement is that the NetWorker Client Daemon runs (nsrexecd).

I'm not a coder and don't know how to format my output correctly, but this code shows you the correct server found in the nsrladb:

[root@mkrear ~]# printf "option hidden\n show servers\n p nsrla" | nsradmin -p nsrexec
NetWorker administration program.
Use the "help" command for help, "visual" for full-screen mode.
nsradmin> Hidden display option turned on

Display options:
        Dynamic: Off;
        Hidden: On;
        Raw I18N: Off;
        Resource ID: Off;
        Regexp: Off;
nsradmin> nsradmin>                      servers: mknw01.xx, mknw01;

servers: mknw01.xx, mknw01; is the correct server.
Please let me know if I should do some tests for you.

Regards
Marcel

gdha commented at 2015-08-19 18:30:

@keilma Thanks Marcel for your valuable input, but I find it too complicate to put in a script - could you just try the command:
grep servers /nsr/res/nsrladb/*/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//'

keilma commented at 2015-08-20 05:57:

@gdha works fine :)

[root@mkrear ~]# grep servers /nsr/res/nsrladb// | tail -1 | awk '{print $2}' | sed -e 's/[;,]//'
mknw01.marcelk.brs.local

Regards
Marcel

gdha commented at 2015-10-31 09:07:

@keilma could you test the updated script (just checked it in)?


[Export of Github issue for rear/rear.]