by byteme » Sat Feb 23, 2013 3:49 pm
$this->bbcode_second_pass_quote('agillis', 'I')f you add this to /etc/rc.local the LED should turn green after boot.
$this->bbcode_second_pass_code('', '
#!/bin/sh
echo none > /sys/class/leds/status\:blue\:health/trigger
echo default-on > /sys/class/leds/status\:green\:health/trigger')
If your really clever you could add some if condition to this script to make sure the system is really working before you turn the LED green.
Put that in a script (I used /usr/local/bin/ledboot.sh) and make a service file for systemd
$this->bbcode_second_pass_code('', 'nano /usr/lib/systemd/system/ledboot.service')
PASTE THIS:
$this->bbcode_second_pass_code('', '
[Unit]
Description=LED Turn Off
After=syslog.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/ledboot.sh &
[Install]
WantedBy=multi-user.target
')
then:
$this->bbcode_second_pass_code('', 'systemctl enable ledboot')
reboot and enjoy

As a side note, I like my lights off.
$this->bbcode_second_pass_code('', '
#!/bin/sh
echo "none" > /sys/class/leds/status\:blue\:health/trigger
echo "none" > /sys/class/leds/status\:green\:health/trigger')
And this will make the LED blink on hard drive access. iostat will accept specific partitions. check the man page. You can use vnstat and do the same for network (use a little math to set a threshold), blink on web server access, etc. You can use each led for a different function.
$this->bbcode_second_pass_code('', '
echo "timer" > /sys/class/leds/status\:blue\:health/trigger
iostat -z -d 1 | sed -u -e '1d' -e 's/Device.*/0/' -e 's/sd.*/100/' -e '/^$/d' > /sys/class/leds/status\:blue\:health/delay_on &')