Find the answer to your Linux question:
Results 1 to 2 of 2
Hey guys, So I was writing this small script that would start a process on each node. The first bit up to First node is working just right. When it ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    4

    Question Easy cluster restart script -- need help

    Hey guys,

    So I was writing this small script that would start a process on each node. The first bit up to First node is working just right. When it goes to the First node part, it does connect to node01, it does set the Path, but sometimes it passes the pbs_mom and sometimes it doesn't. pbs_mom simply starts the process on the node. The problem is that it never runs the full script. It always stops at that point and i don't know what to do. When it runs the pbs_mom it never logs out.

    Code:
    #!/bin/sh
    PATH=$PATH:/usr/local/sbin
    pbs_server
    #
    #First node
    ssh node01
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Second node
    ssh node02
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Third node
    ssh node03
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Fourth node
    ssh node04
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Fith node
    ssh node05
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Sixth node
    ssh node06
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Seventh node
    ssh node07
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Eigth node
    ssh node08
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    #
    #Nineth node
    ssh node09
    PATH=$PATH:/usr/local/sbin
    pbs_mom
    logout
    Anyone knows what can I do?

  2. #2
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    I suggest you try it this way:

    Code:
    ssh node01 -c "PATH=$PATH:/usr/local/sbin; pbs_mom &"
    The '&' after the 'pbs_mom' will cause it to run in the backgorund. This will allow the script to continue to the next node.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...