[systemd-devel] When System is Degraded

Lennart Poettering lennart at poettering.net
Tue Jun 7 09:44:18 UTC 2016


On Mon, 06.06.16 10:27, Aaron_Wright at selinc.com (Aaron_Wright at selinc.com) wrote:

> I'm using systemd in an embedded device that some some LEDs. I'd like to 
> make an LED red when the system starts up degraded, and green when 
> everything is working normally.
> I'm having a hard time figuring out where to fit this in.
> I tried using a service that runs "systemctl is-system-running" after I've 
> reached my target, but that command returns "starting", obviously.
> What's a better way to run a command when the system is "running" vs 
> "degraded"?

Hmm, that's a very good question.

Other than suggesting to write a small service that waits for the
StartupFinished bus signal I have no good suggestion I fear. That
service could start any time, would just wait for the signal, and do
what you want it to do, and exit then...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list