summaryrefslogtreecommitdiff
path: root/media-tv/jellyfin/files/jellyfin.init.d
blob: 7ce8f54cc2c816b580adeec6d8ba8395b57c1357 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="Jellyfin Media Server"

user="${JELLYFIN_USER}:${JELLYFIN_USER}"

start_stop_daemon_args="--user $user --wait 10"

command="/usr/bin/jellyfin"
command_args="--configdir $JELLYFIN_CONFIG_DIR
	--datadir $JELLYFIN_DATA_DIR
	--cachedir $JELLYFIN_CACHE_DIR
	--logdir $JELLYFIN_LOG_DIR
	$JELLYFIN_ARGS"

command_background="true"

pidfile="/run/jellyfin.pid"

depend() {
	need net
    	after bootmisc
}

start_pre() {
    checkpath --directory --owner $user $JELLYFIN_CONFIG_DIR
    checkpath --directory --owner $user $JELLYFIN_DATA_DIR
    checkpath --directory --owner $user $JELLYFIN_CACHE_DIR
    checkpath --directory --owner $user $JELLYFIN_LOG_DIR
}