From 29f32655842a0712e8db482bcefc4da8908460c8 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 23 Mar 2017 04:37:06 +0100 Subject: [PATCH] units: simplify rescue.service and emergency.service (#5623) The emergency.service and rescue.service units have become rather convoluted. We spawn multiple shells and the help text spans multiple lines which makes the units hard to read. Move the logic into a single shell script and call that via ExecStart. --- Makefile.am | 10 ++++++++++ src/sulogin-shell/.gitignore | 1 + src/sulogin-shell/systemd-sulogin-shell.in | 14 ++++++++++++++ units/emergency.service.in | 4 +--- units/rescue.service.in | 4 +--- 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 src/sulogin-shell/.gitignore create mode 100755 src/sulogin-shell/systemd-sulogin-shell.in diff --git a/Makefile.am b/Makefile.am index ad0f202..1fe86fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -443,6 +443,12 @@ userenvgenerator_PROGRAMS = \ 30-systemd-environment-d-generator endif +rootlibexec_SCRIPTS = \ + src/sulogin-shell/systemd-sulogin-shell + +EXTRA_DIST += \ + src/sulogin-shell/systemd-sulogin-shell.in + dist_bashcompletion_data = \ shell-completion/bash/busctl \ shell-completion/bash/journalctl \ @@ -6329,6 +6335,10 @@ src/core/%.systemd: src/core/%.systemd.in src/%.policy.in: src/%.policy.in.in $(SED_PROCESS) +src/sulogin-shell/%: src/sulogin-shell/%.in + $(SED_PROCESS) + $(AM_V_GEN)chmod +x $@ + shell-completion/%: shell-completion/%.in $(SED_PROCESS) diff --git a/src/sulogin-shell/.gitignore b/src/sulogin-shell/.gitignore new file mode 100644 index 0000000..01a3155 --- /dev/null +++ b/src/sulogin-shell/.gitignore @@ -0,0 +1 @@ +systemd-sulogin-shell diff --git a/src/sulogin-shell/systemd-sulogin-shell.in b/src/sulogin-shell/systemd-sulogin-shell.in new file mode 100755 index 0000000..d4f32af --- /dev/null +++ b/src/sulogin-shell/systemd-sulogin-shell.in @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ -x /bin/plymouth ]; then + /bin/plymouth --wait quit +fi + +cat <