public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 2/3] Add systemd service file to launch bricklayer in first install mode.
Date: Fri, 24 Feb 2023 17:36:04 +0100	[thread overview]
Message-ID: <20230224163605.90519-2-stefan.schantl@ipfire.org> (raw)
In-Reply-To: <20230224163605.90519-1-stefan.schantl@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

This service file will launch bricklayer in first-install mode
in case the firstinstall flag on the filesystem is set.

Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
 .../bricklayer-first-install.service.in       | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/systemd/bricklayer-first-install.service.in b/src/systemd/bricklayer-first-install.service.in
index e69de29..2ba2dd5 100644
--- a/src/systemd/bricklayer-first-install.service.in
+++ b/src/systemd/bricklayer-first-install.service.in
@@ -0,0 +1,30 @@
+[Unit]
+Description=Launch bricklayer to configure pre-generated images
+After=plymouth-quit-wait.service
+After=systemd-vconsole-setup.service systemd-user-sessions.service
+# getty-pre.target is a pasive target, we need to request it before we can use it
+Wants=getty-pre.target
+# Prevent getty from running on any consoles before we are done
+Before=getty-pre.target
+Conflicts=plymouth-quit-wait.service bricklayer-first-install.service
+ConditionPathExists=/.firstinstall
+
+[Service]
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes
+# Tell systemd to stop logging to the console, to prevent it's messages
+# with interfering with the TUI of bricklayer potentially running there
+ExecStartPre=/bin/kill -SIGRTMIN+21 1
+ExecStartPre=-/bin/plymouth quit
+ExecStart=@BINDIR@/bricklayer --first-install
+# Re-enable systemd console logging once bricklayer is done
+ExecStartPost=/bin/kill -SIGRTMIN+20 1
+TimeoutSec=0
+RemainAfterExit=no
+StandardInput=tty
+StandardOutput=tty
+StandardError=tty
+
+[Install]
+WantedBy=multi-user.target
-- 
2.30.2


  reply	other threads:[~2023-02-24 16:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 16:36 [PATCH 1/3] Substitute @BINDIR@ Stefan Schantl
2023-02-24 16:36 ` Stefan Schantl [this message]
2023-02-24 16:36 ` [PATCH 3/3] Add systemd service file to launch bricklayer in install mode Stefan Schantl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230224163605.90519-2-stefan.schantl@ipfire.org \
    --to=stefan.schantl@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox