Yes, because that’s exactly what systemd-nspawn is. It is basically a chroot into a rootfs, running systemd as PID1 in a different namespace.
systemd knowns when it is running in a container, and what type of container it is. It creates /run/systemd/container to the value of the container type, for instance:
If you write software that wants to detect whether it is run in a container, please check /proc/1/environ and look for the container= environment variable. Do not assume the environment variable is inherited down the process tree. It generally is not. Hence check the environment block of PID 1, not your own. Note though that that file is only accessible to root. systemd hence early on also copies the value into /run/systemd/container , which is readable for everybody. However, that’s a systemd-specific interface and other init systems are unlikely to do the same.
if (docker = 1 ) then
exit out of preinstall -> nothing to do
endif
If ( systemd + init = 0 ) then
Custom += 1
exit out of preinstall -> nothing to do
endif
If you’re running systemd in the container, and it’s responding with "systemd" (notice the flag is set). It no longer cares that it’s a container because pid 1 is satisfied. what is the problem? If you’re putting systemd in the container, then I expect it to be a fully functional systemd which responds to systemctl and has /lib/systemd/system with overrides optionally in /etc/systemd/system.
Also notice, it doesn’t complain when the video group can’t be ID’d and reports “UNKNOWN” from getent
It is a fully functioning system, but there’s obviously something odd going on. I know this because apt/dkpg cannot install the PMS .deb without having to change the LinuxContainer line in the plexinstaller.log file. Once I make the change and re-run the installation, it works without a problem, and the unit file is placed in /lib/systemd/system/.
Then i know what it is. Your container exhibits the same problem as LXC containers with systemd. Setting LinuxContainer=1 makes it skip the udev test. There is a well documented problem with udev in linux containers.
Alternatively, you can uninstall udev. I won’t execute udevadm if I can’t find it.
Read in the postinstall where I look for udevadm in 4 locations.
If you move it, I won’t execute it.
Well, I removed udev, so I’ll see how it works with a future update. However, it seems odd I need to remove packages to work around the installer. Seems a better approach would be a check for /run/systemd/container, which would also catch LXC containers.
I look for this string. Did I make a mistake here?
# Independently, evaluate if in a LXC. This is used later in installation to avoid UDEV trigger bug
# Look only for a the prefix 'container='. No further refinement needed as docker already handled above.
if [ "$(grep -zi '^container=.\+$' /proc/1/environ )" != "" ]; then
LinuxContainer=1
fi
I found the reason while trying to see your postinst. After getting the file with apt download, I got this error:
W: Download is performed unsandboxed as root as file '/root/plexmediaserver_1.18.9.2571-e106a8a91_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
This seems to me to imply that apt doesn’t run as root, but rather as _apt. If that’s the case, then that snippet will never succeed, as /proc/1/environ has permissions of 0400, so only root can read that. (This is the problem that’s alluded to by the quoted text from the Systemd website: since /proc/1/environ can only be read by root, systemd sets the container information in a world-readable file as /run/systemd/container.
I just downloaded 1.18.9.2571, and looking in preinst, I found your container check. However, it looks like you are only checking for LXC containers. Are you implying that the next version will have a modified preinst to also account for systemd-nspawn containers?
In my code, I still say “LinuxContainer” but I am no longer looking for LXC containers specifically (container=lxc). I had worked out with another user, in this very thread, that container= was sufficient to flag the container and pass forward. It allowed me to open up to all Linux containers. This way, Systemd=1 and LinuxContainer=1 means it found systemd as the control mechanism and knows to avoid the udev bug in postinstall. This should be more than enough to satisfy your container as well.
I was mistaken. I am VERY sorry for this. I was misinformed about when my changes would be released.
Currently, you see
Current in 1.18.9.2571:
227
228 # Independently, evaluate if in a LXC. This is used later in installation to avoid UDEV trigger bug
229 if [ "$(grep -i 'container=lxc' /proc/1/environ )" != "" ]; then
230 LinuxContainer=1
231 fi
232
What is coming (1.19.0+) is:
285
286 # Independently, evaluate if in a LXC. This is used later in installation to avoid UDEV trigger bug
287 # Look only for a the prefix 'container='. No further refinement needed as docker already handled above.
288 if [ "$(grep -zi '^container=.\+$' /proc/1/environ )" != "" ]; then
289 LinuxContainer=1
290 fi
291
There are quite a few other changes which I’ve already written about here in-thread.
Again, I apologize for not being fully aware of the timing from me -> main Engineering -> QA -> release schedule. Engineering <-> QA is where the main efforts are.
Unfortunately yes. (i am very annoyed at that statement)
Timeframe? I know 1.19.0 is behind schedule. 1.18.9 was injected into the stream.
Given 1.18.9 is both public and plexpass (all at once), I don’t see us needing to wait 6 weeks for the next cycle. I would think MUCH sooner.
Hello, I’m not able to upgrade from a 1.18.4.2171 that is working well.
After trying to upgrade the plexmediaserver service is removed from systemd.
I’m able to reinstall the 1.18.4.2171 for my plex server to work again but it is annoying
I didn’t find any very clear logs anywhere, I have checked the the /tmp plex log that does not mention any error or warning and I find nothing else than the log below indicating :
“error writing group entry: Argument invalide (invalid argument)”
Any help is welcome, thank you
Blockquote
Log started: 2020-05-02 13:39:36
(Lecture de la base de données… 162246 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de …/plexmediaserver_1.19.2.2737-b69929dab_amd64.deb …
Removed /etc/systemd/system/multi-user.target.wants/plexmediaserver.service.
PlexMediaServer install: Pre-installation Validation.
error writing group entry: Argument invalide
PlexMediaServer install: Pre-installation Validation complete.
Dépaquetage de plexmediaserver (1.19.2.2737-b69929dab) sur (1.18.4.2171-ac2afe5f8) …
dpkg: avertissement: impossible de supprimer l’ancien répertoire « /etc/init » : Le dossier n’est pas vide
Paramétrage de plexmediaserver (1.19.2.2737-b69929dab) …
PlexMediaServer install: PlexMediaServer-1.19.2.2737-b69929dab - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: New
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: video
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /mnt/ramdisk/ (set in Preferences.xml)
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Transcoding HW: Not found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
error writing group entry: Argument invalide
groupadd: group ‘plex’ already exists
dpkg: erreur de traitement du paquet plexmediaserver (–configure) :
installed plexmediaserver package post-installation script subprocess returned error exit status 9
Traitement des actions différées (« triggers ») pour libc-bin (2.28-10) …
Traitement des actions différées (« triggers ») pour mime-support (3.62) …
Des erreurs ont été rencontrées pendant l’exécution :
plexmediaserver
Log ended: 2020-05-02 13:39:50
Thank you for your time.
No I didn’t change /etc/group
I have checked anyway and there is nothing strange except the fact that I have several another user member of the plex group.