Questions regarding 320L shutdown

Visto 127 veces
Saltar al primer mensaje no leído

Ferrari

no leída,
15 abr 2018, 8:51:4315/4/18
a Alt-F
Hi there,

I've just setup Alt-F on my old NAS and already noticed some weird things about it.

At first I wanted to remotely shut it down so I've tried this solution from Lukas Trtik (found in this group):

What worked for me:
1) installed Alt-F sudo package
2) created an user called 'shutdown' in Alt-F administration directly (for me - easier than looking for a Linux command)
3) connected via ssh and used visudo to add this: shutdown ALL=NOPASSWD:/sbin/poweroff
4) calling it from Windows using PuTTY: plink.exe -l shutdown -pw PASSWORD SERVERNAME -m nas_shutdown.txt
where nas_shutdown.txt contains: sudo /sbin/poweroff

Just to find out that I don't have a "poweroff" under sbin nor a "shutdown", just a "halt". So I tried halting, but the NAS didn't poweroff properly: system seems to have stopped, but the LEDs were still on, pressing the power button only made its LED blink so I had to physically remove the power cable.

Then I gave up the idea of remote shutdown and decided to use the power button (would be proper shutdown according to this page: https://sourceforge.net/p/alt-f/wiki/How%20to%20Use/). But my NAS didn't behave as described there and I found that "The DNS320L/327L front power button can only be used to power off the box" inside Alt-F.

Finally, on the same page inside Alt-F where I found that it says under "System Safety" that reaching "Critical Temp" the "Command to execute" is "/usr/sbin/poweroff". That leaves me a bit worried, because as I said earlier ... poweroff is just not there and it'll probably fry.

So my questions:
1- Anyway to remotely shutdown the 320L?
2- If I press the power button, wait for power LED to blink and release it, will my 320L shutdown properly?
3- Should I replace "Critical Temp Command to execute"? Anything better than "/usr/sbin/halt" (which is there but doesn't work properly)?
One more thing! On which log are failed poweroffs logged? What to search for?

Don't get me wrong, Alt-F still seems far better than the original Firmware, congrats!
I just want to make the most of the NAS and need to understand the shutdown a bit better.

João Cardoso

no leída,
16 abr 2018, 20:13:5216/4/18
a Alt-F


On Sunday, 15 April 2018 13:51:43 UTC+1, Ferrari wrote:
Hi there,

I've just setup Alt-F on my old NAS and already noticed some weird things about it.

At first I wanted to remotely shut it down so I've tried this solution from Lukas Trtik (found in this group):

What worked for me:
1) installed Alt-F sudo package
2) created an user called 'shutdown' in Alt-F administration directly (for me - easier than looking for a Linux command)
3) connected via ssh and used visudo to add this: shutdown ALL=NOPASSWD:/sbin/poweroff
4) calling it from Windows using PuTTY: plink.exe -l shutdown -pw PASSWORD SERVERNAME -m nas_shutdown.txt
where nas_shutdown.txt contains: sudo /sbin/poweroff

Just to find out that I don't have a "poweroff" under sbin

 [root@DNS-325]# which poweroff
/usr/sbin/poweroff

Which, on Alt-F-1.0, signals that a poweroff (and not a reboot) is requested and calls /etc/init.d/rcE, which orderly stops the system

nor a "shutdown", just a "halt". So I tried halting, but the NAS didn't poweroff properly:

'halt' just "halts" the running operating system, 'poweroff' does a clean, ordered, shutdown and then powers off the hardware

 
system seems to have stopped, but the LEDs were still on, pressing the power button only made its LED blink so I had to physically remove the power cable.

Then I gave up the idea of remote shutdown and decided to use the power button (would be proper shutdown according to this page: https://sourceforge.net/p/alt-f/wiki/How%20to%20Use/).

That is very old and applies only to the DNS-323/321/325, please feel free to edit it.
 
But my NAS didn't behave as described there and I found that "The DNS320L/327L front power button can only be used to power off the box" inside Alt-F.

Yes, after being pressed for more than 6 seconds as the original vendor firmware does (that is controlled by the hardware, not configurable).
 

Finally, on the same page inside Alt-F where I found that it says under "System Safety" that reaching "Critical Temp" the "Command to execute" is "/usr/sbin/poweroff". That leaves me a bit worried, because as I said earlier ... poweroff is just not there and it'll probably fry.

Sometime around the dev cycle, and to support several boards, '/sbin/poweroff' was removed and was replaced by a /usr/sbin/poweroff script that calls the real 'poweroff' which by itself deploys thought initd (configured in /etc/inittab) /etc/init.d/rcE. Convolved? Has to be...
 

So my questions:
1- Anyway to remotely shutdown the 320L?

cal 'poweroff', /usr/sbin is in your path.
You can even make cron power off the box.
 
2- If I press the power button, wait for power LED to blink and release it, will my 320L shutdown properly?

Yes
 
3- Should I replace "Critical Temp Command to execute"?

No. Unless you want to... that's the reason why it is editable (don't remember ever using it)
 
Anything better than "/usr/sbin/halt" (which is there but doesn't work properly)?
One more thing! On which log are failed poweroffs logged? What to search for?

Don't know... probably you can't, as it makes no sense to log something that is going to vanish (logs).
 

Don't get me wrong, Alt-F still seems far better than the original Firmware, congrats!
I just want to make the most of the NAS and need to understand the shutdown a bit better.

It depends on the box models, on the 320L/327 it is necessary to send a command to an integrated circuit (a microcontroller in itself) for it to triggers poweroff, its a modified version of Andreas Böhler dns320l-daemon reverse engineering work, see https://sites.google.com/site/altfirmware/home left panel credits

Ferrari

no leída,
21 abr 2018, 12:59:5221/4/18
a al...@googlegroups.com

Yes, after being pressed for more than 6 seconds as the original vendor firmware does (that is controlled by the hardware, not configurable).
Oddly enough, when I was using the original firmware, whenever I did it I'd get a message saying it wasn't properly shutdown. Anyway that's good to know it's not a 'forced shutdown'.


Sometime around the dev cycle, and to support several boards, '/sbin/poweroff' was removed and was replaced by a /usr/sbin/poweroff
I see, I should've paid more attention. Anyway, I got my script working, here are updated steps for a remote shutdown (in case someone else is interested):
    1) install Alt-F sudo package (thru Alt-F - found under packages)
    2) create an user called 'USERNAME' in Alt-F
    3) connected via ssh (using PuTTY) and use visudo (:wq to save and quit) to add this: USERNAME ALL=NOPASSWD:/usr/sbin/poweroff
    4) create file nas_shutdown.txt containing: sudo /usr/sbin/poweroff
    5) call it from Windows using PuTTY: plink.exe -l USERNAME -pw PASSWORD SERVERNAME -m "C:\...\nas_shutdown.txt"

Thanks João

ScDc

no leída,
22 abr 2018, 2:48:2622/4/18
a al...@googlegroups.com
Hello Ferrari -

Thanks for the recap!

In steps 1) through 5)

(a) steps 4) and 5) can be reduced to

plink.exe -l USERNAME -pw PASSWORD SERVERNAME sudo  /usr/sbin/poweroff

No need for creating a text file with a command which can be placed as above

(b) with "Public key user authentication" steps 1) through 5) can be "reduced" to
0) setup "Public key user authentication" for YourPC->YourNAS for user root@NAS
5)  plink.exe -l root <NAS IP> /usr/sbin/poweroff

However,  this method will require some time looking into "Public key user authentication" with PuTTY method (I've done similar on Linux box) and might not worth the time spent, and your approach is preferred.

Also, one should be conscious about giving YourPC simplified access to root@NAS.

Cheers!

Ferrari

no leída,
25 abr 2018, 19:11:4025/4/18
a Alt-F
Thanks ScDc!

I did find it strange to use a text file, but haven't played around with it. Now it's fixed.

Unfortunately, I don't have the time to look into "public key user authentication", but it's good to know of its existence.

Anyway, I'm glad that my NAS is finally working as I want it to (it wasn't possible with the original firmware).
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos