6 Replies Latest reply on Sep 18, 2013 9:51 PM by Shirish Pednekar

    Bash scripts behavior different when run as nsh script job as opposed to run locally

    Shirish Pednekar

      Hello Experts,

       

      I am having trouble implementing a bash script via BSA.

       

      Ideally, when the script is run, the output should be 6 stunnel processes running.

      This objective is achieved when  running it from the putty session as root.

       

      However, when run from as a NSH Script job ,when doing a continuous "ps -ef | grep stunnel", I see 6 processes kicked off.

      However, as the job completes in the BSA console, I have just one process left running :-(

       

      Just as the job start

      ttid-testweb1% ps -ef | grep stunnel

      stunnel   7251     1  0 18:22 pts/2    00:00:00 /usr/sbin/stunnel /u19/etc/s

      stunnel   7252     1  0 18:22 pts/2    00:00:00 /usr/sbin/stunnel /u19/etc/s

      stunnel   7253     1  0 18:22 pts/2    00:00:00 /usr/sbin/stunnel /u19/etc/s

      stunnel   7254     1  0 18:22 pts/2    00:00:00 /usr/sbin/stunnel /u19/etc/s

      stunnel   7255     1  0 18:22 pts/2    00:00:00 /usr/sbin/stunnel /u19/etc/s

      stunnel   7256     1  0 18:22 ?        00:00:00 /usr/sbin/stunnel /u19/etc/s

       

      When the job completes in BSA.

      ttid-testweb1% ps -ef | grep stunnel

      stunnel   7256     1  0 18:22 ?        00:00:00 /usr/sbin/stunnel /u19/etc/s

       

      In the job, I have selected "copy & execute again each host"

      The rscd log just shows the script being copied , permissions and ownership being changed & nexec command being run which fires the script.

      The "Transactions" folder is not updated.

      I don't see in any log on the BSA , the target rscd log, or any hints in the /var/log directory.

       

      The job log and the script is attached.

       

      Please help me to find the cause and fix.

       

      Shirish