Posts by fenjen

    Hi

    I've connected my Raspberry Pi 5 with my TV using the HDMI-0 (first HDMI) port. This works fine, I can listen to music and see videos - all on my TV. But I also have an AVR receiver and now I'm trying to set everything up to get the following:

    1. I want to watch the news on my TV without turning on my AVR. I like my TV audio sound for news and documentaries.
    2. I want to be able to listen to audio files (e.g. mp3) on my AVR without the TV on.
    3. I want to enjoy my AVR's audio output when watching movies or playing games.

    I thought, it's easy to setup:

    1. First HDMI is always active. (I can watch the news without turning on the AVR.)
    2. Second HDMI is always active. (I can listen to music without turning on the TV.)

    But although it sounds super easy, I haven't been able to set it up. There's an alternative option hidden in scenario 3: because watching movies implies the TV on, I could connect my AVR with another cable through the TV optical out. Maybe this reveals any pulseaudio dual/mirror audio options?

    Or is that all a bad idea?

    Kind regards
    Steffen

    Is it possible to have the drive auto-mounted with 777? (dmask=0000, but how?)

    The config file of udevil shows other defaults for exfat 🤔

    Bash
    $ grep default_options_exfat /etc/udevil/udevil.conf
    default_options_exfat     = nosuid, noexec, nodev, noatime

    The log entries:

    Code
    Mar 25 21:38:13 LibreELEC systemd[1]: Starting [email protected]...
    Mar 25 21:38:14 LibreELEC udevil[509]: Mounted /dev/sda2 at /media/mydisk
    Mar 25 21:38:16 LibreELEC systemd[1]: Finished [email protected].

    Should/can I run nginx as root?

    nginx runs as root, php-fpm doesn't. In order to have php-fpm run as root:

    Code
    # /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/config/php/www2.conf
    user = root
    group = root

    This will lead to medium frequent log messages

    Code
    [25-Mar-2024 22:59:32] ERROR: [pool www] please specify user and group other than root
    [25-Mar-2024 22:59:32] ERROR: FPM initialization failed
    [25-Mar-2024 22:59:33] ERROR: [pool www] please specify user and group other than root
    [25-Mar-2024 22:59:33] ERROR: FPM initialization failed
    [25-Mar-2024 22:59:34] ERROR: [pool www] please specify user and group other than root
    [25-Mar-2024 22:59:34] ERROR: FPM initialization failed
    [25-Mar-2024 22:59:36] ERROR: [pool www] please specify user and group other than root
    [25-Mar-2024 22:59:36] ERROR: FPM initialization failed

    It's still possible to set root:

    Bash
    sed -i 's~exec /usr/sbin/php-fpm83 -F~& -R~' /etc/s6-overlay/s6-rc.d/svc-php-fpm/run

    While this is an incredibly evil hack, it gives php-fpm write access to the external hard disk. Well, an incredibly evil hack is better than nothing.

    What I don't understand is, that even is this command is executed as a custom setup script (described in https://docs.linuxserver.io/general/contai…#custom-scripts) I need to once:

    Bash
    docker restart nginx

    🤯 ...this doesn't make sense to me.

    Quote

    Maybe I could modify the sudoers and run a command from within the container with sudo

    Tried to add ALL ALL=(ALL) NOPASSWD:ALL to the sudoers file. The first attempt didn't work, so I stopped because I don't think this is a step in the right direction.

    Quote

    Any other ideas?

    Not yet :(

    Hi

    I have an nginx Docker container that needs to access a directory on an auto-mounted external hard disk (/media/mydisk/directory). Here's the mount:

    Bash
    $ mount | grep mydisk
    /dev/sda2 on /var/media/mydisk type exfat (rw,nosuid,nodev,noexec,noatime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro)
    
    $ ls -ld /media/mydisk/directory
    drwxr-xr-x    2 root     root       [...]

    The directory is available to the container with a bind mount (-v /media/mydisk/directory:/directory) and I can access it. I can however only read from it. But my container needs write access.

    Running whoami from PHP returns "nobody", and thus is_writable("/directory") says "false". I think it's basically the same problem reported here: Docker containers and permissions in LE - except that I can't format the drive with extfs.

    What options do I have?

    • Is it possible to have the drive auto-mounted with 777? (dmask=0000, but how?)
    • Should/can I run nginx as root? (tried to set user root; in config/nginx/nginx.conf, but that had no effect)
    • Maybe I could modify the sudoers and run a command from within the container with sudo? (a test was unsuccessful)
    • Any other ideas?

    Thanks, Steffen

    I wouldn't recommend manually editing the settings.xml. Just edit the addon settings in the gui.

    I agree. But I found this much easier compared to using the TV remote with Kodi's horrible visual keyboard (where I accidentally hit CANCEL at the end of typing 80% of the time due to its immature behavior). I found that LibreELEC doesn't read the settings.xml after the change, hence the hint to do a quick reboot.

    For installing a package, using our package install mod is much easier

    Ah, thanks! The setup script is perfect for me (very easy and effective), but I see the need and many benefits of a standardized way.

    Thanks!

    OK I found the perfect documentation for questions 1 and 2: https://docs.linuxserver.io/general/container-customization/ Funny they give the same example with ffmpeg there 😀

    Answer to 1 (bind mount additional host directories) and 2 (install additional packages):

    Create two directories for custom startup scripts and additional services:

    Bash
    # the directories need to be owned by root
    mkdir /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/custom-cont-init.d
    mkdir /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/custom-services.d

    Edit the settings.xml

    Code
    <setting id="E_additional">-v /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/custom-cont-init.d:/custom-cont-init.d -v /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/custom-services.d:/custom-services.d</setting>

    Put a script which installs the required packages in /storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/custom-cont-init.d. The example from linuxserver.io for installing ffmpeg:

    Bash
    #!/bin/bash
    
    
    echo "**** installing ffmpeg ****"
    apk add --no-cache ffmpeg

    Reboot LibreELEC (to have the settings.xml reloaded), and check

    Bash
    # the two directories should show up here
    docker exec -it nginx bash -c "ls /"
    # check ffmpeg (should print /usr/bin/ffmpeg)
    docker exec -it nginx bash -c "which ffmpeg"

    Hello!

    I've been using OSMC instead of LibreELEC for years because I needed some additional OS features on my Raspberry Pi. Now I've upgraded to the RPi5 and was appalled to find that OSMC has no support for it. Some research revealed that LibreELEC now offers a powerful Docker integration. That is amazing! Yesterday I installed LibreELEC with the Docker/LinuxServer.io addon and pulled the nginx container image from LinuxServer.io. Everything works great so far (thanks!!) and I am very excited about the entire configuration management via Samba shares (for LibreELEC and for the containers). But now I'm stuck because I don't know how to configure the container to establish the services I had in OSMC:


    1. From inside the LinuxServer.io nginx container, I want to store files on a physical drive mounted in LibreELEC. How do I have to change the settings.xml for this?

    Code
    <setting id="V_config" default="true">/storage/.kodi/userdata/addon_data/docker.linuxserver.nginx/config</setting>

    I naively tried <setting id="V_something">/var/media/mydisk/Downloads</setting>, but docker inspect -f '{{ .Mounts }}' ... shows only the config mount.


    2. I need one or two additional packages in my container, like ffmpeg. I've read that LibreELEC does all container management (updates and restarts) automatically, which is incredibly convenient. What is the easiest (most "lightweight") way to add two or three additional packages to the nginx base container without having to renounce LibreELEC's automatic restart/update features?


    3. In the long run, I would like to have another "generic" (maybe Debian based) container for some mini-services and scripts. I assume I have to create my own Docker constainer image. But I haven't figured out how I would add this container to LibreELEC.


    I've searched the Github LinuxServer.io nginx repo and I read LinuxServer.io docker addons and general docker info. But I was unable to answer these questions. Please excuse me if I missed something.


    Thanks a lot!

    Steffen