• 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: jellyfin service does not start after changing server paths

     
    • 0 Vote(s) - 0 Average

    SOLVED: jellyfin service does not start after changing server paths

    sidre
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Jan
    Reputation: 0
    #1
    2024-01-15, 02:17 PM (This post was last modified: 2024-01-15, 02:38 PM by sidre. Edited 3 times in total.)
    Hello. Sorry for my bad English.

    I have created the folders:
    Quote:/DATA/jellyfin/config
    /DATA/jellyfin/cache
    /DATA/jellyfin/data
    /DATA/jellyfin/log

    After moving the content to the new folders, I have deleted the old folders:
    Quote:sudo rm -r /var/lib/jellyfin
    sudo rm -r /etc/jellyfin
    sudo rm -r /var/log/jellyfin
    sudo rm -r /var/cache/jellyfin

    I have modified the file "/etc/default/jellyfin":
    Quote:JELLYFIN_DATA_DIR="/DATA/jellyfin/data"
    JELLYFIN_CONFIG_DIR="/DATA/jellyfin/config"
    JELLYFIN_LOG_DIR="/DATA/jellyfin/log"
    JELLYFIN_CACHE_DIR="/DATA/jellyfin/cache"

    and the file "/etc/systemd/system/jellyfin.service.d/jellyfin.service.conf":
    Quote:[Service]
    User = jellyfin
    EnvironmentFile = /etc/default/jellyfin

    jellyfin.service does not work after modifying server paths.
    Quote:$ sudo systemctl status jellyfin
    × jellyfin.service - Jellyfin Media Server
        Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; vendor preset: enabled)
        Drop-In: /etc/systemd/system/jellyfin.service.d
                └─jellyfin.service.conf
        Active: failed (Result: exit-code) since Mon 2024-01-15 14:29:05 UTC; 1s ago
        Process: 3850 ExecStart=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS (code=exited, status=200/CHDIR)
      Main PID: 3850 (code=exited, status=200/CHDIR)
            CPU: 2ms

    ene 15 14:29:05 b85 systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 5.
    ene 15 14:29:05 b85 systemd[1]: Stopped Jellyfin Media Server.
    ene 15 14:29:05 b85 systemd[1]: jellyfin.service: Start request repeated too quickly.
    ene 15 14:29:05 b85 systemd[1]: jellyfin.service: Failed with result 'exit-code'.
    ene 15 14:29:05 b85 systemd[1]: Failed to start Jellyfin Media Server.

    The new folders don't seem to have any problems because jellyfin runs correctly if run directly from the terminal indicating the server paths.
    Quote:$ sudo -u jellyfin jellyfin -d /DATA/jellyfin/data -C /DATA/jellyfin/cache -c /DATA/jellyfin/config -l /DATA/jellyfin/log -w /usr/share/jellyfin/web --restartpath=/usr/lib/jellyfin/restart.sh --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg

    It seems that jellyfin.service does not read the '/etc/default/jellyfin' file at all because even if I modify the parameter "JELLYFIN_ARGS"
    Quote:JELLYFIN_ARGS="$JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLFIN_ADDITIONAL_OPTS"

    JELLYFIN_ARGS="-d $JELLYFIN_DATA_DIR -C $JELLYFIN_CACHE_DIR -c $JELLYFIN_CONFIG_DIR -l $JELLYFIN_LOG_DIR $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLFIN_ADDITIONAL_OPTS"

    JELLYFIN_ARGS="-d /DATA/jellyfin/data -C /DATA/jellyfin/cache -c /DATA/jellyfin/config -l /DATA/jellyfin/log $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLFIN_ADDITIONAL_OPTS"
    The next line of "systemctl status" is always the same.
    Quote:    Process: 3850 ExecStart=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS (code=exited, status=200/CHDIR)
    Go to solution
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #2
    2024-01-15, 02:52 PM (This post was last modified: 2024-01-15, 02:53 PM by tmsrxzar. Edited 1 time in total.)
    being able to run it manually does not indicate "no issue with paths" it just means that your user has access to the paths, doesn't mean jellyfin has access to the paths

    jellyfin runs as it's own user, you need to ensure that user has permission to the new paths

    ls -lan /DATA

    chown -R (jellyfinuid):(jellyfingid) /DATA
    sidre
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Jan
    Reputation: 0
    #3
    2024-01-15, 03:13 PM
    Cannot delete folder "/var/lib/jellyfin" because starting the service creates a subfolder ".aspnet"
    Quote:$ sudo mkdir /var/lib/jellyfin
    $ sudo chown jellyfin:adm /var/lib/jellyfin
    $ sudo chmod 750 /var/lib/jellyfin

    $ ls -la /var/lib/jellyfin/
    total 12
    drwxr-x---  3 jellyfin adm      4096 ene 15 15:00 .
    drwxr-xr-x 46 root    root    4096 ene 15 14:57 ..
    drwxr-xr-x  3 jellyfin jellyfin 4096 ene 15 15:00 .aspnet

    After recreating the directory "/var/lib/jellyfin" the service runs correctly
    Quote:$ sudo systemctl status jellyfin.service
    ● jellyfin.service - Jellyfin Media Server
        Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; vendor preset: enabled)
        Drop-In: /etc/systemd/system/jellyfin.service.d
                └─jellyfin.service.conf
        Active: active (running) since Mon 2024-01-15 15:08:49 UTC; 7s ago
      Main PID: 4301 (jellyfin)
          Tasks: 19 (limit: 17732)
        Memory: 80.5M
            CPU: 3.999s
        CGroup: /system.slice/jellyfin.service
                └─4301 /usr/bin/jellyfin --webdir=/usr/share/jellyfin/web --restartpath=/usr/lib/jellyfin/restart.sh --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg

    ene 15 15:08:52 b85 jellyfin[4301]: [15:08:52] [INF] Core startup complete
    ene 15 15:08:52 b85 jellyfin[4301]: [15:08:52] [INF] Resetting user root folder path to /DATA/jellyfin/data/root/default
    ene 15 15:08:52 b85 jellyfin[4301]: [15:08:52] [INF] Resetting root folder path to /DATA/jellyfin/data/root
    ene 15 15:08:52 b85 jellyfin[4301]: [15:08:52] [INF] Executed all post-startup entry points in 0:00:00.1086923
    ene 15 15:08:52 b85 jellyfin[4301]: [15:08:52] [INF] Startup complete 0:00:03.0237566
    ene 15 15:08:55 b85 jellyfin[4301]: [15:08:55] [INF] StartupTrigger fired for task: Actualizar extensiones
    ene 15 15:08:55 b85 jellyfin[4301]: [15:08:55] [INF] Queuing task PluginUpdateTask
    ene 15 15:08:55 b85 jellyfin[4301]: [15:08:55] [INF] Executing Actualizar extensiones
    ene 15 15:08:56 b85 jellyfin[4301]: [15:08:56] [INF] Actualizar extensiones Completed after 0 minute(s) and 1 seconds
    ene 15 15:08:56 b85 jellyfin[4301]: [15:08:56] [INF] ExecuteQueuedTasks
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • 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