From be011ccff1c55d6d07a1d2259165c5a9ac75f9fa Mon Sep 17 00:00:00 2001 From: Ingar Date: Sun, 13 Feb 2022 16:13:10 +0100 Subject: Fixed systemd boot status handling. --- Makefile | 3 +-- ledctl.py | 4 ++++ systemd/led-boot.service | 2 +- systemd/led-ready.service | 2 +- systemd/led-reboot.service | 10 ---------- 5 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 systemd/led-reboot.service diff --git a/Makefile b/Makefile index 5806a91..2777bb8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ install: install -m 744 ledctl.py /usr/bin/ledctl + ln -sf /usr/bin/ledctl /usr/lib/systemd/system-shutdown/ install -m 644 systemd/led-boot.service /etc/systemd/system/led-boot.service install -m 644 systemd/led-ready.service /etc/systemd/system/led-ready.service - install -m 644 systemd/led-reboot.service /etc/systemd/system/led-reboot.service - install -m 644 systemd/led-shutdown.service /etc/systemd/system/led-shutdown.service diff --git a/ledctl.py b/ledctl.py index 5f7caed..da42efa 100644 --- a/ledctl.py +++ b/ledctl.py @@ -62,7 +62,11 @@ def rgbval(colorname): 'cyan': (0, 255, 255), 'pink': (255, 0, 255), 'boot': (63, 15, 0), + 'reboot' : (63, 15, 0), 'ready': (0, 15, 0), + 'halt' : (0, 0, 0), + 'poweroff' : (0, 0, 0), + 'kexec' : (63, 0, 63), } return switch.get(colorname, (255, 255, 255)) diff --git a/systemd/led-boot.service b/systemd/led-boot.service index 5112f8b..2414c8f 100644 --- a/systemd/led-boot.service +++ b/systemd/led-boot.service @@ -3,7 +3,7 @@ Description=ledctl to indicate boot in progress status. After=local-fs.target [Service] -Type=simple +Type=oneshot ExecStart=/usr/bin/ledctl boot [Install] diff --git a/systemd/led-ready.service b/systemd/led-ready.service index 79544ed..1dc62e9 100644 --- a/systemd/led-ready.service +++ b/systemd/led-ready.service @@ -3,7 +3,7 @@ Description=ledctl indicate ready status After=multi-user.target [Service] -Type=simple +Type=oneshot ExecStart=/usr/bin/ledctl ready [Install] diff --git a/systemd/led-reboot.service b/systemd/led-reboot.service deleted file mode 100644 index 4214d9c..0000000 --- a/systemd/led-reboot.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=ledctl to indicate reboot in progress status. -DefaultDependencies=no - -[Service] -Type=simple -ExecStart=/usr/bin/ledctl boot - -[Install] -WantedBy=reboot.target -- cgit v1.2.3