Changing LED status failed

Post Reply
masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Changing LED status failed

Post by masterkw »

Hi,

I want to change the (blue) LED status of my Odroid C1+ from heartbeat to

Code: Select all

echo sd >/sys/class/leds/blue\:heartbeat/trigger
I‘ve put this command in /etc/rc.local, but after a reboot the file is deleted. Manually set in terminal it works.

OS: ArchLinuxARM alarm 3.10.107-4-ARCH #1

Is there another solution?

Regards,
Oliver

mad_ady
Posts: 8604
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 491 times
Contact:

Re: Changing LED status failed

Post by mad_ady »

/etc/rc.local is deleted after boot? That's weird...

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Yes, I did it several times. First I‘ve thought the rc.local didn‘t work, but as I‘ve checked it the file was deleted after reboot.

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Okay, I‘ve did all new, now the file kept present...but hasn’t been execute.

mad_ady
Posts: 8604
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 491 times
Contact:

Re: Changing LED status failed

Post by mad_ady »

Make sure it has the executable bit set and also that the commands inside don't return an error (by default it stops executing on error).

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Yes, it is set.

Code: Select all

-rwxr-xr-x 1 root root 68 Oct 12 07:03 /etc/rc.local

#!/bin/sh

echo sd >/sys/class/leds/blue\:heartbeat/trigger

exit 0
As I said at the beginning, manually set it works.

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

I‘m running out of ideas. Reset the executable bits, deleted file/created new one, put in a test comamand (creating a test log). Last one wasn’t executed, too.

User avatar
odroid
Site Admin
Posts: 35602
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1204 times
Been thanked: 879 times
Contact:

Re: Changing LED status failed

Post by odroid »

Did you activate the rc-local service?
https://superuser.com/questions/278396/ ... c-rc-local

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Thank you for this advice.

If I start/test it with systemctl start rc-local.service, it works.

Enabeling the service causes an error message and no execution after reboot.

Code: Select all

The unit files have no installation config (WantedBy=, RequiredBy=, Also=,      
Alias= settings in the [Install] section, and DefaultInstance= for template     
units). This means they are not meant to be enabled using systemctl.            
                                                                                
Possible reasons for having this kind of units are:                             
* A unit may be statically enabled by being symlinked from another unit's       
  .wants/ or .requires/ directory.                                              
* A unit's purpose may be to act as a helper for some other unit which has      
  a requirement dependency on it.                                               
* A unit may be started when needed via activation (socket, path, timer,        
  D-Bus, udev, scripted systemctl call, ...).                                   
* In case of template units, the unit is meant to be enabled with some          
  instance name specified. 

User avatar
odroid
Site Admin
Posts: 35602
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1204 times
Been thanked: 879 times
Contact:

Re: Changing LED status failed

Post by odroid »

Since I've not used Arch-Linux several years, I have no idea what is wrong.
These users thanked the author odroid for the post:
masterkw (Tue Oct 13, 2020 3:42 pm)

brad
Posts: 1297
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 94 times
Been thanked: 149 times
Contact:

Re: Changing LED status failed

Post by brad »

masterkw wrote:
Tue Oct 13, 2020 3:37 pm
Thank you for this advice.

If I start/test it with systemctl start rc-local.service, it works.

Enabeling the service causes an error message and no execution after reboot.

Code: Select all

The unit files have no installation config (WantedBy=, RequiredBy=, Also=,      
Alias= settings in the [Install] section, and DefaultInstance= for template     
units). This means they are not meant to be enabled using systemctl.            
                                                                                
Possible reasons for having this kind of units are:                             
* A unit may be statically enabled by being symlinked from another unit's       
  .wants/ or .requires/ directory.                                              
* A unit's purpose may be to act as a helper for some other unit which has      
  a requirement dependency on it.                                               
* A unit may be started when needed via activation (socket, path, timer,        
  D-Bus, udev, scripted systemctl call, ...).                                   
* In case of template units, the unit is meant to be enabled with some          
  instance name specified. 
Can you run "systemctl daemon-reload" and then show the contents of /etc/systemd/system/rc-local.service and the output of "systemctl status rc-local"

Do you enable with "systemctl enable rc-local"? Also try to enable the preset "systemctl preset rc-local.service"
These users thanked the author brad for the post:
masterkw (Tue Oct 13, 2020 11:45 pm)

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

BTW, I'm an ARM-noob and happy that I've just made it to install ArchLinuxARM on my Odroid two weeks ago. ;)

Okay, here we go...

Code: Select all

systemctl daemon-reload
Nothing happened...


Content of /etc/systemd/system/rc-local.service

Code: Select all

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

[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


systemctl status rc-local

Code: Select all

* rc-local.service - /etc/rc.local Compatibility
     Loaded: loaded (/etc/systemd/system/rc-local.service; static)
     Active: inactive (dead)
Yes, I've enabled service with systemctl enable rc-local. Withenable preset nothing else happened.

brad
Posts: 1297
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 94 times
Been thanked: 149 times
Contact:

Re: Changing LED status failed

Post by brad »

masterkw wrote:
Tue Oct 13, 2020 5:09 pm
Content of /etc/systemd/system/rc-local.service
It seems to be missing some configuration in arch.

Add the following to the end of the file to make it look like this and run "systemctl daemon-reload" then reboot to check

Code: Select all

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

[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
If this resolves the problem you can maybe raise the problem with the arch image maintainers for proper resolution.
These users thanked the author brad for the post:
masterkw (Tue Oct 13, 2020 11:45 pm)

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Adding the two lines makes no difference. Quite weird that the manual input and the start of the service work.

mad_ady
Posts: 8604
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 491 times
Contact:

Re: Changing LED status failed

Post by mad_ady »

After you add them you'll need to run
sudo systemctl daemon-reload
sudo systemctl enable rc-local

and reboot
These users thanked the author mad_ady for the post (total 3):
masterkw (Tue Oct 13, 2020 11:45 pm) • brad (Wed Oct 14, 2020 7:12 am) • odroid (Wed Oct 14, 2020 10:39 am)

masterkw
Posts: 11
Joined: Thu Oct 01, 2020 7:27 pm
languages_spoken: German, English
ODROIDs: Odroid C1+
Location: Germany
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Changing LED status failed

Post by masterkw »

Yessssss, I got it! Thank you very much!

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest