Restart a Satellite
After you synchronize plugins on a 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:
- In the left pane, expand Infrastructure.
- Select the satellite, click , and click Restart or right-click the satellite and click Restart.
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
- In the left pane, expand Infrastructure.
- Select the satellite, click , and click Restart or right-click the satellite and click Restart.
- Click the Force checkbox on the restart task.
- Click Continue.
- Click Execute.
From the satellite summary view
- In the left pane, expand Infrastructure.
- Double-click the satellite to view the summary page.
- Click the drop-down arrow next to Restart.
- 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 Deploy 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:
- The
start_xl_satellite
method starts the satellite Java process. - The method is called initially to start the satellite the first time.
- The
while
reboot loop inspects the exit code. If the exit code is242
, the satellite requests a restart. The script will start the satellite. - 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.