summaryrefslogtreecommitdiff
path: root/www-apps/jellyfin-bin/files
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/jellyfin-bin/files')
-rw-r--r--www-apps/jellyfin-bin/files/jellyfin.confd15
-rw-r--r--www-apps/jellyfin-bin/files/jellyfin.init-r124
-rw-r--r--www-apps/jellyfin-bin/files/jellyfin.service38
3 files changed, 77 insertions, 0 deletions
diff --git a/www-apps/jellyfin-bin/files/jellyfin.confd b/www-apps/jellyfin-bin/files/jellyfin.confd
new file mode 100644
index 000000000000..310bef364b90
--- /dev/null
+++ b/www-apps/jellyfin-bin/files/jellyfin.confd
@@ -0,0 +1,15 @@
+# This is the directory that will hold all Jellyfin data, and is also used as a default base directory for some other paths below.
+#JELLYFIN_DATA_DIR=/var/lib/jellyfin
+
+# This is the directory where the Jellyfin logs will be stored.
+#JELLYFIN_LOG_DIR=/var/log/jellyfin
+
+# This is the directory containing the server cache.
+#JELLYFIN_CACHE_DIR=/var/cache/jellyfin
+
+# This is the directory containing the server configuration files.
+#JELLYFIN_CONFIG_DIR=/etc/jellyfin
+
+# To configure Jellyfin to use a proxy, set http_proxy and/or https_proxy
+# export http_proxy=192.168.33.10:3128
+# export https_proxy=192.168.33.10:3129
diff --git a/www-apps/jellyfin-bin/files/jellyfin.init-r1 b/www-apps/jellyfin-bin/files/jellyfin.init-r1
new file mode 100644
index 000000000000..c45a532d5c0c
--- /dev/null
+++ b/www-apps/jellyfin-bin/files/jellyfin.init-r1
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+
+: ${JELLYFIN_CACHE_DIR:=/var/cache/jellyfin}
+: ${JELLYFIN_LOG_DIR:=/var/log/jellyfin}
+: ${JELLYFIN_DATA_DIR:=/var/lib/jellyfin}
+: ${JELLYFIN_CONFIG_DIR:=/etc/jellyfin}
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/opt/jellyfin/jellyfin"
+command_args="--logdir ${JELLYFIN_LOG_DIR} --cachedir ${JELLYFIN_CACHE_DIR} --configdir ${JELLYFIN_CONFIG_DIR} --datadir ${JELLYFIN_DATA_DIR}"
+command_user="${RC_SVCNAME}:${RC_SVCNAME}"
+command_background=true
+
+start_pre() {
+ # Ensure that our dirs are correct
+ checkpath --directory --owner jellyfin:jellyfin --mode 0775 \
+ ${JELLYFIN_LOG_DIR}
+ checkpath --directory --owner jellyfin:jellyfin --mode 0775 \
+ ${JELLYFIN_CACHE_DIR}
+ checkpath --directory --owner jellyfin:jellyfin --mode 0775 \
+ ${JELLYFIN_CONFIG_DIR}
+ checkpath --directory --owner jellyfin:jellyfin --mode 0775 \
+ ${JELLYFIN_DATA_DIR}
+}
diff --git a/www-apps/jellyfin-bin/files/jellyfin.service b/www-apps/jellyfin-bin/files/jellyfin.service
new file mode 100644
index 000000000000..f20bfeb3e352
--- /dev/null
+++ b/www-apps/jellyfin-bin/files/jellyfin.service
@@ -0,0 +1,38 @@
+[Unit]
+Description = Jellyfin Media Server
+After=syslog.target network.target
+
+[Service]
+User=jellyfin
+Group=jellyfin
+
+Type=simple
+StateDirectory=jellyfin
+CacheDirectory=jellyfin
+LogsDirectory=jellyfin
+ConfigurationDirectory=jellyfin
+ExecStart=/opt/jellyfin/jellyfin --logdir "$LOGS_DIRECTORY" --cachedir "$CACHE_DIRECTORY" --configdir "$CONFIGURATION_DIRECTORY" --datadir "$STATE_DIRECTORY"
+TimeoutStopSec=20
+KillMode=process
+Restart=always
+
+PrivateTmp=yes
+PrivateMounts=yes
+ProtectHome=yes
+ProtectSystem=full
+NoNewPrivileges=yes
+ProtectHostname=yes
+ProtectClock=yes
+ProtectKernelTunables=yes
+ProtectKernelModules=yes
+ProtectKernelLogs=yes
+ProtectControlGroups=yes
+RemoveIPC=true
+RestrictRealtime=yes
+DeviceAllow=char-drm rw
+DeviceAllow=char-nvidia-frontend rw
+DeviceAllow=char-nvidia-uvm rw
+
+[Install]
+WantedBy=multi-user.target
+