mrworf/plexupdate

Using alternate systemd file

Closed this issue · 4 comments

Hi,

I'd like to use a custom file for systemd plex service. Default service is plexmediaserver.service and the one i want to use is named plex.service

I changed the plexupdate.conf to add this line
SYSTEMDUNIT='plex.service'

Anyway after doing the update, i found that plexmediaserver.service was enabled and it didn't use the plex.service as specified.

Thanx for helping !

004a commented

Rather than renaming the default plex service, just set an Alias instead. You'll be able to use both and standard configurations/hooks will still work.

Alright but won't the default plexmediaserver.service file will be overwritten on each update ?

@jaydee99 Are you changing the name to plex.service because you really want the name to be plex, or because you want to customize the configuration? If you just want to customize the configuration, the easiest thing is to create an override. Just run

sudo systemctl edit plexmediaserver

And paste in whatever options you want. If they conflict with options in plexmediaserver.service, your changes will take precedence without affecting the other settings (so you don't have to rewrite the entire service declaration in there).

Best of all, overrides are unaffected by package upgrades and will just continue to work with every version.

If all you really want to do is just change the name, the correct way is to just symlink plexmediaserver.service to plex.service. The Alias= directive is only honored in the [Install] section, which only gets run when the service is first added. (and all it does is create that symlink for you anyway)

Hi,

I was just trying to customize the configuration.

Did not know about that "systemctl edit" command to override settings, and thanx, it's working perfect !!