BRiT Posted March 25, 2016 Share Posted March 25, 2016 Where in the process do you see powerdown doing the diagnostics dump, after it kills all the processes? Quote Link to comment
danioj Posted March 25, 2016 Author Share Posted March 25, 2016 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? Quote Link to comment
BRiT Posted March 25, 2016 Share Posted March 25, 2016 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 . Quote Link to comment
dlandon Posted March 25, 2016 Share Posted March 25, 2016 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. Quote Link to comment
RobJ Posted March 25, 2016 Share Posted March 25, 2016 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. Quote Link to comment
kizer Posted March 25, 2016 Share Posted March 25, 2016 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. Quote Link to comment
danioj Posted March 27, 2016 Author Share Posted March 27, 2016 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.