Yeah, I think there is a definitely a bug with the if query on the line 396. More general way would be to remove “^”, because the line doesn’t always starts with “container”.
It starts with “linuxcontainer=” here.
Clearly, that’s one change which I need to account for.
I will take care of that one and snag the null issue in the process
Easier fix would be to use “-q” with grep and its return codes.
For example:
grep -ziq "container=lxc" /proc/1/environ && LinuxContainer=1 || echo "not a LXC"
Question: Do you still have the udevadm bug which my preinstall testing is looking for?
I had to code around that
Ehm, What was that about? I don’t know. Does it have to do with passing through PCI/GPU?
Edit: If you have some links to that issue, I could check…
YEP!
USB tuners and DRM (/dev/dri)
# Continue udev setup if it exists
if [ "$UDEVCMD" != "" ]; then
# Write the udev rule and trigger for any already inserted USB device. Modern distros do not have this problem.
# Functionality not impaired for users of HDHomeRun / network tuners.
# Write custom video udev rule for the VideoGroup
# Set generic udev rule for USB tuners
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="0100", GROUP="video", MODE="0664"' > /lib/udev/rules.d/60-tv-butler.rules
# Construct the DRM subsystem rule based on local configuration.
echo 'SUBSYSTEM=="drm",' GROUP=\"$VideoGroup\" ', MODE="0660"' > /lib/udev/rules.d/60-plex-hw-transcoding.rules
# Reload and trigger unless in a Linux Container (known udev bug)
if [ "$(GetConfig LinuxContainer)" = "0" ]; then
$UDEVCMD control --reload-rules
$UDEVCMD trigger
fi
fi
Here is one reference on Ubuntu.
The specific issue is when you reload and fire the rules in postinstall ![]()
I’ll take a look at it.
For me I’m passing through my onboard Intel GPU to the LXC with the following script “mount_hook.sh”, that’s running on the start of the LXC:
mkdir -p ${LXC_ROOTFS_MOUNT}/dev/dri
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/card1 c 226 1
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/renderD128 c 226 128
mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/fb0 c 29 0
With it I can successfully passthrough my GPU, as I can run “vainfo” in that LXC and the plex installation finds the intel GPU. I had a one week plex pass trial and the hardware transcoding did also work with my LXC.
If I had time to run it down again, Google: udevadm retrigger bug
I will get this change for you into the packaging.
I’ll grab it during my next maintenance update
(I just did a hotfix for PMS 1.28.1 & 2 – so no more favors from Engineering for a while hahahaha )
It’s just a warning, the udev thing is more important. I’m on it.
I’m not sure, if there is a safer way to run udevadm in a container.
Maybe you could run it with udevadm trigger --action=change, so it doesn’t trigger every device.
Other than that, I get following output “it is a privileged container, because of the GPU passthrough”:
# cat /lib/udev/rules.d/60-tv-butler.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="0100", GROUP="video", MODE="0664"
root@Plex:~# cat /lib/udev/rules.d/60-plex-hw-transcoding.rules
SUBSYSTEM=="drm", GROUP="video" , MODE="0660"
root@Plex:~# udevadm control --reload-rules
Failed to send reload request: No such file or directory
root@Plex:~# udevadm trigger --action=change
Failed to write 'change' to '/sys/devices/LNXSYSTM:00/uevent': Read-only file system
root@Plex:~# echo $?
1
root@Plex:~# vainfo
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
root@Plex:~#
One more thing, maybe I should start a new thread. The service seems degraded (although it works perfectly). In the logs there is this here:
# systemctl status plexmediaserver.service
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-08-18 18:03:24 CEST; 6min ago
Process: 151 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
Main PID: 165 (Plex Media Serv)
Tasks: 54 (limit: 76600)
Memory: 89.9M
CPU: 3.706s
CGroup: /system.slice/plexmediaserver.service
├─165 /usr/lib/plexmediaserver/Plex Media Server
├─364 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-788f82488/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.28.1.6>
├─411 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.28.1.6104-788f82488 32600
└─442 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-788f82488/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.2>
Aug 18 18:03:24 Plex systemd[1]: Starting Plex Media Server...
Aug 18 18:03:24 Plex systemd[1]: Started Plex Media Server.
Aug 18 18:03:37 Plex [411]: Critical: libusb_init failed
Aug 18 18:03:37 Plex Plex Media Server[411]: Critical: libusb_init failed
libusb_init failed
libusb-1.0-0 is installed.
The joys of running Plex in a container.
![]()
It only matters if you’re using USB tuners and didn’t pass a USB port.
Still funny that it tries to initialize some non existing device.
How does it know you don’t have it until it tries to init (probe)
and to probe it, you need call lsb_init
Sorry this a bit late to reply, was out of town for a few days and thought this was resolved but maybe not even still with the latest build (at least for my setup).
I took a further look at the information you posted and it looks like it doesn’t error now that there is “” around “$DistroName” but I believe the variable is still not actually pulling in a value or a correct value at least.
Current Sources Folder and outputs of files:
~$ ls /etc/apt/sources.list.d/
bullseye-backports.list plexmediaserver.list plexmediaserver.list.save plexmediaserver.list.dpkg-old
~$ cat /etc/apt/sources.list.d/plexmediaserver.list
deb https://downloads.plex.tv/repo/deb public main
~$ cat /etc/apt/sources.list.d/plexmediaserver.list.save
# When enabling this repo please remember to add the PlexPublic.Key into the apt setup.
# wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
#deb https://downloads.plex.tv/repo/deb/ public main
~$ cat /etc/apt/sources.list.d/plexmediaserver.list.dpkg-old
deb https://downloads.plex.tv/repo/deb public main
Unable to view keyrings that should have been generated:
~$ ls /usr/share/keyrings/
debian-archive-bullseye-automatic.gpg debian-archive-buster-security-automatic.gpg debian-archive-stretch-automatic.gpg
debian-archive-bullseye-security-automatic.gpg debian-archive-buster-stable.gpg debian-archive-stretch-security-automatic.gpg
debian-archive-bullseye-stable.gpg debian-archive-keyring.gpg debian-archive-stretch-stable.gpg
debian-archive-buster-automatic.gpg debian-archive-removed-keys.gpg
It looks like the plexmediaserver.list.save file has the correct information. I can manually add the keyring, correct the plexmediaserver.list file, remove the other list files and update apt-get to start using them correctly but just wanted to alert you since the postinstall script still didn’t set the repo as you desired on my machine. If its a config issue on only my machine I can simply just make the changes manually but just wanted to bring it to your attention.
This is in the .6018 thread.
Which specific package are you using?
what is the contents of the list.save?
what is the contents of the new .list ?
which debian version please ?
Most important, which CPU are you using?
If you still have /tmp/plexinstaller.log , let me see that too please.
/tmp/plexinstaller.log contains all the information detected during preinst which is given to postinst
plexmediaserver_1.28.2.6106-44a5bbd28_amd64.deb
~$ cat /etc/apt/sources.list.d/plexmediaserver.list.save
# When enabling this repo please remember to add the PlexPublic.Key into the apt setup.
# wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
#deb https://downloads.plex.tv/repo/deb/ public main
~$ cat /etc/apt/sources.list.d/plexmediaserver.list
deb https://downloads.plex.tv/repo/deb public main
Debian 11 with 5.16.0-0.bpo.4-amd64 kernel
Processor: AMD Ryzen 5 3600 6-Core Processor
/tmp/plexinstaller.log
cat /tmp/plexinstaller.log
# Plex Media Server installation configuration info: Tue 23 Aug 2022 07:03:29 PM EDT
Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=1
OverrideFile="/etc/systemd/system/plexmediaserver.service.d/override.conf"
PlexUser="plex"
PlexGroup="plex"
VideoGroup="video"
AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
PlexTempDir="/tmp"
LangEncoding="en_US.UTF-8"
ExistingVersion=12802
DistroName="debian"
DistroVersion="11"
HaveHardware=0
HaveTranscoderPref=0
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=1
Errors=0
Warnings=0
HaveIntel=0
HaveIntelCore=0
HaveIntelXeon=0
HaveIntelCeleron=0
HaveIntelPentium=0
Havei915=0
HaveNvidia=1
CPUSKU=0
NeedOpenCL=0
NeedBeignet=0
NeedIntelCompute=0
HaveBeignet=0
HaveOpenCL=0
HaveIntelGmmlib=0
HaveIntelIGCCore=0
HaveIntelIGCOpenCL=0
HaveIntelOpenCL=0
HaveIntelCompute=0
RequiredIntelGmmlib="21.3.3"
RequiredIntelIGCCore="1.0.9441"
RequiredIntelIGCOpenCL="1.0.9441"
RequiredIntelOpenCL="21.49.21786"
VersionIntelGmmlib=""
VersionIntelIGCCore=""
VersionIntelIGCOpenCL=""
VersionIntelOpenCL=""
Platform="To Be Filled By O.E.M."
Processor="AMD Ryzen 5 3600 6-Core Processor"
Distro="Debian GNU/Linux 11 (bullseye)"
Kernel="Linux HTPC-PLEX 5.16.0-0.bpo.4-amd64 #1 SMP PREEMPT Debian 5.16.12-1~bpo11+1 (2022-03-08) x86_64 GNU/Linux"
Memory="64302 37933 6919"
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.