mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] projectroot: rauc-mark-good: adapt unit properties from systemd-bless-boot.service
@ 2021-08-24 16:52 Bastian Krause
  2021-10-07 10:18 ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Bastian Krause @ 2021-08-24 16:52 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Krause

Mark the system "good" when the boot-complete.target [1] is reached.

"Type=oneshot" (instead of implicit "Type=simple") makes sure the unit is
considered started once "rauc status mark-good" exits.

"RemainAfterExit=yes" ensures that this service unit is only started once
[2].

These options were adapted from [3] and [4].

[1] https://www.freedesktop.org/software/systemd/man/systemd.special.html#boot-complete.target
[2] https://www.freedesktop.org/software/systemd/man/systemd.service.html#id-1.10.4
[3] https://github.com/systemd/systemd/blob/main/units/systemd-bless-boot.service.in
[4] https://github.com/rauc/meta-rauc/pull/197

Signed-off-by: Bastian Krause <bst@pengutronix.de>
---
 projectroot/usr/lib/systemd/system/rauc-mark-good.service | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/projectroot/usr/lib/systemd/system/rauc-mark-good.service b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
index af4daab9f..06f9fa8fd 100644
--- a/projectroot/usr/lib/systemd/system/rauc-mark-good.service
+++ b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
@@ -2,8 +2,12 @@
 Description=RAUC Good-marking Service
 ConditionKernelCommandLine=|bootchooser.active
 ConditionKernelCommandLine=|rauc.slot
+After=boot-complete.target
+Requires=boot-complete.target
 
 [Service]
+Type=oneshot
+RemainAfterExit=yes
 ExecStart=/usr/bin/rauc status mark-good
 
 [Install]
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [APPLIED] projectroot: rauc-mark-good: adapt unit properties from systemd-bless-boot.service
  2021-08-24 16:52 [ptxdist] [PATCH] projectroot: rauc-mark-good: adapt unit properties from systemd-bless-boot.service Bastian Krause
@ 2021-10-07 10:18 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2021-10-07 10:18 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Krause

Thanks, applied as ce0e0bed719844ef6f813c4d176e350bd424636c.

Michael

[sent from post-receive hook]

On Thu, 07 Oct 2021 12:18:29 +0200, Bastian Krause <bst@pengutronix.de> wrote:
> Mark the system "good" when the boot-complete.target [1] is reached.
> 
> "Type=oneshot" (instead of implicit "Type=simple") makes sure the unit is
> considered started once "rauc status mark-good" exits.
> 
> "RemainAfterExit=yes" ensures that this service unit is only started once
> [2].
> 
> These options were adapted from [3] and [4].
> 
> [1] https://www.freedesktop.org/software/systemd/man/systemd.special.html#boot-complete.target
> [2] https://www.freedesktop.org/software/systemd/man/systemd.service.html#id-1.10.4
> [3] https://github.com/systemd/systemd/blob/main/units/systemd-bless-boot.service.in
> [4] https://github.com/rauc/meta-rauc/pull/197
> 
> Signed-off-by: Bastian Krause <bst@pengutronix.de>
> Message-Id: <20210824165247.31292-1-bst@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/projectroot/usr/lib/systemd/system/rauc-mark-good.service b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
> index af4daab9f443..06f9fa8fd419 100644
> --- a/projectroot/usr/lib/systemd/system/rauc-mark-good.service
> +++ b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
> @@ -2,8 +2,12 @@
>  Description=RAUC Good-marking Service
>  ConditionKernelCommandLine=|bootchooser.active
>  ConditionKernelCommandLine=|rauc.slot
> +After=boot-complete.target
> +Requires=boot-complete.target
>  
>  [Service]
> +Type=oneshot
> +RemainAfterExit=yes
>  ExecStart=/usr/bin/rauc status mark-good
>  
>  [Install]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-07 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 16:52 [ptxdist] [PATCH] projectroot: rauc-mark-good: adapt unit properties from systemd-bless-boot.service Bastian Krause
2021-10-07 10:18 ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox