📄 readme
字号:
sled -- serial line LEDThis software reads the state of a push button to and controls 2 LEDsconnected the serial line. It can be used the shutdown your serverwhen there is no keyboard connected and you don't want to log on tothe server as root in order shut it down.It works as follows:--------------------A green LED will indicate when the pushbutton is active and a slowlyblinking yellow LED indicates that the server is working or still inthe process of shutting down. To shut down the server you press thepushbutton for 3 seconds.When you press the pushbutton then the green LED will go off indicatingthe shutdown is in progress. The command "/sbin/shutdown -t2 -h now"is now executing. The yellow LED continues blinking while the server isstill shutting down. When the yellow LED stops blinking then you shouldstill wait 10 seconds before you power off the computer. The yellow LEDstops when all processes are killed and the disks are being unmounted.If your computer supports automatic power off then you do not have toworry about the 10 seconds. Just wait until it has switched off it self.You need the following parts to build this shutdown button with LEDs. * 1 green low power LED (a normal LED will also work but it will not be as bright) * 1 yellow low power LED * 2 resistors 1.5K Ohm * 1 resistor 6.8K Ohm * 1 small push button * 1 female RS232 serial line connector with cableThe RS 232 9 PIN D-SUB MALE connector at the Computer. 9 PIN-connector25 PIN-connector Name Dir Description 1 8 CD input Carrier Detect 2 3 RXD input Receive Data 3 2 TXD output Transmit Data 4 20 DTR output Data Terminal Ready 5 7 GND -- System Ground 6 6 DSR input Data Set Ready 7 4 RTS output Request to Send 8 5 CTS input Clear to Send 9 22 RI input Ring IndicatorThe parts are connected together as shown in the diagram called pictures/circuit.gifTake also a look at this article which describes the hardware:http://linuxfocus.org/English/January2000/article186.shtmlInstallation-------------run make to compile the software. -then create a link from the serial device (to which the circuit is connected ) to /dev/led: E.g: cd /dev ln -s ttyS1 led You can see which serial lines you have using: setserial -ag /dev/ttyS*-run make install to install the program called sled and an rc.d-script called sled_rc-test sled on its own by running sled /dev/led kill the sled process again by running killall sled-test the rc script by running /etc/rc.d/init.d/sled_rc start-create a link from /etc/rc.d/rc3.d/S99sled to /etc/rc.d/init.d/sled_rc There is no link for a kill script as we want the sled daemon to be killed as on of the last processes. The sled_rc script is tested under Redhat and Mandrake but works probably for many others.That's it.I decided to use /etc/rc.d/rc3.d/S99sled because it will bethe last command executed at startup. This means your server isfully operational when the LEDs are on.-------------------------------Versions:2000-12-03: version 0.1 first versionWritten by Guido Socher <guido@linuxfocus.org>Copyright: GPL, see http://www.gnu.org/copyleft/ for details
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -