summaryrefslogtreecommitdiff
path: root/www-apps/jellyfin/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-11 01:28:44 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-11 01:28:44 +0100
commitb46b9834b3fbf80b22ccc12e95f660512cd0fa75 (patch)
treef7eb18ccc89e078e2f175e5249fe0d4dfdb5b104 /www-apps/jellyfin/files
parent62f7102650b24618880e8e6f08fcb8fbd235025b (diff)
gentoo auto-resync : 11:07:2022 - 01:28:44
Diffstat (limited to 'www-apps/jellyfin/files')
-rw-r--r--www-apps/jellyfin/files/jellyfin.init14
-rw-r--r--www-apps/jellyfin/files/jellyfin.service38
2 files changed, 52 insertions, 0 deletions
diff --git a/www-apps/jellyfin/files/jellyfin.init b/www-apps/jellyfin/files/jellyfin.init
new file mode 100644
index 000000000000..c4bdacd7c6d1
--- /dev/null
+++ b/www-apps/jellyfin/files/jellyfin.init
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/opt/jellyfin/jellyfin"
+command_args="--logdir /var/log/jellyfin --cachedir /var/cache/jellyfin --configdir /etc/jellyfin --datadir /var/lib/jellyfin"
+command_user="${RC_SVCNAME}:${RC_SVCNAME}"
+command_background=true
+
+start_pre() {
+ # (Commands necessary to prepare to start the service)
+ # Ensure that our dirs are correct
+ checkpath --directory --owner jellyfin:jellyfin --mode 0775 \
+ /var/cache/jellyfin
+}
diff --git a/www-apps/jellyfin/files/jellyfin.service b/www-apps/jellyfin/files/jellyfin.service
new file mode 100644
index 000000000000..f20bfeb3e352
--- /dev/null
+++ b/www-apps/jellyfin/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
+