From d573f2d67164803a1870dc85893ec3b81ea56525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 2 Feb 2019 20:01:29 +0100 Subject: [PATCH] use cachedir option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- deployment/fedora-package-x64/pkg-src/jellyfin.env | 2 +- deployment/fedora-package-x64/pkg-src/jellyfin.spec | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.env b/deployment/fedora-package-x64/pkg-src/jellyfin.env index f7f041f75..c23bfd470 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.env +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.env @@ -21,7 +21,7 @@ JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" -JELLYFIN_CACHE_DIRECTORY="/var/log/jellyfin" +JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin" # In-App service control JELLYFIN_RESTART_OPT="--restartpath /usr/libexec/jellyfin/restart.sh" # Additional options for the binary diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 80b0f5fa4..851c40044 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -61,6 +61,7 @@ EOF %{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin %{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} %{__mkdir} -p %{buildroot}%{_var}/log/jellyfin +%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin %{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service %{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} @@ -88,8 +89,9 @@ EOF %config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json -%attr(-,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin +%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin %attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin +%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin %if 0%{?fedora} %license LICENSE %else @@ -104,7 +106,7 @@ getent passwd jellyfin >/dev/null || \ exit 0 %post -# Move existing configuration to /etc/jellyfin and symlink config to /etc/jellyfin +# Move existing configuration cache and logs to their new locations and symlink them. if [ $1 -gt 1 ] ; then service_state=$(systemctl is-active jellyfin.service) if [ "${service_state}" = "active" ]; then @@ -120,6 +122,11 @@ if [ $1 -gt 1 ] ; then rmdir %{_sharedstatedir}/%{name}/logs ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs fi + if [ ! -L %{_sharedstatedir}/%{name}/cache ]; then + mv %{_sharedstatedir}/%{name}/cache/* %{_var}/cache/jellyfin + rmdir %{_sharedstatedir}/%{name}/cache + ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/%{name}/cache + fi if [ "${service_state}" = "active" ]; then systemctl start jellyfin.service fi