Raspberry pi 启动完成后,如何关闭Raspberry Pi 2上的PWR LED?

Raspberry pi 启动完成后,如何关闭Raspberry Pi 2上的PWR LED?,raspberry-pi,raspbian,raspberry-pi2,Raspberry Pi,Raspbian,Raspberry Pi2,根据,我了解到Raspberry Pi 2上的PWR LED可以通过以下命令从命令行关闭: echo 0 | sudo tee /sys/class/leds/led1/brightness 我还了解到,可以在/boot/config.txt中添加以下内容,以便在启动时立即永久禁用PWR LED: # Disable the PWR LED. dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off 在引导过程中保持PWR LED亮

根据,我了解到Raspberry Pi 2上的PWR LED可以通过以下命令从命令行关闭:

echo 0 | sudo tee /sys/class/leds/led1/brightness
我还了解到,可以在/boot/config.txt中添加以下内容,以便在启动时立即永久禁用PWR LED:

# Disable the PWR LED.
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
在引导过程中保持PWR LED亮起,但在引导过程完成后将其关闭的最佳/最简单方法是什么

我尝试将以下内容添加为/etc/init.d/lightsoff:

### BEGIN INIT INFO
# Provides:          lightsoff
# Required-Start:    $all
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Disable PWR LED when startup is complete
### END INIT INFO

echo none | sudo tee /sys/class/leds/led1/trigger
echo 0 | sudo tee /sys/class/leds/led1/brightness
然后我跑:

chmod 0755 /etc/init.d/lightsoff

不幸的是,PWR LED在启动时亮起并保持亮起。我遗漏了什么?

是否检查了脚本是否已执行?我也有类似的问题。在我的例子中,systemd不关心我的init.d脚本。。通过systemd脚本来完成它为我修复了它