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.

powerbutton clean shutdown

Featured Replies

Good morning Joe,

 

I followed the description and here is the result:

root@Tower:~# ps -ef | grep acpid | grep -v grep
root       117     2  0 Oct26 ?        00:00:00 [kacpid]
root      1405     1  0 Oct26 ?        00:00:00 /usr/sbin/acpid

 

root@Tower:~# cat /proc/acpi/event
button/power PWRF 00000080 00000001

 

root@Tower:/etc/acpi# grep power /etc/acpi/acpi_handler.sh
# tmm - power off via webGui
#     power) /sbin/init 0
      power) /usr/local/sbin/powerdown

 

The last line indicates, that WeeboTech's powerdown package is NOT being used (....which is the only way how I'm able to power down my unRAID server. Any of the running processes e.g. Twonky Media Server do prevent to un-mount the disks and stop the array. I can´t even stop the array via the original menu).

 

Anyhow I have to change the last line power) /sbin/powerdown to: /sbin/powerdown. Am I correct?

 

How to do that to avoid that the change is being lost after the next reboot?

It looks like you are installing the powerdown package in the "go" script.

 

If you were installing it through unMENU's package manager it also performs these steps in addition to the installpkg.

 

You are probably doing this already:

CTRLALTDEL=yes installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

 

After it you can add these four lines to the end of the "go" script:

[ -f /sbin/powerdown ] && mv /usr/local/sbin/powerdown /usr/local/sbin/unraid_powerdown

[ -f /sbin/powerdown ] && sed -i "sX/usr/local/sbin/powerdownX/sbin/powerdownX" /etc/acpi/acpi_handler.sh

[ ! -f /usr/local/sbin/unraid_powerdown ] && sed -i  "sX/sbin/init 0X/sbin/powerdownX" /etc/acpi/acpi_handler.sh

sysctl -w kernel.poweroff_cmd=/sbin/powerdown

 

The first renamed the lime-tech supplied "powerdown" command to "unraid_powerdown"

The next two edit the acpi_handler.sh script so it will invoke the newly installed powerdown command.

The third is only needed if you are running an older version of unRAID where lime-tech did not supply its own powerdown command.

The 4th line is so the linux kernel's shutdown will use the new command instead of /sbin/shutdown or /sbin/poweroff

 

Looks like my prior post made it easy to figure out what will happen when you press the power button on your server.  Easy, isn't it..  Lots happens when you momentarily press the power button...

 

Joe L.

  • Replies 103
  • Views 47.1k
  • Created
  • Last Reply

:)  :)  :)

 

That did the job. Thanks a lot Joe.

  • 7 months later...

Old topic, but i still got a question concerning this.

I want to make the dune shut down my server correctly.

A person on mpcclub is willing to make a dsf file which can be run from the dune

He only needs to know how i launch this powerdown script.

My knowledge concerning this is not enough.

I just press the case power button, and its triggering somehow the powerdown script.

Can you tell me what i need to tell the guy so he knows how i trigger this powerdown script?

  • 10 months later...

Good morning Joe,

 

I followed the description and here is the result:

root@Tower:~# ps -ef | grep acpid | grep -v grep
root       117     2  0 Oct26 ?        00:00:00 [kacpid]
root      1405     1  0 Oct26 ?        00:00:00 /usr/sbin/acpid

 

root@Tower:~# cat /proc/acpi/event
button/power PWRF 00000080 00000001

 

root@Tower:/etc/acpi# grep power /etc/acpi/acpi_handler.sh
# tmm - power off via webGui
#     power) /sbin/init 0
      power) /usr/local/sbin/powerdown

 

The last line indicates, that WeeboTech's powerdown package is NOT being used (....which is the only way how I'm able to power down my unRAID server. Any of the running processes e.g. Twonky Media Server do prevent to un-mount the disks and stop the array. I can´t even stop the array via the original menu).

 

Anyhow I have to change the last line power) /sbin/powerdown to: /sbin/powerdown. Am I correct?

 

How to do that to avoid that the change is being lost after the next reboot?

It looks like you are installing the powerdown package in the "go" script.

 

If you were installing it through unMENU's package manager it also performs these steps in addition to the installpkg.

 

You are probably doing this already:

CTRLALTDEL=yes installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

 

After it you can add these four lines to the end of the "go" script:

[ -f /sbin/powerdown ] && mv /usr/local/sbin/powerdown /usr/local/sbin/unraid_powerdown

[ -f /sbin/powerdown ] && sed -i "sX/usr/local/sbin/powerdownX/sbin/powerdownX" /etc/acpi/acpi_handler.sh

[ ! -f /usr/local/sbin/unraid_powerdown ] && sed -i  "sX/sbin/init 0X/sbin/powerdownX" /etc/acpi/acpi_handler.sh

sysctl -w kernel.poweroff_cmd=/sbin/powerdown

 

The first renamed the lime-tech supplied "powerdown" command to "unraid_powerdown"

The next two edit the acpi_handler.sh script so it will invoke the newly installed powerdown command.

The third is only needed if you are running an older version of unRAID where lime-tech did not supply its own powerdown command.

The 4th line is so the linux kernel's shutdown will use the new command instead of /sbin/shutdown or /sbin/poweroff

 

Looks like my prior post made it easy to figure out what will happen when you press the power button on your server.  Easy, isn't it..  Lots happens when you momentarily press the power button...

 

Joe L.

 

Thanks for this.

 

Was having the same problem but added your 4 lines to my go script and the power button now shuts down the server.

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.