How to run process in background using gcloud ssh

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have two gcp linux VMs, with that I am doing ssh from one instance to another and running process using below command, that works fine when command #1 is executed but when I use option to run process in background command #2, the command shows no results.



gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log &' === This does not gets executed.


Need way to start process in background, event I log out of this ssh seesion from VM2










share|improve this question



























    up vote
    0
    down vote

    favorite












    I have two gcp linux VMs, with that I am doing ssh from one instance to another and running process using below command, that works fine when command #1 is executed but when I use option to run process in background command #2, the command shows no results.



    gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
    gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log &' === This does not gets executed.


    Need way to start process in background, event I log out of this ssh seesion from VM2










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have two gcp linux VMs, with that I am doing ssh from one instance to another and running process using below command, that works fine when command #1 is executed but when I use option to run process in background command #2, the command shows no results.



      gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
      gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log &' === This does not gets executed.


      Need way to start process in background, event I log out of this ssh seesion from VM2










      share|improve this question















      I have two gcp linux VMs, with that I am doing ssh from one instance to another and running process using below command, that works fine when command #1 is executed but when I use option to run process in background command #2, the command shows no results.



      gcloud compute ssh -zone Zone-Name vm1 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' ==== This works fine
      gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log &' === This does not gets executed.


      Need way to start process in background, event I log out of this ssh seesion from VM2







      ssh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 8 at 7:10









      Jaroslav Kucera

      4,3904621




      4,3904621










      asked Aug 8 at 6:17









      user126930

      1




      1




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.



          So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:



          nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461210%2fhow-to-run-process-in-background-using-gcloud-ssh%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.



            So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:



            nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &





            share|improve this answer
























              up vote
              0
              down vote













              Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.



              So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:



              nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.



                So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:



                nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &





                share|improve this answer












                Having no idea of gcp linux, I suppose, the second example doesn't work because "&" is used by the shell to run commands in background. But ssh doesn't start any shell when you specify a command, it just runs the command, then exits.



                So, if my assumption is right, you need to login to the remote system and execute commands using expect-like chat-language or try sending the whole command to background on your local system. Something like that:



                nohup gcloud compute ssh -zone Zone-Name vm2 -- 'cd /app/bin && ./clearcache && nohup ./startWeblogicAdmin >> admin.log' &






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 8 at 9:26









                Mikhail Zakharov

                1246




                1246



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461210%2fhow-to-run-process-in-background-using-gcloud-ssh%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay