Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automated Diagnostics File Gathering Script

Featured Replies

Where in the process do you see powerdown doing the diagnostics dump, after it kills all the processes?  ???

 

 

  • 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?

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 .

 

 

 

 

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.

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.

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.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.