summaryrefslogtreecommitdiff
path: root/www-apps/jellyfin-bin/files/jellyfin.init-r1
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/jellyfin-bin/files/jellyfin.init-r1')
-rw-r--r--www-apps/jellyfin-bin/files/jellyfin.init-r124
1 files changed, 24 insertions, 0 deletions
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}
+}