Add SQL query patterns documentation and Linux package build scripts
- Created `TV_SHOWS_SQL_QUERY_PATTERNS.md` to document SQL query patterns for TV shows, including performance issues and missing indexes. - Added `README.md` for Linux package building, detailing steps for creating Debian and Red Hat packages. - Implemented build scripts for Debian and Red Hat, including service files and post-installation hooks. - Added necessary scripts for managing Jellyfin service lifecycle on both Debian and Red Hat systems. - Included package specifications and installation instructions for both distributions.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=Jellyfin Media Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=jellyfin
|
||||
Group=jellyfin
|
||||
WorkingDirectory=/var/lib/jellyfin
|
||||
|
||||
# Run jellyfin with proper configuration directories
|
||||
ExecStart=/opt/jellyfin/jellyfin \
|
||||
--datadir=/var/lib/jellyfin \
|
||||
--logdir=/var/log/jellyfin \
|
||||
--cachedir=/var/cache/jellyfin
|
||||
|
||||
# Restart behavior
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
# Resource limits
|
||||
LimitNOFILE=65536
|
||||
MemoryMax=4G
|
||||
|
||||
# Logging
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=jellyfin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Jellyfin Post-Installation Script (Red Hat)
|
||||
# Runs after package is installed
|
||||
|
||||
# Create jellyfin user/group if not exists
|
||||
if ! id "jellyfin" &>/dev/null; then
|
||||
echo "Creating jellyfin user and group..."
|
||||
useradd -r -s /bin/false -d /var/lib/jellyfin jellyfin
|
||||
fi
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p /var/lib/jellyfin
|
||||
mkdir -p /var/log/jellyfin
|
||||
mkdir -p /var/cache/jellyfin
|
||||
mkdir -p /etc/jellyfin
|
||||
|
||||
# Set ownership and permissions
|
||||
chown -R jellyfin:jellyfin /opt/jellyfin
|
||||
chown -R jellyfin:jellyfin /var/lib/jellyfin
|
||||
chown -R jellyfin:jellyfin /var/log/jellyfin
|
||||
chown -R jellyfin:jellyfin /var/cache/jellyfin
|
||||
|
||||
chmod 755 /opt/jellyfin
|
||||
chmod 750 /var/lib/jellyfin
|
||||
chmod 750 /var/log/jellyfin
|
||||
chmod 750 /var/cache/jellyfin
|
||||
|
||||
# Enable and start service if systemd is available
|
||||
if command -v systemctl &> /dev/null; then
|
||||
systemctl daemon-reload || true
|
||||
systemctl enable jellyfin.service || true
|
||||
echo "To start Jellyfin, run: sudo systemctl start jellyfin"
|
||||
fi
|
||||
|
||||
echo "Jellyfin post-install complete!"
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Jellyfin Post-Uninstall Script (Red Hat)
|
||||
# Runs after package is removed
|
||||
|
||||
# Remove jellyfin user/group
|
||||
if id "jellyfin" &>/dev/null; then
|
||||
echo "Removing jellyfin user and group..."
|
||||
userdel jellyfin || true
|
||||
fi
|
||||
|
||||
echo "Jellyfin has been removed."
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Jellyfin Pre-Uninstall Script (Red Hat)
|
||||
# Runs before package is removed
|
||||
|
||||
# Stop service
|
||||
if command -v systemctl &> /dev/null; then
|
||||
echo "Stopping Jellyfin service..."
|
||||
systemctl stop jellyfin.service || true
|
||||
systemctl disable jellyfin.service || true
|
||||
fi
|
||||
Reference in New Issue
Block a user