Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
inbox:howto:howtoshutdownthenslu2usingthehardwarebutton [2011/01/08 17:13] – better english pttoh:linksys:nslu2:nslu2.hardware.button [2023/10/25 13:42] (current) – [The Hardware Button of the NSLU2] linus
Line 1: Line 1:
 +====== The Hardware Button of the NSLU2 ======
 +The [[toh:linksys:nslu2|NSLU2]] has a hardware power on-/power off-button.
 +{{ http://upload.wikimedia.org/wikipedia/commons/4/46/NSLU2_Front_resized.jpg}}
 +
 +As any other hardware button, its function can be configured in OpenWrt. In order to use the hardware button of the NSLU2 to shut it down/ switch if off, follow the steps below:
 +
 +====== Configuration Steps ======
 +-> [[docs:guide-user:hardware:hardware.button]]
 +
 +===== 1. edit /etc/inittab =====
 +
 +add the following line to the /etc/inittab
 +
 +|<code>
 +::ctrlaltdel:/bin/shutdown.sh
 +</code>|
 +
 +The file /etc/inittab (running 8.09.2 without having made manual adoptions) should then look like this:
 +
 +|<code>
 +::sysinit:/etc/init.d/rcS S boot
 +::shutdown:/etc/init.d/rcS K stop
 +tts/0::askfirst:/bin/ash --login
 +ttyS0::askfirst:/bin/ash --login
 +tty1::askfirst:/bin/ash --login
 +::ctrlaltdel:/bin/shutdown.sh
 +</code>|
 +
 +===== 2. create a file including the commands below and save it under /bin =====
 +
 +on the console type
 +<code>
 +root@nslu2:~# touch /bin/shutdown.sh
 +vi /bin/shutdown.sh
 +</code>
 +
 +and enter the following lines of code
 +
 +|<code>
 +
 +#!/bin/sh /etc/rc.common
 + 
 +/etc/init.d/rcS K stop
 +/sbin/poweroff
 +
 +</code>|
 +
 +These lines first stop all running services and then shut the NSLU2 down.
 +
 +Finally, make the file /bin/shutdown.sh executable by
 +<code>
 +chmod 750 /bin/shutdown.sh
 +</code>
 +
 +You are done. After a reboot you should be able to use the power off-button.
 +
 +
 +===== Sources =====
 +http://www.artanis.info/blog/?p=98 (in german)
 +
 +Further information on the NSLU2 can be found here: [[toh:linksys:nslu2|Linksys NSLU2]]
  
  • Last modified: 2023/10/25 13:42
  • by linus