Bug#1093002: rng-tools-debian: systemd service fails instead of skipping

Sven Geuer sge at debian.org
Wed Jan 15 15:04:51 GMT 2025


On Wed, 2025-01-15 at 00:47 +0100, Thorsten Glaser wrote:
> On Tue, 14 Jan 2025, Luca Boccassi wrote:
> 
> > It looks like this is doing some checks, and intends to skip. But just
> > exiting means the service is recorded as failed, and this will likely
> > trip other tests, hence the severity to stop migrating to testing for
> > now.
> 
> Ah, ouch. Agreed.

Looking into it now.

> 
> > There are several ways to do such checks natively _and_ resulting in a
> > service that is skipped, rather than failed.

Wasn't aware of this. Thanks for the pointers.

> 
> I actually asked you (systemd maintainers in Cc) about this in:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504044#162
> 
> > Or, you could have a special exit status that means the service is
> > marked as successful:
> > 
> > https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#SuccessExitStatus=
> > 
> 
> RestartPreventExitStatus was the one I found and wondered about.
> 
> > You could run the script that does the check in an ExecCondition=
> > statement - if that fails, the service is marked as skipped.
> > 
> > https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecCondition=
> 
> That’s also an option.

Applying ExecCondition to me seems the most reasonable solution to this
bug.

> 
> Would you mind looking at the aforementioned mail again, as it
> also has other questions, and suggest how we best deal with this?
> 
> Additionally… what should we do if no random device is found,
> as opposed to quietly not starting if one is found that doesn’t
> need rngd to run? The sysvinit script will also just exit 0 in
> that case, but it doesn’t have service tracking, and a subsequent
> status query will show the dæmon as not running, obviously. I’ve
> got no idea how this maps best into the systemd ecosystem, though
> I’m currently leaning towards making all the “expected not to start”
> conditions the same.

I believe the service should get skipped per ExecCondition also in this
case (no random device found/available).

> 
> Thanks in advance,
> //mirabilos

Sven

-- 
GPG Fingerprint
3DF5 E8AA 43FC 9FDF D086 F195 ADF5 0EDA F8AD D585
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 854 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20250115/1088fedd/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list