diff options
Diffstat (limited to 'debian/postinst')
| -rw-r--r-- | debian/postinst | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/debian/postinst b/debian/postinst index 2f9c4cffbf..947959aa7a 100644 --- a/debian/postinst +++ b/debian/postinst @@ -10,6 +10,8 @@ if [[ -f $DEFAULT_FILE ]]; then fi JELLYFIN_USER=${JELLYFIN_USER:-jellyfin} +RENDER_GROUP=${RENDER_GROUP:-render} +VIDEO_GROUP=${VIDEO_GROUP:-video} # Data directories for program data (cache, db), configs, and logs PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} @@ -28,6 +30,14 @@ case "$1" in adduser --system --ingroup ${JELLYFIN_USER} --shell /bin/false ${JELLYFIN_USER} --no-create-home --home ${PROGRAMDATA} \ --gecos "Jellyfin default user" > /dev/null 2>&1 fi + # add jellyfin to the render group for hwa + if [[ ! -z "$(getent group ${RENDER_GROUP})" ]]; then + usermod -aG ${RENDER_GROUP} ${JELLYFIN_USER} > /dev/null 2>&1 + fi + # add jellyfin to the video group for hwa + if [[ ! -z "$(getent group ${VIDEO_GROUP})" ]]; then + usermod -aG ${VIDEO_GROUP} ${JELLYFIN_USER} > /dev/null 2>&1 + fi # ensure $PROGRAMDATA exists if [[ ! -d $PROGRAMDATA ]]; then mkdir $PROGRAMDATA @@ -49,8 +59,6 @@ case "$1" in chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true - # Install jellyfin symlink into /usr/bin ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin @@ -83,7 +91,7 @@ fi # End automatically added section # Automatically added by dh_installinit if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then - if [[ -d "/run/systemd/systemd" ]]; then + if [[ -d "/run/systemd/system" ]]; then systemctl --system daemon-reload >/dev/null || true deb-systemd-invoke start jellyfin >/dev/null || true elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then |
