Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

0

I'm using similar construction

initctl stop node-App || echo "node-App was not running"
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda