[Bug]: Systemd Service overwritten on upgrade #1257

Open
opened 2026-04-24 23:37:34 +02:00 by adam · 5 comments
Owner

Originally created by @hendrikreuhl on GitHub (Jul 17, 2023).

Describe the issue

Hi everyone,

I'm running Audiobookshelf in a lxc container on my proxmox host using debian 12.
I need to customize the systemd service, as I have to execute it as a different user than audiobookshelf.
Whenever I do an apt upgrade of the package, the systemd service gets overwritten by the package default systemd service, causing the process to brick at a reboot due to permission problems.
Is there the possibility to not update the systemd service file with every upgrade?

Regards

Steps to reproduce the issue

  1. Install audiobookshelf using ppa
  2. change systemd service accoring to needs
  3. upgrade package

Audiobookshelf version

2.3.0 amd64 [installed,upgradable to: 2.3.1]

How are you running audiobookshelf?

Debian/PPA

Originally created by @hendrikreuhl on GitHub (Jul 17, 2023). ### Describe the issue Hi everyone, I'm running Audiobookshelf in a lxc container on my proxmox host using debian 12. I need to customize the systemd service, as I have to execute it as a different user than audiobookshelf. Whenever I do an apt upgrade of the package, the systemd service gets overwritten by the package default systemd service, causing the process to brick at a reboot due to permission problems. Is there the possibility to not update the systemd service file with every upgrade? Regards ### Steps to reproduce the issue 1. Install audiobookshelf using ppa 2. change systemd service accoring to needs 3. upgrade package ### Audiobookshelf version 2.3.0 amd64 [installed,upgradable to: 2.3.1] ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:37:34 +02:00
Author
Owner

@13werwolf13 commented on GitHub (Jul 17, 2023):

changing manually systemd service files supplied from packages is wrong, for this there is systemd overrides
as a workaround, you can mask the service and manually create your own

@13werwolf13 commented on GitHub (Jul 17, 2023): changing manually systemd service files supplied from packages is wrong, for this there is systemd overrides as a workaround, you can mask the service and manually create your own
Author
Owner

@paxchristos commented on GitHub (Jul 18, 2023):

Arch linux wiki has a section about how to work around systemd units shipped by a package because it will always override change you make on package upgrade.
Arch Wiki Systemd #Editing Provided Units

2 options are:

  1. Create replace unit, which copies the existing systemd unit and you can tweak from there
    # systemctl edit --full audiobookshelf.service
    or
  2. Create a drop in file
    # systemctl edit audiobookshelf.service --drop-in=<name> <# leave out --drop-in= to use the default override.conf #>
@paxchristos commented on GitHub (Jul 18, 2023): Arch linux wiki has a section about how to work around systemd units shipped by a package because it will always override change you make on package upgrade. [Arch Wiki Systemd #Editing Provided Units](https://wiki.archlinux.org/title/Systemd#Editing_provided_units) 2 options are: 1) Create replace unit, which copies the existing systemd unit and you can tweak from there `# systemctl edit --full audiobookshelf.service` or 2) Create a drop in file `# systemctl edit audiobookshelf.service --drop-in=<name>` <# leave out --drop-in=<name> to use the default override.conf #>
Author
Owner

@pjones112000 commented on GitHub (Dec 1, 2024):

I have the same problem with the service file being updated. In my opinion, no file that has been modified by the end-user should be overwritten without confirmation, there's usually a reason for the modification.

@pjones112000 commented on GitHub (Dec 1, 2024): I have the same problem with the service file being updated. In my opinion, no file that has been modified by the end-user should be overwritten without confirmation, there's usually a reason for the modification.
Author
Owner

@nichwall commented on GitHub (Dec 1, 2024):

You should be using a systemd override instead of changing the service file shipped with the package.

@nichwall commented on GitHub (Dec 1, 2024): You should be using a systemd override instead of changing the service file shipped with the package.
Author
Owner

@13werwolf13 commented on GitHub (Dec 1, 2024):

Do not use --full. Systemd overide allows you to make changes to a unit's config without changing the original unit.

https://www.baeldung.com/linux/systemd-modify-config

@13werwolf13 commented on GitHub (Dec 1, 2024): Do not use --full. Systemd overide allows you to make changes to a unit's config without changing the original unit. https://www.baeldung.com/linux/systemd-modify-config
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1257