by calzon65 » Wed Jun 05, 2013 1:01 am
I recently reinstalled ArchLinuxARM on my PogoPlug V2. I wanted to find a new way to set the LED to green after my system reached multi-user mode and I wanted to utilize the new systemd approach.
Below is a systemd .service script I named setgreenled.service and installed (saved) in /etc/systemd/system. If you create this .service file you will need to activate it with the command systemctl enable setgreenled, then reboot or if you want to test it right away use the command systemctl start setgreenled. Here is the setgreenled.service file.
$this->bbcode_second_pass_code('', '
[Unit]
Description=Set Green LED
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c '/usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger'
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/bash -c '/usr/bin/echo default-on > /sys/class/leds/status\:green\:health/trigger'
[Install]
WantedBy=multi-user.target
')
If you don't want to use the systemd .service file method above, you can create a tmpfiles.d .conf file. I also tested making one of these files, which I called setgreenled.conf and saved the file in /usr/lib/tmpfiles.d. Just save the file in that directory and reboot. Here is the file.
$this->bbcode_second_pass_code('', '
w /sys/class/leds/status\:blue\:health/trigger - - - - none
w /sys/class/leds/status\:green\:health/trigger - - - - default-on
')