# /lib/systemd/system/plexmediaserver.service is overwritten during upgrade process

**URL:** <https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [February 1, 2022, 8:07pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168 "2022-02-01T20:07:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dugiehowsa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dugiehowsa/32/4980_2.png) [@dugiehowsa](https://forums.plex.tv/u/dugiehowsa)\
**Post date:** [February 1, 2022, 8:07pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/1 "2022-02-01T20:07:25Z")

</div>

Server Version#: 1.25.4.5487  
OS Version#: Ubuntu 20.04.3 LTS

Greetings. I [customized my /lib/systemd/system/plexmediaserver.service](https://forums.plex.tv/t/system-administration-kodi-and-plex-running-on-the-same-ubuntu-host/770450/9) to resolve a media permissions issue. I also modified permissions on the file system to correspond to the changes in the plexmediaserver.service file.

After the last two upgrades, I found that the upgrade process is over-writing the /lib/systemd/system/plexmediaserver.service. Since the change is small, it is a relatively easy fix to go back in and re-create. But I was wondering if it is possible to not overwrite the plexmediaserver.service file during the upgrade process?

The change I make to the files is:

FROM:

```auto
User=plex
Group=plex

```

TO:

```auto
User=media
Group=media

```

Here is the output from the upgrade process:

```sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  plexmediaserver
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 78.4 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://downloads.plex.tv/repo/deb public/main amd64 plexmediaserver amd64 1.25.4.5487-648a8f9f9 [78.4 MB]
Fetched 78.4 MB in 7s (11.7 MB/s)
(Reading database ... 193434 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.25.4.5487-648a8f9f9_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Warning: "/var/lib/plexmediaserver/Library/Application Support" isn't owned by "plex", UID: 998. Found "media", UID: 1000 instead. Continuing.
PlexMediaServer install: Pre-installation Validation complete. Errors: 0, Warnings: 1
Unpacking plexmediaserver (1.25.4.5487-648a8f9f9) over (1.25.4.5468-989df2310) ...
Setting up plexmediaserver (1.25.4.5487-648a8f9f9) ...
PlexMediaServer install: PlexMediaServer-1.25.4.5487-648a8f9f9 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: OpenCL: Installed
PlexMediaServer install: Beignet: Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: both
PlexMediaServer install: user
PlexMediaServer install: PlexMediaServer-1.25.4.5487-648a8f9f9 - Installation successful. Errors: 1, Warnings: 1
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

```

---

<div class="post-metadata">

**Author:** ![animosity022](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/animosity022/32/83693_2.png) [@animosity022](https://forums.plex.tv/u/animosity022)\
**Post date:** [February 1, 2022, 8:12pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/2 "2022-02-01T20:12:25Z")

</div>

You don’t want to modify the service files as any install would overwrite that.

There is an article here on customizing:

[Customizing your Plex configuration - Plex Media Server / Desktops & Laptops - Plex Forum](https://forums.plex.tv/t/customizing-your-plex-configuration/205443)

I use that for my overrides.

---

<div class="post-metadata">

**Author:** ![dugiehowsa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dugiehowsa/32/4980_2.png) [@dugiehowsa](https://forums.plex.tv/u/dugiehowsa)\
**Post date:** [February 1, 2022, 8:19pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/3 "2022-02-01T20:19:51Z")

</div>

> [@animosity022](#):
>
> There is an article here on customizing:
> 
> [Customizing your Plex configuration - Plex Media Server / Desktops & Laptops - Plex Forum](https://forums.plex.tv/t/customizing-your-plex-configuration/205443)
> 
> I use that for my overrides.

Perfect. This is exactly what I was looking for. Thanks!

```auto
sudo mkdir /etc/systemd/system/plexmediaserver.service.d
sudo nano /etc/systemd/system/plexmediaserver.service.d/override.conf

```

```auto
# Override Plex Defaults
[Service]
User=media
Group=media

```

---

<div class="post-metadata">

**Author:** ![TeknoJunky](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/teknojunky/32/165055_2.png) [@TeknoJunky](https://forums.plex.tv/u/TeknoJunky)\
**Post date:** [February 8, 2022, 12:41pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/4 "2022-02-08T12:41:42Z")

</div>

simply `sudo systemctl edit plexmediaserver.service` next time would be easier. 🙂

---

<div class="post-metadata">

**Author:** ![dugiehowsa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dugiehowsa/32/4980_2.png) [@dugiehowsa](https://forums.plex.tv/u/dugiehowsa)\
**Post date:** [February 8, 2022, 1:11pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/5 "2022-02-08T13:11:36Z")

</div>

Great tip. Thanks!

---

<div class="post-metadata">

**Author:** ![frederick.grayson](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/frederick.grayson/32/14914_2.png) [@frederick.grayson](https://forums.plex.tv/u/frederick.grayson)\
**Post date:** [February 8, 2022, 3:42pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/6 "2022-02-08T15:42:22Z")

</div>

> Blockquote

> [@TeknoJunky](#):
>
> simply `sudo systemctl edit plexmediaserver.service` next time would be easier. 🙂

Changes made to that file can be lost on the next upgrade. Use the recommended override file instead.

---

<div class="post-metadata">

**Author:** ![dugiehowsa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dugiehowsa/32/4980_2.png) [@dugiehowsa](https://forums.plex.tv/u/dugiehowsa)\
**Post date:** [February 8, 2022, 5:05pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/7 "2022-02-08T17:05:40Z")

</div>

> [@frederick.grayson](#):
>
> Changes made to that file can be lost on the next upgrade. Use the recommended override file instead.

When I ran the command, it looks like it went to my override.conf file. Not sure if that was because I had previously created the override.conf file.  
 ![image](https://global.discourse-cdn.com/plex/original/4X/8/b/7/8b7be6c1241d002d79ea1a51a2dc8b68d89b96cb.png)

---

<div class="post-metadata">

**Author:** ![TeknoJunky](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/teknojunky/32/165055_2.png) [@TeknoJunky](https://forums.plex.tv/u/TeknoJunky)\
**Post date:** [February 8, 2022, 6:24pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/8 "2022-02-08T18:24:59Z")

</div>

Hi, no it will create if needed, or edit existing override file.

Try it and see. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [May 9, 2022, 6:25pm UTC](https://forums.plex.tv/t/lib-systemd-system-plexmediaserver-service-is-overwritten-during-upgrade-process/774168/9 "2022-05-09T18:25:41Z")

</div>

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