Oh, Let me explore and I would like to get back to you Oleorhagen, Give me sometime. It was nice talkng to u.
Like I said, I explored single file and script update module.
Both works great. But Im not able to fill in a “sudo reboot” script to the device without getting a 100% successful deployment. Its just “sudo reboot” in the bash script, maybe thats why it isnt deployed succesfully.
So, the script gets deployed to device and it reboots the device but deploys logs stucks at 70 % only in the mender server. Could you help me with a proper reboot script which support mender way.
I’m not a 100% understanding your question, so I going to answer:
“I have deployed a bash script which reboots the device, and the deployments gets stuck at 70% for a while in the Mender server, and then fails, what is going on?”
- Scripts cannot necessarily be used to reboot the device successfully in any state . This is because: How can Mender differentiate a reboot in a state-script from a power-loss, or other significant device failures? Thus, the only state-script state which permits this kind of functionality is
RebootEnter. Here a script which calls
rebootcan be run, and the Mender-client will be happy to reboot into the newly installed root-filesystem. If this is a script update module , it actually seems that the description on Mender-hub is wrong. This module does not support rebooting the device. I will fix this up, after clarifying with the Module author.
Thus, I guess what I am trying to say, is that rebooting the device at any time is not supported as it is now.
Solutions I can think of at the top of my head are:
- Write a custom update-module which runs the script in the
ArtifactRebootstate. This will allow the script to reboot the device successfully, unlike the current ‘official’ script update-module.
- Use some other tool to reboot the device (ssh? maybe), and keep it out of the Mender update loop.
Which solution is best is a little hard to say, as it depends on your specific use-case.
Sure @oleorhagen, I got ur point, Thank you so much for this amazing response. Ill go thru the ArtifactReboot state, Let me explore more on this.
Im actially facing a huge probs now, I have raised another issue:
No one is actually responding, so I refered here, sorry if its wrong way to do it. But its critical, Im not able to see anything wrong with my server, Its 16GB ram and 4 cpus, But Demo server GUIs doesn’t respond smoothly, It hangs, staggers whenever we click at anything on the gui.
Im facing one more issue with my deployment, Once a deployment failes or aborted, the release\artifact is tagged with “Inconsistent” name, and after that the device is never synced in real time update, and because of this I cant deploy any further releases unless I restart the device manually, which is a very unfavourable situation for Mender isn’t it.
In general I would recommend using another tool for rebooting your entire fleet. It could be done with an update module like:
#! /bin/bash set -e STATE="$1" FILES="$2" case "$STATE" in NeedsArtifactReboot) echo "Automatic" ;; esac exit 0
However, this is slightly cumbersome, as it would change the artifact name installed. There is simply no way around it.
Sure @oleorhagen, I understand this reboot is not happening for now, Now Ill give a try with the state script u have mentioned… Changing the artifact name isn’t a nice way actually. But Ill try this once.
@oleorhagen Any idea on this ?
Sure, I’m looking into now, Looks different way to execute\deploy this to a device.
The inconsistent state is related to a failed update-module update.
I’m going to need a little more information on what exactly you are trying to do?
Is this from the script update-module?
Yes, It is from the script module, Few times it worked fine, But twice it failed and yes, It went to “Inconsistent” mode, But after that, the device stopped taking real time update.
Im facing this lke I mentioned 2 days back, One of my deployment is failed and current software I can see “Inconsistent”, after this Mender deployment isnt happening, deploy is stuck in ‘pending. Why all this happening, device type and every detail is fine.
I think this might be helpful
@oleorhagen So this is a bug which has not been resolved?
No, this is a feature ticket.
Im very sorry @oleorhagen, I couldtn reply u sooner. What is this ticket, I can see its open, and this is what Im looking for I guess, Still I couldnt resolve it, Im not able to deploy any further releases to the device because of a past failure deployment and causing it to be "Inconsistent " artifact. I think I’ll have only one option to decommision, But even after decommission, no change.
From what I understand the device should still be able to take a new update.
What exactly is the script doing? Is trying to reboot?
Hi @oleorhagen, Im using dir module to deploy a directory of two python files, and its done, and further execute the python file using .sh script module. And it fails for some reason, Even if it fails , it shouldnt cause these many issues right, The Entire mender is slow, and freezy, and now can’t deploy update to taht device also.
Could you post a deployment log here?