Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-28811

Can't start background process during init of new worker?

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • ec2-plugin
    • Jenkins: 1.596.3
      Amazon EC2 plugin: 1.28
      Amazon Linux

      I'm utilizing the EC2 plugin to spin up Jenkins worker slaves on-demand. During the start-up of each worker, I want to download and start a selenium server.

      After downloading the selenium server jar via curl, I've tried starting selenium via the Init Script.

      Both:
      screen -d -m -L -S selenium java -jar /tmp/selenium-server-standalone.jar

      And:
      nohup java -jar /tmp/selenium-server-standalone.jar &

      Fail to start selenium. I've done a little digging, and in each case those commands exit with a status of 0, but it seems like nothing happens.

      As a workaround, I'm using a cronjob to ensure selenium is running via screen. It is pretty hacky. I'd love to start a background process via the Init Script.

      EDIT: I've added a screenshot of the work config, as well as full text of the Init Script.

          [JENKINS-28811] Can't start background process during init of new worker?

          Francis Upton added a comment -

          The init script is run only on the the first startup of the instance to initialize it. There is nothing in the ec2 plugin the supported initialization of an existing instance when it is started.

          Francis Upton added a comment - The init script is run only on the the first startup of the instance to initialize it. There is nothing in the ec2 plugin the supported initialization of an existing instance when it is started.

            francisu Francis Upton
            vrivellino Vincent Rivellino
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: