March 25, 201610 yr Where in the process do you see powerdown doing the diagnostics dump, after it kills all the processes?
March 25, 201610 yr Author TBH I have no idea. I am reacting to the conversation above. I have no idea how the Powedown Plugin works. However, if I was to speculate, I would imagine the Plugin monitors for a "Power Button Press" event somehow. If this is right (and again this is speculation) the grab of the diagnostics zip file could be the "first thing" it does before initiating a shut down?
March 25, 201610 yr It doesn't monitor anything. That's already handled by base linux functionality. It hooks into /etc/rc.d/rc.local_shutdown via the following line inside that file: [ -x /etc/rc.d/rc.unRAID ] && /etc/rc.d/rc.unRAID stop The file /etc/rc.d/rc.local_shutdown is hooked in via /etc/rc.d/rc.6 (also symlinked from /etc/rc.d/rc.0) and also /etc/rc.d/rc.K .
March 25, 201610 yr TBH I have no idea. I am reacting to the conversation above. I have no idea how the Powedown Plugin works. However, if I was to speculate, I would imagine the Plugin monitors for a "Power Button Press" event somehow. If this is right (and again this is speculation) the grab of the diagnostics zip file could be the "first thing" it does before initiating a shut down? The powerdown plugin hooks to power and shutdown events - webgui powerdown event, UPS shutdown, power button press, control-alt-delete, and cli commands. Each of these events initiates the powerdown plugin script. I would think the best time to capture the diagnostics is before any shutdown process starts. The state of unraid should be captured while it is running as any process shutdown would possibly clear the problem and not provide the actual state of unraid when the problem occurred. For example if there is a smb issue causing a hang up and smb is shutdown before the diagnostics is run, the smb issue would probably be cleared. I will take a look at the powerdown plugin code and the diagnostics script and see if I can come up with a solution.
March 25, 201610 yr If everyone thinks this is best off in the powerdown plugin then I guess I can contact dlandon. It could be as simple as just executing the script when the button press is captured? I am surprised that there seems to be consensus for this though as I would like to point out that this does NOT deal with the case of a lockups / resets etc. I didn't see it as a consensus for an alternative, just another good idea. And while I like the idea, it doesn't replace yours, because Powerdown only works if you still have control. If the system has crashed or completely locked up, it's too late, you may only be able to power off manually. A tail on the console and your constant diagnostics gathering are the only ways I know of to capture the last info a dying system can give. Especially when it's one of those cases where everything appears to be working fine, nothing in the logs, and without warning it crashes hard, leaving no clues.
March 25, 201610 yr I didn't mean to exclusively say what you've done should only be in the PowerDown Script. I just believe as we all strive to make our machines more and more automated and user friendly it just made sense as a good Fail Safe place in case of a problem since things are shutting down and it would be nice to know what the heck happened to cause the shutdown and have a log for it.
March 27, 201610 yr Author Dan is very good! The capture of diagnostics on power down (if using the power down plugin) is now incorporated. http://lime-technology.com/forum/index.php?topic=31735.500
Archived
This topic is now archived and is closed to further replies.