Skip to content
  • intrigeri's avatar
    Make Jenkins slave service startup more reliable and fix its status... · 4eb0497e
    intrigeri authored
    Make Jenkins slave service startup more reliable and fix its status information (Closes: #8508, #11858).
    
    This fixes two related problems:
    
    1. The initscript tried to download the JAR only once. If the Jenkins master was
    not reachable at that time, the service would be considered to be correctly
    running, while it would not work at all. Let's now retry to download a JAR a few
    times, with a power-of-2 backoff delay, in order to wait for the Jenkins master
    to show up. And whenever the download script gives up eventually, systemd
    (with Restart=always) will itself restart the service a number of times.
    
    2. The service status (reported by the unit file auto-generated from the
    initscript) was always "running", because that unit file had Type=forking and
    the initscript runs plenty of commands before actually starting the service,
    which makes systemd guess incorrectly what process it should monitor. This made
    it impossible for our monitoring system to alert us whenever this service was
    not functioning. Converting to a native systemd service with Type=simple makes
    systemd report correct service status information.
    4eb0497e