State scripts not executing

87 views
Skip to first unread message

FAE

unread,
Jan 10, 2019, 11:45:48 AM1/10/19
to Mender List mender.io
Hello,

I have in my /etc/mender/scripts two scripts, Idle_Enter_10_copy and ArtifactReboot_Leave_10_copy but only the Idle_Enter gets executed.

In the documentation i read:

There are two types of the state scripts: root file system and Artifact. The root file systems scripts are stored as a part of the current root file system. The default location for those scripts is /etc/mender/scripts. The Artifact scripts are part of the Artifact and are delivered to the Client inside the Artifact. All the Artifact scripts are prefixed with Artifact.

Artifact scripts must be treated differently?

Thank you

Drew Moseley

unread,
Jan 10, 2019, 5:54:15 PM1/10/19
to men...@lists.mender.io
That’s correct.  The artifact script is delivered as part of the OTA update and executed at the time of the update; it is never stored in the target root filesystem. You inject them into the artifact using the mender-artifact command.

Drew

FAE

unread,
Jan 11, 2019, 3:00:31 AM1/11/19
to Mender List mender.io
Hello,
How do you inject them?

I'm using this command to create .mender file:

./mender-artifact write rootfs-image -t artik-a710 -n initial -u rootfs.raw -o artifact.mender

Mirza Krak

unread,
Jan 11, 2019, 3:48:21 AM1/11/19
to Mender List mender.io
On Fri, Jan 11, 2019 at 9:00 AM FAE <lidi...@gmail.com> wrote:
Hello,
How do you inject them?

I'm using this command to create .mender file:

./mender-artifact write rootfs-image -t artik-a710 -n initial -u rootfs.raw -o artifact.mender

There is a "-s" argument to the "rootfs-image" image you are using to inject state scripts,

$ mender-artifact write rootfs-image --help
NAME:
   mender-artifact write rootfs-image - Writes Mender artifact containing rootfs image

USAGE:
   mender-artifact write rootfs-image [command options] <image path>

OPTIONS:
   --update FILE, -u FILE           Update FILE.
   --device-type value, -t value    Type of device(s) supported by the update. You can specify multiple compatible devices providing this parameter multiple times.
   --artifact-name value, -n value  Name of the artifact
   --output-path value, -o value    Full path to output artifact file.
   --version value, -v value        Version of the artifact. (default: 2)
   --key value, -k value            Full path to the private key that will be used to sign the artifact.
   --script value, -s value         Full path to the state script(s). You can specify multiple scripts providing this parameter multiple times.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io

 Northern.tech AS | @northerntechHQ




FAE

unread,
Jan 11, 2019, 4:37:12 AM1/11/19
to Mender List mender.io, mirza...@northern.tech
Hello

Thank you Mirza!
Reply all
Reply to author
Forward
0 new messages