Reboot remotely

Description

The reboot update module provides an ability to reboot the devices remotely.

Example use-cases:

  • any time you need a reboot for any reason.

Specification

Specification
Module name reboot
Supports rollback no
Requires reboot yes
Artifact generation script yes
Full system updater no
Source code Update Module, Artifact Generator

Prepare the device

This section describes how to setup your target device, i.e. the device to be updated. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.

Prerequisites

This update module has the following prerequisites for the device environment:

Install the Update Module

Download the latest version of this Update Module by running:

mkdir -p /usr/share/mender/modules/v3 && wget -N -P /usr/share/mender/modules/v3 https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/reboot/module/reboot

Prepare the development environment on your workstation

This section describes how to set up your development environment on your workstation.

All commands outlined in this section should be run in the development environment.

Prerequisites

This Update Modules has the following prerequisites for the development environment:

Create Mender Artifacts

For convenience, an Artifact generator tool reboot-gen is provided with the Update Module.
Download reboot-gen , by running the following command:

wget https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/reboot/reboot-gen

Make it executable:

chmod +x reboot-gen

Generate Mender Artifacts using the following command:

ARTIFACT_NAME="my-update-1.0"
DEVICE_TYPE="my-device-type"
./reboot-gen --artifact-name ${ARTIFACT_NAME} \
                      --device-type ${DEVICE_TYPE}
2 Likes

Wow @peter, This is a fantastic update. Been waiting for it.

I am very happy you like it!

peter

1 Like

Hello @peter
this looks really cool! i wanted to try it out now, but it seems its not available at the moment?

/mender-reboot-module$ mkdir -p /usr/share/mender/modules/v3 && wget -N -P /usr/share/mender/modules/v3 https://raw.githubusercontent.com/mendersoftware/mender-update-modules/blob/master/reboot/module/reboot
--2020-08-04 11:00:07--  https://raw.githubusercontent.com/mendersoftware/mender-update-modules/blob/master/reboot/module/reboot
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.12.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-08-04 11:00:07 ERROR 404: Not Found.

Hello @genedupre!

Thanks for giving it a try!
I am sorry, bad link, this is the correct link:

https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/reboot/module/reboot

I will update the original post.

peter

Hi @peter!

thanks for the module, it works as intended.
i do have a question.
i intend on using this module, for my colleges that are more on the support side, so they can use this when needed. However after testing this with my support colleges i encountered this


because the artifact name (probably some md5 hash) is the same as the “current software” it wont be installed/ runned again.
do you have an idea/ suggestion on how to get around this?
creating a “new artifact with a new date” wont be an solution.
since this is more intended as a low level solution for people unfamiliar with code in general
Greets Gene

I am happy that it works.
@genedupre so what you are trying to tell me is that re-creating/editing an artifact is not an option at all?

peter

I would suggest to just have two artifacts, reboot1 and reboot2. This way you can alternate them if you need to reboot multiple times.

This functionality is not “core” functionality of Mender so it is a bit clunky

Hey Gene,

one solution that comes to mind (it is a workaround) is: to have two artifacts with different names: e.g.: “reboot” and “reboot-back”, and deploy them in turns. That is: when “reboot” is installed deploy “reboot-back”, and vice-versa.

peter

@mirzak @peter
thanks, yes this looks like a nice workaround
Gene