Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do you start a background process with pipline ssh-run? Edited

고현민 I'm New Here Nov 09, 2020

I want to use ssh-run to restart my Spring project in remote server.  My project is built into a .jar file and is uploaded to the server.

 

- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'pkill -9 -f app.jar | nohup /(dir)/app.jar &'

 I tried the command above.  The pipeline result says it succeded, but the process was not working.  

 

I searched and found someone saying that when 'nohup ... &' command doesn't work, put 'sleep 1' command next to it.  So I tried blow.

 

- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'pkill -9 -f app.jar | nohup /(dir)/app.jar & sleep 1'

 

Now the service works.  It successfully restarts the service every time I push the code.

But the problem is that the pipeline result says it 'failed'.  Also, it sends me email every time which is very annoying.  (I can't even disable it in setting)

 

So I want to know how people use pipeline ssh-run command to execute a file to run service in background.

 

Thank you.

1 answer

0 votes

@고현민 now when you figured out with your command, please share the logs where pipeline fails.

It will help us to discover the root cause.

 

If you have some sensitive info in logs, you may mask any string you'd not like to show up.

 

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,320 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you