From f886626e84b99eacda30baf8ce3e2827e8bb6cc7 Mon Sep 17 00:00:00 2001 From: Ingar Date: Sun, 13 Feb 2022 13:14:40 +0100 Subject: Added systemd service files to control LED status during boot. --- Makefile | 4 ++++ systemd/led-boot.service | 10 ++++++++++ systemd/led-ready.service | 10 ++++++++++ systemd/led-reboot.service | 10 ++++++++++ systemd/led-shutdown.service | 11 +++++++++++ 5 files changed, 45 insertions(+) create mode 100644 systemd/led-boot.service create mode 100644 systemd/led-ready.service create mode 100644 systemd/led-reboot.service create mode 100644 systemd/led-shutdown.service diff --git a/Makefile b/Makefile index 6e8c118..5806a91 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,6 @@ install: install -m 744 ledctl.py /usr/bin/ledctl + 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/systemd/led-boot.service b/systemd/led-boot.service new file mode 100644 index 0000000..5112f8b --- /dev/null +++ b/systemd/led-boot.service @@ -0,0 +1,10 @@ +[Unit] +Description=ledctl to indicate boot in progress status. +After=local-fs.target + +[Service] +Type=simple +ExecStart=/usr/bin/ledctl boot + +[Install] +WantedBy=multi-user.target diff --git a/systemd/led-ready.service b/systemd/led-ready.service new file mode 100644 index 0000000..79544ed --- /dev/null +++ b/systemd/led-ready.service @@ -0,0 +1,10 @@ +[Unit] +Description=ledctl indicate ready status +After=multi-user.target + +[Service] +Type=simple +ExecStart=/usr/bin/ledctl ready + +[Install] +WantedBy=graphical.target diff --git a/systemd/led-reboot.service b/systemd/led-reboot.service new file mode 100644 index 0000000..4214d9c --- /dev/null +++ b/systemd/led-reboot.service @@ -0,0 +1,10 @@ +[Unit] +Description=ledctl to indicate reboot in progress status. +DefaultDependencies=no + +[Service] +Type=simple +ExecStart=/usr/bin/ledctl boot + +[Install] +WantedBy=reboot.target diff --git a/systemd/led-shutdown.service b/systemd/led-shutdown.service new file mode 100644 index 0000000..07fc163 --- /dev/null +++ b/systemd/led-shutdown.service @@ -0,0 +1,11 @@ +[Unit] +Description=ledctl to indicate shut down status. +DefaultDependencies=no + +[Service] +Type=simple +ExecStart=/usr/bin/ledctl off + +[Install] +WantedBy=halt.target shutdown.target + -- cgit v1.2.3