diff --git a/deployment/debian-package-x64/pkg-src/postinst b/deployment/debian-package-x64/pkg-src/postinst index 3690d20ba3..44d944ccb5 100644 --- a/deployment/debian-package-x64/pkg-src/postinst +++ b/deployment/debian-package-x64/pkg-src/postinst @@ -13,6 +13,7 @@ fi PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} case "$1" in configure) @@ -37,10 +38,15 @@ case "$1" in if [[ ! -d $LOGDATA ]]; then mkdir $LOGDATA fi + # ensure $CACHEDATA exists + if [[ ! -d $CACHEDATA ]]; then + mkdir $CACHEDATA + fi # Ensure permissions are correct on all config directories chown -R jellyfin:jellyfin $PROGRAMDATA chown -R jellyfin:jellyfin $CONFIGDATA chown -R jellyfin:jellyfin $LOGDATA + chown -R jellyfin:jellyfin $CACHEDATA chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true diff --git a/deployment/debian-package-x64/pkg-src/postrm b/deployment/debian-package-x64/pkg-src/postrm index 690f5d587e..1d00a984ec 100644 --- a/deployment/debian-package-x64/pkg-src/postrm +++ b/deployment/debian-package-x64/pkg-src/postrm @@ -12,7 +12,8 @@ fi # Data directories for program data (cache, db), configs, and logs PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -44,6 +45,10 @@ case "$1" in if [[ -d $LOGDATA ]]; then rm -rf $LOGDATA fi + # Remove cache dir + if [[ -d $CACHEDATA ]]; then + rm -rf $CACHEDATA + fi # Remove program data dir if [[ -d $PROGRAMDATA ]]; then rm -rf $PROGRAMDATA @@ -55,6 +60,7 @@ case "$1" in # Remove anything at the default locations; catches situations where the user moved the defaults [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin + [[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin ;; remove) diff --git a/deployment/debian-package-x64/pkg-src/preinst b/deployment/debian-package-x64/pkg-src/preinst index 0063e0e637..2713fb9b80 100644 --- a/deployment/debian-package-x64/pkg-src/preinst +++ b/deployment/debian-package-x64/pkg-src/preinst @@ -12,7 +12,8 @@ fi # Data directories for program data (cache, db), configs, and logs PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -53,13 +54,16 @@ case "$1" in # Clean up old Emby cruft that can break the user's system [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby - # If we have existing config or log dirs in /var/lib/jellyfin, move them into the right place + # If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place if [[ -d $PROGRAMDATA/config ]]; then mv $PROGRAMDATA/config $CONFIGDATA fi if [[ -d $PROGRAMDATA/logs ]]; then mv $PROGRAMDATA/logs $LOGDATA fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/cache $CACHEDATA + fi ;; abort-upgrade) diff --git a/deployment/debian-package-x64/pkg-src/prerm b/deployment/debian-package-x64/pkg-src/prerm index 4770c03c41..e965cb7d71 100644 --- a/deployment/debian-package-x64/pkg-src/prerm +++ b/deployment/debian-package-x64/pkg-src/prerm @@ -12,7 +12,8 @@ fi # Data directories for program data (cache, db), configs, and logs PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} case "$1" in remove|upgrade|deconfigure)