TT#35000 Force reboot after installation finished

When triggering 'sudo reboot' it fails with:

| System has not been booted with systemd as init system (PID 1). Can't operate.

We need to reboot the system though to get a
functional system we can ran tests against.

Quoting halt(8):

|  -f, --force
|
|    Force immediate halt, power-off, or reboot. When
|    specified once, this results in an immediate but clean
|    shutdown by the system manager. When specified twice,
|    this results in an immediate shutdown without
|    contacting the system manager. See the description of
|    --force in systemctl(1) for more details.

Quoting systemctl(1):

|  -f, --force
|
|    [...]
|    When used with halt, poweroff, reboot or kexec,
|    execute the selected operation without shutting down
|    all units. However, all processes will be killed
|    forcibly and all file systems are unmounted or
|    remounted read-only.  This is hence a drastic but
|    relatively safe option to request an immediate reboot.

Change-Id: Ic3dbadb81fe91540ee4d53d48bdb9e7d8bb6668c
changes/30/21030/1
Michael Prokop 7 years ago
parent b581035bf4
commit c23bc372d0

@ -432,7 +432,7 @@ ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -i "${KEY_FI
if $_opt_skip_reboot ; then
echo "*** Skipping system reboot of instance ID ${INSTANCE_ID} as requested via --skip-reboot ***"
else
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -i "${KEY_FILE}" "admin@$HOSTNAME" "sudo reboot"
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -i "${KEY_FILE}" "admin@$HOSTNAME" "sudo reboot -f"
retry=120 # up to 10 minutes
STATUS=""
while [ "$STATUS" != "running" ] && [ $retry -ne 0 ] ; do

Loading…
Cancel
Save