The BeagleBone Black has four user LED’s that by default will indicate the current state of the device. At times you may wish to disable them, especially if you have a small or large cluster of them, a single board will light up any room with a constant blue blinking light not to mention if you had 3 or 4 of them, perhaps you just wish to not draw attention to the device while it is in use running what ever tasks you set it up to do.
For whatever reason, you may need to do this, it’s not that hard however things have changed in the Ubuntu 18.04 release so you will need to do a few things first. Below is the default use of the four LED’s and what they mean.
- USER0 is the heartbeat indicator from the Linux kernel.
- USER1 turns on when the SD card is being accessed
- USER2 is an activity indicator. It turns on when the kernel is not in the idle loop.
- USER3 turns on when the onboard eMMC is being accessed.
1.) Create rc-local.service File.
Ubuntu 18.04 uses systemd now so rc.local is not enabled, so to disable all the user LED’s at boot we need to first enable the rc.local service. Create a new file for the service.
$ sudo nano /etc/systemd/system/rc-local.service
2.) Edit rc-local.service File.
Copy and paste the below into the new file you just created. Use (CTRL+o) to save and (CTRL+x) to close nano.
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99[Install]
WantedBy=multi-user.target
3.) Create rc.local File.
Now we need to create the local file for the service to include at boot.
$ sudo nano /etc/rc.local
4.) Edit rc.local File.
Now you need to copy and paste the bellow info into the rc.local file. Use (CTRL+o) to save and (CTRL+x) to close nano.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.exit 0
5.) Make /etc/rc.local executable.
For the commands that will be contained inside /etc/rc.local, it needs to be executable.
$ sudo chmod +x /etc/rc.local