2023-07-25, 12:16 PM
Hello,
Is there a command to stop the web server or stop jellyfin completely in windows?
Is there a command to stop the web server or stop jellyfin completely in windows?
2023-07-25, 12:16 PM
Hello,
Is there a command to stop the web server or stop jellyfin completely in windows?
2023-07-25, 02:28 PM
Hi,
One way to do it is this:
Replace the host and port if necessary. Replace 123456789abcde with the API key you generated earlier. I think you can authenticate via a username and password instead of generating an API key, but I don't know how, and I think using an API key for this task is better. curl.exe is included with Windows since Windows 10. If it is not present, you can use PowerShell to achieve the same thing: Code: Invoke-WebRequest -UseBasicParsing -Uri "http://127.0.0.1:8096/System/Shutdown" -Method POST -Headers @{ "X-Emby-Token" = "123456789abcde" } Otherwise: If, contrary to the Windows installer's recommendation, you installed Jellyfin in service mode, a simple net stop JellyfinServer in an elevated Command Prompt* on the same system where Jellyfin is running should also work. If you're using the tray app, a PowerShell script that uses GenerateConsoleCtrlEvent should also work, but that's a long story. * Or change the ACL on the Jellyfin service to allow stopping as a normal user - look into sc sdset or System Informer for a GUI There might be more ways to do it that I'm unaware of. Avoid taskkill though - Jellyfin doesn't listen for window messages so it will cause unclean Jellyfin shutdowns.
2023-07-25, 02:32 PM
I believe that the 10.9 release will include some shutdown and restart improvements to also make this sort of thing easier to accomplish from the dashboard as well.
2024-05-15, 06:38 PM
2024-05-15, 07:07 PM
(This post was last modified: 2024-05-15, 07:08 PM by TheDreadPirate.)
You cannot start Jellyfin with the same mechanism as the quoted shutdown. The quoted example is sending a command to a running jellyfin instance. You would start jellyfin on the command line simply by invoking jellyfin.exe and providing the appropriate startup options.
2024-05-16, 07:24 PM
(This post was last modified: 2024-05-16, 07:26 PM by wanderman. Edited 1 time in total.)
Ok thanks for the response. I was asking as i had problems with my old setup of shutting down the tray exe & jellyfin exe to be able to run a backup task. My old method seems to be broken since 1.9. as im no more able to properly kill both exes, either by normal or forced kill. One of both always keeps running.
However i found a solution, might help someone in the future. Im running a nightly FreeFileSync Backup for my database, thats why i need jellyfin stopped to not get corrupted files into the backup folder. The following is my Windows batch. The Batch as well as FreeFileSync is started by using the Windows Task Scheduler Shutdown via api call - short timer while FreeFileSync is running - Restarting Code: curl "http://192.168.178.71:8096/System/Shutdown" -X POST -H "X-Emby-Token: #####APIKEY####" (2024-05-16, 07:24 PM)wanderman Wrote: The Batch as well as FreeFileSync is started by using the Windows Task Scheduler The Task Scheduler starts programs with below normal CPU priority by default, BTW. Consider tacking on a /NORMAL somewhere in your start command to have Jellyfin run with a standard CPU priority. |
|
|