From cbff18edb5ce0921cad626264708e3de4ebe0832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Mon, 7 Jan 2019 18:51:37 +0100 Subject: [PATCH] Add logging and config directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.env | 6 ++++-- rpm-package/jellyfin.service | 2 +- rpm-package/jellyfin.spec | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rpm-package/jellyfin.env b/rpm-package/jellyfin.env index 2e2b2ba8e..827a33f46 100644 --- a/rpm-package/jellyfin.env +++ b/rpm-package/jellyfin.env @@ -17,8 +17,10 @@ # Tell jellyfin wich ffmpeg/ffprobe to use # JELLYFIN_FFMPEG="-ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe" -# Data directory -JELLYFIN_DATA="/var/lib/jellyfin" +# Program directories +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" +JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # In-App service control JELLYFIN_RESTART_OPT="-restartpath /usr/libexec/jellyfin/restart.sh" # Additional options for the binary diff --git a/rpm-package/jellyfin.service b/rpm-package/jellyfin.service index 26d82a825..0ece5b57f 100644 --- a/rpm-package/jellyfin.service +++ b/rpm-package/jellyfin.service @@ -5,7 +5,7 @@ Description=Jellyfin is a free software media system that puts you in control of [Service] EnvironmentFile=/etc/sysconfig/jellyfin WorkingDirectory=/var/lib/jellyfin -ExecStart=/usr/bin/jellyfin -programdata ${JELLYFIN_DATA} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_ADD_OPTS} ${JELLYFIN_FFMPEG} +ExecStart=/usr/bin/jellyfin -programdata ${JELLYFIN_DATA_DIRECTORY} -configdir ${JELLYFIN_CONFIG_DIRECTORY} -logdir ${JELLYFIN_LOG_DIRECTORY} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_ADD_OPTS} ${JELLYFIN_FFMPEG} TimeoutSec=15 Restart=on-failure User=jellyfin diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index 5b53bd005..a7619ea05 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -62,12 +62,16 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime linux-x64 %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE %{__install} -D -m 0644 debian/conf/jellyfin.service.conf %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%{__install} -D -m 0644 debian/conf/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json %{__mkdir} -p %{buildroot}%{_bindir} tee %{buildroot}%{_bindir}/jellyfin << EOF #!/bin/sh exec %{_libdir}/%{name}/%{name} \${@} EOF %{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin +%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} +%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin + %{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service %{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers @@ -90,10 +94,13 @@ EOF %attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh %attr(750,root,root) %{_libexecdir}/%{name}/restart.sh %attr(644,root,root) %{_prefix}/lib/firewalld/service/%{name}.xml +%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %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(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin %if 0%{?fedora} %license LICENSE %else @@ -117,8 +124,9 @@ exit 0 %systemd_postun_with_restart jellyfin.service %changelog -* Sat Jan 05 2019 Thomas Büttner - 10.0.0-1 +* Mon Jan 07 2019 Thomas Büttner - 10.0.0-1 - Bump version to 10.0.0 +- Add logging and config directories * Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 - Add firewalld service.xml