Add cachedir to deployment scripts; fix bad logdir

This commit is contained in:
Joshua Boniface 2019-01-31 21:57:25 -05:00
parent ae24d644db
commit f6227e99cc
4 changed files with 21 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)