SteveFintel 26 Posted August 8, 2023 Share Posted August 8, 2023 I have Emby running in a TrueNAS 13.1 jail. I need to periodically reboot emby-server for it to pick up an updated SSL certificate. I have been using the command line: service emby-server restart but I'm afraid that doesn't safely shut down and restart the process. Is there a safer way to accomplish this? Link to comment Share on other sites More sharing options...
Luke 37191 Posted August 12, 2023 Share Posted August 12, 2023 Hi, we don’t have a way from the command line at this time. I would suggest using the button in the web interface to shutdown. If you want to be able to script it then I would suggest using the Emby server api. Please let us know if this helps. Thanks. Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted August 12, 2023 Author Share Posted August 12, 2023 It does, a little. That leads to more programming that I think I can do - I first have to authenticate a user and then send the command. Is what I'm doing now (service emby-server restart) dangerous? Link to comment Share on other sites More sharing options...
Luke 37191 Posted August 12, 2023 Share Posted August 12, 2023 I’d probably suggest regular backups of the server data folder so that if you do run into a corrupted database you can easily restore from that. Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted August 13, 2023 Author Share Posted August 13, 2023 I've already been doing the daily full backups. But perhaps I'm doing this wrong. Here's what I mean: the certificate that I use to authenticate Emby over https is a Let's Encrypt certificate that is updated randomly. Every night, I run a script that builds a new .pfx file and deposit that file in /var/db/emby-server/config. The only way I know to force emby-server to 'ingest' that certificate is by rebooting it. Is there another method that would be safer? Link to comment Share on other sites More sharing options...
Luke 37191 Posted August 14, 2023 Share Posted August 14, 2023 Currently the pfx is loaded on server startup, so yes that means you have to restart. We should look at adding another way to refresh it though. Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted August 14, 2023 Author Share Posted August 14, 2023 OK. Reboot it is (for now). 1 Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted August 15, 2023 Author Share Posted August 15, 2023 I just realized I can authenticate from a script with an API key. Problem solved. 1 Link to comment Share on other sites More sharing options...
FrogMaster 24 Posted October 4, 2023 Share Posted October 4, 2023 (edited) Personally, I regularly use the following: service emby-server stop Then I tend to do updates, ETC, and I will restart the service with service emby-server start I've never encountered any form of database, or data corruption while performing these actions and I've managed my server like this for years. I am doubtful you would encounter any issues by using what you've mentioned: service emby-server restart Edited October 4, 2023 by FrogMaster Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted October 4, 2023 Author Share Posted October 4, 2023 Thanks for this. I was doing the same thing for a while but was worried because using the shutdown link within the UI is not nearly as quick as using the command line 'service stop...' I was always wondering if it was safely shutting down processes before actually stopping. So I feel better running: curl -X POST http://[emby_IP_address]:8096/emby/System/Restart\?api_key=[API Key] I believe that runs the same command that gets triggered by the UI and it just feels 'safer' to me. 1 Link to comment Share on other sites More sharing options...
starfury 3 Posted October 7, 2023 Share Posted October 7, 2023 The command I run is this: iocage exec emby /usr/local/bin/curl -X POST "http://[emby_server_ip]:8096/emby/System/Restart?api_key=[API_key]" -d "" The "iocage exec emby" part is because I run a script in TrueNAS to update the SSL certs on several jails plus the system itself, so that commands TrueNAS to run the command inside the jail. It's worked for 1+ years without a hitch. Hope this helps. 1 1 Link to comment Share on other sites More sharing options...
SteveFintel 26 Posted October 7, 2023 Author Share Posted October 7, 2023 Updating the cert in a TrueNas jail is exactly the reason I'm rebooting Emby server. It's good to know we landed on the same solution. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now