Re: Silent or move to /dev/null alsactl restore out

From: <lumaro_at_disroot.org>
Date: Sat, 30 Nov 2024 13:07:33 +0100

El 2024-11-30 12:59, Hoël Bézier escribió:

> Am Sa, Nov 30, 2024 am 10:19:11 +0000 schrieb Laurent Bercot: $ cat
> /etc/s6/sv/alsa/up
> #!/bin/execlineb -P
> if -t { test -e /var/lib/alsa/asound.state }
> fdmove -c 2 1
> exec alsactl restore
> [snip]
> - Your up script is behaving differently depending on whether the
> result of the test is true or false. The "alsactl restore" command
> may or may not be called, depending on an external property (whether
> the asound.state file exists or not). This means that your machine
> state after boot is not guaranteed; this is generally a bad idea.

Sure, but what if the "alsactl restore" command depends on
/var/lib/alsa/asound.state existing to run properly? Although this adds
a race condition to the script, it seems better to me than using
"foreground { … }" because one may not want to ignore all errors that
may be raised by the command.

Hoël

Totally agree, in this case it is more convenient "foreground" ...
thanks !! Luis.
Received on Sat Nov 30 2024 - 13:07:33 CET

This archive was generated by hypermail 2.4.0 : Sat Nov 30 2024 - 13:08:03 CET