State-scripts documentation: how to use them without Yocto

What is the environment variables scriptsDir set to?

it was set to the location of host machine from where I generated the artifact

Does it work in you do “chmod +x” on the file before running the mender-artifact command?

I just checked the my state script ArtifactReboot_Leave_02 does have +x in it permission.
Just to re-iterate since I get confused between host machine definitions.

The environment variable scriptsDir is set to /hom/orange/Mender_software/State-Scritps

But I can try it again

So the issue that I was having, was that I wasn’t able to run the script on its own.
The main problem stemmed from creating the script on a windows machine and then transferring it over to linux machine.
I had to run dos2unix and the update was successfully

2 Likes

Thx for the update. Glad it worked out. And nice debugging. dos2unix was a nice read, and unknown to me.

Hi,

I’m developing an ArtifactInstall_Enter script and was wondering about the lifecycle of the script.

Is it intended, that a copy of the script is persisted in /var/lib/mender/scripts/ even after a successful mender -commit and the cleanup of the actual payload?

see here:

root:tmp# rm /var/lib/mender/scripts/ArtifactInstall_Enter_01_docker-commpose
root:tmp# mender install all-containers-local.mender --log-level debug > install.log 2>&1
root:tmp# mender -commit
INFO[0000] Loaded configuration file: /var/lib/mender/mender.conf
INFO[0000] Loaded configuration file: /etc/mender/mender.conf
INFO[0000] Mender running on partition: /dev/mmcblk2p2
Committing Artifact...
root:tmp# ls /var/lib/mender/scripts/ArtifactInstall_Enter_01_docker-commpose
/var/lib/mender/scripts/ArtifactInstall_Enter_01_docker-compose

Hi @oldev

  1. This should probably be a new topic.

  2. No, this should not be persisted. Interesting. Can you get me full logs?