advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.69k stars 473 forks source link

[Bug]: Systemd Service overwritten on upgrade #1927

Open hendrikreuhl opened 1 year ago

hendrikreuhl commented 1 year ago

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

13werwolf13 commented 1 year ago

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

paxchristos commented 1 year ago

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 #>