On Tue, Jan 16, 2024 at 04:06:46PM +0200, Mikko Rapeli 
<mikko.rap...@linaro.org> wrote:
> I have services which depend on a specific device node. How can I run
> some recovery actions when the default 90s timeout for finding this
> device is hit?

(Not sure if it is the best practice to do a plain-text fall back in
case crypted device setup fails.)

> OnFailure= doesn't work as the service is not even started.

Compare it to how emergency.target is implemented.
You could hook into primary target's OnFailure= and start another target
with alternative device.
 
> Fix is to remove Encrypt=tpm2 from systemd-repart config to generate plain
> ext4 rootfs. Running the recovery scripts manually in emergency console 
> works, but I
> can't figure out how to trigger this recovery automatically.

You could let emergency.target pull in your recovery. (But as I pondered
above a separate target may be a better approach than overloading
emergency.)

HTH,
Michal

Attachment: signature.asc
Description: PGP signature

Reply via email to