aboutsummaryrefslogtreecommitdiff
path: root/fedora
diff options
context:
space:
mode:
authorBrian J. Murrell <brian@interlinx.bc.ca>2021-11-29 17:53:26 -0500
committerBrian J. Murrell <brian@interlinx.bc.ca>2021-11-29 17:53:26 -0500
commit757970bfc17b0eb1566b45fbe700dcb16423b190 (patch)
tree63fbc171621f5ec7ae156f341d9b1df37643deac /fedora
parenta3a4689af22693b535e80b98624831866fda2a61 (diff)
parentc677b4f6b7f7e874097aa2cee866d9ed1e574178 (diff)
Merge remote-tracking branch 'origin/master' into HEAD
Diffstat (limited to 'fedora')
-rw-r--r--fedora/jellyfin.service2
-rw-r--r--fedora/jellyfin.spec4
-rw-r--r--fedora/jellyfin.sudoers7
-rwxr-xr-xfedora/restart.sh40
4 files changed, 36 insertions, 17 deletions
diff --git a/fedora/jellyfin.service b/fedora/jellyfin.service
index bde124a0f..b91e1a566 100644
--- a/fedora/jellyfin.service
+++ b/fedora/jellyfin.service
@@ -1,5 +1,5 @@
[Unit]
-After=network.target
+After=network-online.target
Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media.
[Service]
diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec
index 928fe590f..47dee7c13 100644
--- a/fedora/jellyfin.spec
+++ b/fedora/jellyfin.spec
@@ -27,7 +27,7 @@ BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel,
# Requirements not packaged in main repos
# COPR @dotnet-sig/dotnet or
# https://packages.microsoft.com/rhel/7/prod/
-BuildRequires: dotnet-runtime-5.0, dotnet-sdk-5.0
+BuildRequires: dotnet-runtime-6.0, dotnet-sdk-6.0
Requires: %{name}-server = %{version}-%{release}, %{name}-web = %{version}-%{release}
# Disable Automatic Dependency Processing
AutoReqProv: no
@@ -40,7 +40,7 @@ Jellyfin is a free software media system that puts you in control of managing an
Summary: The Free Software Media System Server backend
Requires(pre): shadow-utils
Requires: ffmpeg
-Requires: libcurl, fontconfig, freetype, openssl, glibc, libicu, at
+Requires: libcurl, fontconfig, freetype, openssl, glibc, libicu, at, sudo
%description server
The Jellyfin media server backend.
diff --git a/fedora/jellyfin.sudoers b/fedora/jellyfin.sudoers
index dd245af4b..57a9e7b67 100644
--- a/fedora/jellyfin.sudoers
+++ b/fedora/jellyfin.sudoers
@@ -1,8 +1,7 @@
# Allow jellyfin group to start, stop and restart itself
-Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin
-Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin
-Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin
-
+Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemd-run systemctl restart jellyfin
+Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemd-run systemctl start jellyfin
+Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemd-run systemctl stop jellyfin
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD
diff --git a/fedora/restart.sh b/fedora/restart.sh
index 34fce0670..4847b918b 100755
--- a/fedora/restart.sh
+++ b/fedora/restart.sh
@@ -11,23 +11,43 @@
#
# This script is used by the Debian/Ubuntu/Fedora/CentOS packages.
-get_service_command() {
- for command in systemctl service; do
- if which $command &>/dev/null; then
- echo $command && return
+# This is the Right Way(tm) to check if we are booted with
+# systemd, according to sd_booted(3)
+if [ -d /run/systemd/system ]; then
+ cmd=systemctl
+else
+ # Everything else is really hard to figure out, so we just use
+ # service(8) if it's available - that works with most init
+ # systems/distributions I know of, including FreeBSD
+ if type service >/dev/null 2>&1; then
+ cmd=service
+ else
+ # If even service(8) isn't available, we just try /etc/init.d
+ # and hope for the best
+ if [ -d /etc/init.d ]; then
+ cmd=sysv
+ else
+ echo "Unable to detect a way to restart Jellyfin; bailing out" 1>&2
+ echo "Please report this bug to https://github.com/jellyfin/jellyfin/issues" 1>&2
+ exit 1
fi
- done
- echo "sysv"
-}
+ fi
+fi
+
+if type sudo >/dev/null 2>&1; then
+ sudo_command=sudo
+else
+ sudo_command=
+fi
-cmd="$( get_service_command )"
echo "Detected service control platform '$cmd'; using it to restart Jellyfin..."
case $cmd in
'systemctl')
- echo "sleep 0.5; /usr/bin/sudo $( which systemctl ) start jellyfin" | at now
+ # Without systemd-run here, `jellyfin.service`'s shutdown terminates this process too
+ $sudo_command systemd-run systemctl restart jellyfin
;;
'service')
- echo "sleep 0.5; /usr/bin/sudo $( which service ) jellyfin start" | at now
+ echo "sleep 0.5; $sudo_command service jellyfin start" | at now
;;
'sysv')
echo "sleep 0.5; /usr/bin/sudo /etc/init.d/jellyfin start" | at now