sraptor Posted June 19, 2013 #1 Posted June 19, 2013 How you can make it work from the physical button from the computer? In nas4free is only pushing it. But how you do in synology? Thanks Quote
Schnapps Posted June 21, 2013 #2 Posted June 21, 2013 Hi mate, I didn't get the message, and i think your English needs to be "polished" a bit in order to make others understand what you want. Sorry Quote
sraptor Posted June 21, 2013 Author #3 Posted June 21, 2013 I would like to turn off the server without going to the web gui and say turn off. How can I turn off from the physical server. Thanks Quote
darkest_star Posted October 17, 2013 #4 Posted October 17, 2013 I have the same problem. I want to press the power button on my XPEnology box to shutdown the OS safely. @sraptor: Btw, I understood your initial question very well. What I found out is, that there is no driver installed as default. If I check "cat /proc/acpi/event" and press the power button no event will be logged. After loading the button.ko kernel module I see an event after pressing the button: DiskStation> cat /proc/acpi/event button/power PWRF 00000080 00000001 The event needs a event handler ... I will check the forum..... Quote
clunc Posted October 19, 2013 #5 Posted October 19, 2013 I have the same problem, for now I have not found solution.. Quote
Rand__ Posted October 23, 2013 #7 Posted October 23, 2013 Have you taken a look at https://wiki.archlinux.org/index.php/Acpid ? That might help:) Quote
darkest_star Posted October 25, 2013 #8 Posted October 25, 2013 @Rand__: Thank you! I know acpid from every Linux distribution I've used. But I was wondering that it's not already included to the XPEnology releases. I'm currently setting up a build machine and will build the missing binary. Quote
darkest_star Posted October 29, 2013 #9 Posted October 29, 2013 Here is my solution for this issue: powering off the DiskStation by shortly pressing the power button. I'm using 4.2.3211++ (repack v1.2) natively installed. If you want to follow these steps, do it as user root! I have packed all my file to a tar-file, which can be downloaded here: https://www.dropbox.com/s/tzg9n0336zqez79/acpid-files.tar 1. Make button.ko loaded automatically - open /etc/rc for editing - search for the first occurence of the environment variable KERNEL_MODULES and put 'button' at the end of the string. 2. Install a acpid daemon - For this I have rebuilt the busybox with enabled acpid. Since I'm not sure, if the other busybox features are correctly working with my own built busybox, I'm using it only as acpid. The acpid in the download package is simply a renamed busybox. - copy acpid to /bin as user root and check that it's executable. Should look like this: DiskStation> ll /bin/acpid -rwxr-xr-x 1 root root 536592 Oct 27 18:08 /bin/acpid 3. Install a acpid start/stop script - create an startup script /usr/syno/etc/rc.d/S30acpid.sh #!/bin/sh # # This goes in /usr/syno/etc/rc.d and gets run at boot-time. PATH_ACPID=/bin/acpid case "$1" in start) if [ -x "$PATH_ACPID" ] ; then echo "start acpid" $PATH_ACPID fi ;; stop) echo "stop acpid" killall acpid > /dev/null 2>&1 logger -p daemon.error "$0 stopped acpid" ;; *) echo "usage: $0 { start | stop }" >&2 exit 1 ;; esac - check that it's executable. Should look like this: DiskStation> ll /usr/syno/etc/rc.d/S30acpid.sh -rwxr-xr-x 1 root root 359 Oct 29 20:45 /usr/syno/etc/rc.d/S30acpid.sh 4. Add a acpid event config - Finally add a acpid config file for the power button event /etc/acpi/PWRF/00000080 #!/bin/sh poweroff - also here: check it's owned by root and executable: DiskStation> ll /etc/acpi/PWRF/00000080 -rwxrwxrwx 1 root root 20 Oct 17 22:28 /etc/acpi/PWRF/00000080 Finally reboot your box. Now you could safely shutdown your box by pressing the power button. For a vSphere based XPenology system it should now be possible that the system will be shutdown when the ESXi is shutting down. But this I haven't tested. Hope it helps you too! Quote
Dadudeondacouch Posted October 30, 2013 #10 Posted October 30, 2013 OMG I LOVE YOU!!! Tested and working great on my N54L Quote
Eduardo Posted October 30, 2013 #11 Posted October 30, 2013 Working flawlessly here on my N54L. Thanks a bunch mate. Quote
Trantor Posted October 30, 2013 #12 Posted October 30, 2013 Thank darkest_star for this Using poweroff command in /etc/acpi/PWRF/00000080 will of course shutdown the machine but if I'm right will not stop/unmount properly services/volumes. I think we should use syno_poweroff_feasible_check and/or syno_poweroff_task commands. Quote
Dadudeondacouch Posted October 30, 2013 #13 Posted October 30, 2013 I didn't get any errors when I tested but the dsm was idle, should I not use this method until you guys have refined it? Quote
darkest_star Posted October 30, 2013 #14 Posted October 30, 2013 From my point of view the 'poweroff' command really does a graceful shutdown of the system. If I press the button I see, that my HDD LEDs are flickering and after a while one after another is powered off. The shutdown (from pressing power button until power-off) takes around 20-30 seconds. Btw, I have a hybrid RAID with 3 disks and after a poweroff with the button I never had a problem with my RAID. There was never a complain caused by a "hard" power off. But I didn't knew the special shutdown commands (syno_poweroff_feasible_check and/or syno_poweroff_task) and would test it with them today evening. Quote
darkest_star Posted October 30, 2013 #15 Posted October 30, 2013 After some tests and after reading on the internet "syno_poweroff_feasible_check" seems to be a more save way to shutdown the system. As far as I understand it would prevent shutting down, if e.g. backup operations are still running. So, I would also vote for replacing "poweroff" with "syno_poweroff_feasible_check" in the acpid-configure script /etc/acpi/PWRF/00000080. But nevertheless, I had not observed any problems with the simple "poweroff". Quote
intelligence Posted October 30, 2013 #16 Posted October 30, 2013 Will this solution help if the system freezes aswell? I've had rare ocurrences when I needed to hold down the power button on my Synology to have it reboot. Doesn't feel that safe. Quote
darkest_star Posted October 30, 2013 #17 Posted October 30, 2013 Will this solution help if the system freezes aswell?I've had rare ocurrences when I needed to hold down the power button on my Synology to have it reboot. Doesn't feel that safe. Depends on what you mean with freeze. If only the webservices freezes maybe that the powerbutton shutdown may work. What do you exactly mean with "freezes'? Quote
Dadudeondacouch Posted October 31, 2013 #18 Posted October 31, 2013 When I replace poweroff with syno_poweroff_feasible_check nothing happens even though dsm is idle? no shutdown, am I missing something? Quote
Rand__ Posted October 31, 2013 #19 Posted October 31, 2013 After calling syno_poweroff_feasible_check manually: ps |grep power 17883 root 2540 S < /sbin/poweroff 17885 root 2540 S < sh -c /usr/syno/bin/syno_poweroff_task -p > /dev/nul 17886 root 8300 S < /usr/syno/bin/syno_poweroff_task -p 17927 root 2544 R grep power It should poweroff the DS shortly afterwards;) Quote
Dadudeondacouch Posted October 31, 2013 #20 Posted October 31, 2013 Probably should have mentioned I don't know much about linux lol Quote
Rand__ Posted October 31, 2013 #21 Posted October 31, 2013 Well regardless of that it should have powered of your system - it did with my vm after calling it? Not sure if it will do the same based on button press but it should. Quote
Dadudeondacouch Posted October 31, 2013 #22 Posted October 31, 2013 On my n54l nothing happens, poweroff was working fine I double checked the file and permissions all ok. maybe wifi connection, bt or usb ups is causing a problem/telling dsm not to shutdown? I will test more tomorrow time for sleep now, I have been at work since 5am I had to drive for 7.5hrs swap over a server and drive 7.5hrs back to the office. Quote
intelligence Posted October 31, 2013 #23 Posted October 31, 2013 Will this solution help if the system freezes aswell?I've had rare ocurrences when I needed to hold down the power button on my Synology to have it reboot. Doesn't feel that safe. Depends on what you mean with freeze. If only the webservices freezes maybe that the powerbutton shutdown may work. What do you exactly mean with "freezes'? Well, I've had my syno box become unresponsive, that I can't access the web gui or transmission even. I just thought that it was the OS that froze, but now that you mention it, it seems more logical that it's the web serve that might have crashed or something. If the whole OS froze (probably not likely with a unix based OS?) then I guess data would be lost if you were to pull the plug. Quote
Rand__ Posted October 31, 2013 #24 Posted October 31, 2013 Have you tried connecting via ssh? That should circumvent any gui issues Quote
darkest_star Posted October 31, 2013 #25 Posted October 31, 2013 Have you tried connecting via ssh?That should circumvent any gui issues Would be also my suggestion. If you have such problems try to connect via ssh and shut down the system via the known poweroff commands. Quote
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.