• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting SOLVED: Fail2Ban Installation & Docker Logs Ubuntu

     
    • 0 Vote(s) - 0 Average

    SOLVED: Fail2Ban Installation & Docker Logs Ubuntu

    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-09-28, 11:47 PM (This post was last modified: 2024-09-28, 11:53 PM by TheDreadPirate. Edited 3 times in total.)
    Remove the port and protocol lines. They aren't necessary for jails that read logs.

    Also, I think the fail2ban docs need to be updated. Jellyfin USED to write the current day's logs to jellyfin.log, but now it is log_YYYYMMDD.log.

    I recall working through this earlier this year. I ended up setting up a cronjob that runs at midnight that creates a symlink called jellyfin.log that symlinks to the log for the current day.

    Code:
    chris@rat-trap:/var/log/jellyfin$ cat /etc/fail2ban/jail.d/jellyfin.local
    [jellyfin]

    backend = auto
    enabled = true
    filter = jellyfin
    maxretry = 5
    bantime = 86400
    findtime = 43200
    logpath = /var/log/jellyfin/jellyfin.log
    banaction = iptables-allports

    [jellyfin-testing]

    backend = auto
    enabled = true
    filter = jellyfin
    maxretry = 5
    bantime = 86400
    findtime = 43200
    logpath = /docker/containers/jellyfin-stable-data/config/log/jellyfin.log
    banaction = iptables-allports

    Code:
    chris@rat-trap:/var/log/jellyfin$ ls -lrt
    total 7160
    lrwxrwxrwx 1 root     root         34 Sep 28 00:01 jellyfin.log -> /var/log/jellyfin/log_20240928.log
    -rw-r--r-- 1 jellyfin jellyfin 826505 Sep 28 19:46 log_20240928.log

    Code:
    chris@rat-trap:/docker/containers/jellyfin-stable-data/config/log$ ll
    total 1608
    lrwxrwxrwx 1 root     root         67 Sep 28 00:01 jellyfin.log -> /docker/containers/jellyfin-stable-data/config/log/log_20240928.log
    -rw-r--r-- 1 jellyfin jellyfin 413124 Sep 28 18:46 log_20240928.log

    My cronjob runs this script at a minute past midnight.

    Code:
    #!/bin/bash

    rm /var/log/jellyfin/jellyfin.log
    NEWFILE=$(ls -lrt /var/log/jellyfin/* | egrep -v "FFmpeg|record|upload" | tail -1 | awk '{print $NF}')
    ln -s $NEWFILE /var/log/jellyfin/jellyfin.log

    rm /docker/containers/jellyfin-stable-data/config/log/jellyfin.log
    NEWFILE=$(ls -lrt /docker/containers/jellyfin-stable-data/config/log/* | egrep -v "FFmpeg|record|upload" | tail -1 | awk '{print $NF}')
    ln -s $NEWFILE /docker/containers/jellyfin-stable-data/config/log/jellyfin.log

    Root's crontab.

    Code:
    # m h  dom mon dow   command
    1 0 * * * rotateJellyfinLog
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    1
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Fail2Ban Installation & Docker Logs Ubuntu - by LittleFluffyCloud - 2024-09-28, 06:14 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by TheDreadPirate - 2024-09-28, 06:33 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by LittleFluffyCloud - 2024-09-28, 06:50 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by LittleFluffyCloud - 2024-09-28, 07:40 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by LittleFluffyCloud - 2024-09-28, 09:18 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by TheDreadPirate - 2024-09-28, 11:47 PM
    RE: Fail2Ban Installation & Docker Logs Ubuntu - by LittleFluffyCloud - 2024-09-29, 01:18 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode