Restart a satellite

After you synchronize plugins on an XL Deploy satellite, the satellite must be restarted. For more information, see Synchronize plugins with a satellite server.

The satellite restart is required because:

  • The Java classes, scripts, rules, and other resources of the synchronized plugins must be loaded into the Java virtual machine (JVM).
  • The internal state of the satellite must be reset.

Restart a satellite from the GUI

To restart a satellite:

  1. In the left pane, expand Infrastructure.
  2. Select the satellite, click Explorer action menu, and click Restart or right-click the satellite and click Restart. Note: You can also double-click the satellite to view the summary page and click Restart.

The system waits for all the satellite tasks to be executed before restarting the satellite. You can see the restart control task in the Monitoring > Control tasks tab. After the satellite restart task is successfully executed, click Finish.

Use the force restart option

When you restart a satellite, the system waits for all the satellite tasks to be executed. If there are tasks that are stuck in executing state, you can force the satellite restart.

There are two procedure you can use to force restart a satellite:

From the satellite control task

  1. In the left pane, expand Infrastructure.
  2. Select the satellite, click Explorer action menu, and click Restart or right-click the satellite and click Restart.
  3. Click the Force checkbox on the restart task.
  4. Click Continue.
  5. Click Execute.

From the satellite summary view

  1. In the left pane, expand Infrastructure.
  2. Double-click the satellite to view the summary page.
  3. Click the drop-down arrow next to Restart.
  4. Click Force Restart.

Satellite restart process using a script

The satellite Java process uses a special 242 exit code to indicate it requires a restart. The startup script or service that bootstraps the satellite process is responsible for checking for this exit code and restarting the satellite when requested.

The satellite module includes a startup script that does this. The following code fragment is an example based on the Linux startup script that can be found in <SATELLITE_HOME>/bin/run.sh:

RESTART_EXIT_CODE=242

start_xl_satellite ()
{
 $JAVACMD $SATELLITE_OPTS $SATELLITE_LOG_OPTS -classpath "${SATELLITE_SERVER_CLASSPATH}" com.xebialabs.satellite.SatelliteBootstrapper "$@"
 rc=$?
}

# Run XL Satellite server first time
start_xl_satellite

# Reboot loop
while [ $rc = $RESTART_EXIT_CODE ]
do
    echo "Restarting XL-Satellite";
    start_xl_satellite
done

In this example:

  1. The start_xl_satellite method starts the satellite Java process.
  2. The method is called initially to start the satellite the first time.
  3. The while reboot loop inspects the exit code. If the exit code is 242, the satellite requests a restart. The script will start the satellite.
  4. If the exit code is not 242, the loop will end and the satellite is terminated.

If you want to use an alternative startup script, service wrapper, or daemon process instead of the startup scripts that are provided with the satellite module, ensure you include the restart process.