Some docker and Linux issues

Hi,
I have some linux problems to solve on my rhasspy satellite (rpi 3)

  1. How can I auto start rhasspy container after each reboot?
    I prefer not to use a script because after each update the container id changes.
    this is my satellite container code I use:

    docker run -it -v “$HOME/.config/rhasspy/satellite:/profiles”
    –network host
    –device /dev/snd
    rhasspy/rhasspy:latest
    –profile en
    –user-profiles /profiles
    –http-port 13202
    –local-mqtt-port 13183

  2. How can I auto mount my NAS after each reboot?

  3. How to store alsamixer changes?
    After each reboot my volume decrease.
    I tried sudo alsactl store, but it didn’t worked

Starting the rhasspy container can be done by adding --restart unless-stopped to your docker run command. This will automatically restart the container after reboot unless you had it stopped previously.

like this?

docker run -it -v "$HOME/.config/rhasspy/satellite:/profiles" \
    --restart unless-stopped \
    --network host \
    --device /dev/snd \
    rhasspy/rhasspy:latest \
    --profile en \
    --user-profiles /profiles \
    --http-port 13202 \
    --local-mqtt-port 13183

How can I do it to an existing container?

docker update --restart unless-stopped container

Use the name or Id of your rhasspy container instead of container.

For more information:

Thanks!
1 down, 2 to go…

  1. How can I auto mount my NAS after each reboot?

  2. How can I store alsamixer changes?
    After each reboot my volume decrease.
    I tried sudo alsactl store, but it didn’t worked

Which audio device are you using? And is the alsa-restore service running?

I’m using a speaker that is connected to the aux output.

● alsa-restore.service - Save/Restore Sound Card State
   Loaded: loaded (/lib/systemd/system/alsa-restore.service; static; vendor preset: enabled)
   Active: active (exited) since Wed 2020-10-21 00:37:58 IDT; 15h ago
     Docs: man:alsactl(1)
  Process: 360 ExecStart=/usr/sbin/alsactl -E HOME=/run/alsa restore (code=exited, status=0/SUCCESS)
 Main PID: 360 (code=exited, status=0/SUCCESS)

Starting Save/Restore Sound Card State...
Started Save/Restore Sound Card State.

If you look at the content of the service (systemctl cat alsa-restore.service), you should see something like this at the end:

ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa restore
ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa store

Maybe use the same command to store your ALSA settings, e.g.:

sudo /usr/sbin/alsactl -E HOME=/run/alsa store

Does this restore the volume you set with alsamixer?