[systemd-devel] Handle device node timeout?

Michal Koutný mkoutny at suse.com
Tue Jan 30 14:35:23 UTC 2024


On Tue, Jan 16, 2024 at 04:06:46PM +0200, Mikko Rapeli <mikko.rapeli at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240130/01e1849b/attachment.sig>


More information about the systemd-devel mailing list