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

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Sat, 30 Nov 2024 10:19:11 +0000

>What am I doing wrong? Any ideas? Thanks!

  1. What exactly are you trying to do?
  2. What results did you get? (you apparently posted this, but without
context, it's difficult to tell what is relevant.)
  3. What results did you expect instead?


> $ 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

  - You do not need a shebang in an up script. Up scripts are not
executable files. If you change the interpreter in the shebang, the
up script will *still* be processed by execlineb.
  - You do not need an "exec" command. exec is implicit in an execline
script.
  - 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.

--
  Laurent
Received on Sat Nov 30 2024 - 11:19:11 CET

This archive was generated by hypermail 2.4.0 : Sat Nov 30 2024 - 11:19:45 CET