Systemd - Customizing Application Support folder (Metadata) - override.conf

Hi All,
Hoping someone can help me. I
I am wanting to ‘move’ the application support folder to and SSD drive on my Plex Media Server to increase its performance (that is the general idea as I have only started reading into this)
Anyhow, I have read a number of threads about editing the override.conf file to point to the new location, which I have done (pretty sure its correct) and I’ve assigned the user/group permissions to plex (plex:plex)

This is my override.conf:

# Customize Plex’s config
#
# Identify this as a service override
[Service]
#
# Move the data directory
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/media/dennis/Plex_Cache/plexmediaserver/"
#
# These values are only needed if you wish to change user & group
User=plex
Group=plex

I then try to restart the plex service (service plexmediaserver restart) and I get the following error:

Job for plexmediaserver.service failed because the control process exited with error code.
See “systemctl status plexmediaserver.service” and “journalctl -xeu plexmediaserver.service” for details.

So I investigate systemctl status plexmediaserver.service and I get the below error:

systemctl status plexmediaserver.service
× plexmediaserver.service - Plex Media Server
** Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)**
** Drop-In: /etc/systemd/system/plexmediaserver.service.d**
** └─override.conf**
** Active: failed (Result: exit-code) since Sat 2022-05-28 10:22:41 AWST; 476ms ago**
** Process: 26476 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPP>**
** CPU: 13ms**

May 28 10:22:41 per-plex-svr systemd[1]: plexmediaserver.service: Scheduled restart job, restart >
May 28 10:22:41 per-plex-svr systemd[1]: Stopped Plex Media Server.
May 28 10:22:41 per-plex-svr systemd[1]: plexmediaserver.service: Start request repeated too quic>
May 28 10:22:41 per-plex-svr systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
May 28 10:22:41 per-plex-svr systemd[1]: Failed to start Plex Media Server.

Looking at journalctl -xeu plexmediaserver.service, I see the below:

The unit plexmediaserver.service has entered the ‘failed’ state with result ‘exit-code’.
May 28 10:22:41 per-plex-svr systemd[1]: Failed to start Plex Media Server.
Subject: A start job for unit plexmediaserver.service has failed
Defined-By: systemd
Support: Enterprise open source support | Ubuntu
A start job for unit plexmediaserver.service has finished with a failure.
The job identifier is 5256 and the job result is failed.

I am not sure what I am doing wrong as I have confirmed the location of where I want the Application Support to now be (the SSD drive) and I am confident I did edit the override.conf file correctly, so I am not sure where the error lays.
Anyone have any ideas?

I am running Plex Media Server 1.26.2.5797 on Linux (Ubuntu 22.04)

why did you select /media as the mount point? This is usually reserved for removable media devices.

Is this a removal media device? If so it is definitely not a good choice for Plex metadata.

if its a fixed SSD in the computer you would usually mounts it under /mnt and you’ll need to ensure each and every directory in the path is accessible by the Plex user and/or the Plex group

Hey BobSnot,
My Plex Media Server is a Virtual machine. I do appreciate what you are saying and agree, but the SSD will not be removed from that host. Its running USB bypass through the VM to get to Linux. (though technically its a thunderbolt drive and not USB but anyhow, a story for another time) so I want to think it will still handle the required throughput. The SSD auto-mounts on bootup.

I have confirmed that the plex:plex does have access to every directory in that path.

@doreski

Ubuntu/Debian, with a graphical desktop, will always override the permissions & ownership of /media. The offending program is the automounter built into Nautilus. (It communicates with gnome-session, which runs as root, and has anything in there mounted / chowned with exclusive access by your username only which blocks ‘plex:plex’ from accessing it.

To avoid this problem, any other location can be used.

Might I suggest ?

  1. mkdir /home/plex
  2. chown plex:plex /home/plex
  3. mount your SSD to this location
  4. Change the override.conf to point to
    Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plex/Library/Application Support"

Now you can move Library from /var/lib/plexmediaserver to /home/plex.

For reference (in case you need)

@ChuckPa
You are a champion!! That seemed to work. Thank you so much. Been pulling my hair out for 2 days trying to get this to work.

I do have one question however… upon reboot, will I always need to mount my SSD to /home/plex?
If so, how can I make this happen upon boot up?
I am trying to automate as much as I can.

@doreski

I don’t know how you have the VM configured as it pertains to the outside world.

As far as Linux (in the VM) is concerned –

  1. The kernel boots
  2. It finds all the devices
  3. It mounts all filesystems listed in /etc/fstab <---- KEY POINT HERE
  4. It starts launching the remaining services <— Of which Plex is one.

How it all works –

  1. Linux uses systemd to sequence everything.
  2. File system mounts are sequenced first
  3. Other system services are next
  4. After all those system-global services are started, it then launches user-installed
  5. Plex is one of those user-installed services.

This means you can always guarantee the SSD is mounted before Plex starts
(I assume the VM creates the passthrough automatically as well before it loads the kernel)

In /etc/fstab, you’ll want a standard “auto” mount statement.

Example,

/dev/sdb1  /home/plex    ext4    defaults,auto,rw 0 2

This assumes:

  1. /dev/sdb1 is where the device is mapped into the VM
  2. You’re mounting it on /home/plex
  3. it’s been formatted with ext4

Feel free to adjust here as you see fit to match your actual installation.

I have a lot of How-To’s here. Feel free to avail yourself of them

1 Like

@ChuckPa

That worked an absolute charm!
Thank you sooo much for the help!!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.