Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Upstart stop if running

I have a Jenkins job to stop a node application, deploy code, and start the application.

The start/stop is done with an Upstart script.

I use initctl stop node-App

If the job is running, this works great. But if the app has died or is in a stopped state, the output is initctl: Unknown instance:

This causes the Jenkins job to fail and not proceed to the next steps.

Is there a way to check if the job is started before issuing the start command? Or is there a way for Jenkins to not consider that an error and fail the job?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

A colleague came up with a great solution

if ( initctl status node-App | grep start ); then
  initctl stop node-App
fi

Very simple and works properly when run from Jenkins

over 4 years ago · Santiago Trujillo Report

0

I'm using similar construction

initctl stop node-App || echo "node-App was not running"
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!