Skip to main content
Topic: dinit script for jellyfin (Read 910 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

dinit script for jellyfin

I need a dinit script to start the jellyfin media server.
The systemd unit file is complex and i can't figure how to translate it to the "dinit way".

Any help is really appreciated :)

Many thanks

Re: dinit script for jellyfin

Reply #1
this should work for you:

Code: [Select]
# Jellyfin Media Server
type = process
command = jellyfin --cachedir /var/cache/jellyfin --configdir /var/lib/jellyfin/config --datadir /var/lib/jellyfin --logdir /var/log/jellyfin
run-as = jellyfin
working-dir = /var/lib/jellyfin

waits-for = basic # adjust as needed

additionally you should create a system user and group called jellyfin as well as the following directories, all with ownership jellyfin:jellyfin and mode 0750: /var/cache/jellyfin, /var/lib/jellyfin, and /var/log/jellyfin

Re: dinit script for jellyfin

Reply #2
Just in case anyone comes across this post, I had to modify the script just a little bit to make the web frontend work on the server.

Code: [Select]
type = process
command = /usr/bin/jellyfin --webdir=/usr/share/jellyfin/web --cachedir /var/cache/jellyfin --configdir /var/lib/jellyfin/config --datadir /var/lib/jellyfin --logdir /var/log/jellyfin --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
run-as = jellyfin
working-dir = /var/lib/jellyfin
log-type = buffer
depends-on      = network.target

Re: dinit script for jellyfin

Reply #3
Great to hear that you got it running. 👍 Are you running it as a system service or user? Also, what packages did you install? (I'm guessing server, web and possibly the ffmpeg?).  I've been thinking about using Jellyfin again (last time I used it was on a Debian system) but still not 100% sure.

Re: dinit script for jellyfin

Reply #4
Great to hear that you got it running. 👍 Are you running it as a system service or user? Also, what packages did you install? (I'm guessing server, web and possibly the ffmpeg?).  I've been thinking about using Jellyfin again (last time I used it was on a Debian system) but still not 100% sure.

I am currently running Jellyfin on my home server as a system service. As far as I understand, adding the line run-as = jellyfin should prevent the executable from having root permissions.

Regarding the Jellyfin fork of FFmpeg, I am not entirely sure if it is necessary. I do not have a comprehensive understanding of Jellyfin, so I simply followed the example systemd script. I added the Arch extra repository to my pacman configuration and then installed the following packages.

Code: [Select]
extra/jellyfin-ffmpeg 1:7.1.1p7-1 [installed]
    Jellyfin fork of ffmpeg
extra/jellyfin-server 10.10.7-3 [installed]
    Jellyfin server backend
extra/jellyfin-web 10.10.7-1 [installed]
    Web client for Jellyfin

When I was setting up Artix dinit on the server, I initially thought I needed to create user services but couldn't figure out how to make them work. The user services were terminating once I logged out of the ssh session. So, the best alternative I could come up with was to run it as a system service using the "run-as" option.

Re: dinit script for jellyfin

Reply #5

When I was setting up Artix dinit on the server, I initially thought I needed to create user services but couldn't figure out how to make them work. The user services were terminating once I logged out of the ssh session. So, the best alternative I could come up with was to run it as a system service using the "run-as" option.

Thanks for the reply. I did try it, downloaded all the packages, set it up and used your service file (thanks for that) and it worked fine straight away. However, it's really heavy (although it's also really good) and i finally decided that i'm quite happy just using connecting via a file manager, or ssh etc and selecting the media (usually films) i want to view. It's not so stressful on the system and i don't mind NOT having all the extra stuff.... so i removed it all. :)  It was good to briefly try it out though, and really cool that it all worked without any hassles. :)