jellyfin-server-windows icon indicating copy to clipboard operation
jellyfin-server-windows copied to clipboard

Jellyfin delayed autostart

Open ThomasPGH opened this issue 8 months ago • 1 comments

By default and when running as a Windows service Jellyfin is very slow to start after its hosting machine is restarted.

The culprit is this line in the installer: ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Start SERVICE_DELAYED_AUTO_START' $0

This should be: ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Start SERVICE_AUTO_START' $0

The value SERVICE_DELAYED_AUTO_START instead of SERVICE_AUTO_START delays its service start until all other services have started, and then enters nssm's service entry routine ServiceMain () with a value of THREAD_PRIORITY_LOWEST. See https://learn.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-service_delayed_auto_start_info for details.

My asumption is that the SERVICE_DELAYED_AUTO_START flag got in there by accident, as I cannot imagine that someone who runs Jellyfin as a Windows service considers anything more important than starting up Jellyfin first. I reckon that just like me most users with a setup like this have a dedicated machine for Jellyfin.

ThomasPGH avatar Jun 29 '24 15:06 ThomasPGH