Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Tribler service with systemd #8425

Closed
im-vmn opened this issue Jan 29, 2025 · 5 comments
Closed

Control Tribler service with systemd #8425

im-vmn opened this issue Jan 29, 2025 · 5 comments

Comments

@im-vmn
Copy link

im-vmn commented Jan 29, 2025

I run Tribler in server mode (with --server) and wrote a simple unit file to launch Tribler, but now I want to implement stop and restart calls. Usually I use SIGTERM, if I know that a program handles it, but in this case I am not sure if my torrents will be ok after that. So, what is the best way to kill Tribler?

@qstokkink
Copy link
Contributor

Sending an HTTP PUT request to the /api/shutdown REST API endpoint is the clean way to shut down Tribler.

It should be something along the lines of this:

curl -X PUT http://127.0.0.1:8085/api/shutdown

@im-vmn
Copy link
Author

im-vmn commented Jan 29, 2025

Thank you, it works. Where can I find information about API?

@qstokkink
Copy link
Contributor

We support Swagger. So, browsing to http://127.0.0.1:8085/docs (or whatever host+port you're listening on), will show all the available calls. If you authorize the interface with your key, you can even make REST calls to Tribler from there.

@im-vmn
Copy link
Author

im-vmn commented Jan 29, 2025

Thank you!

@im-vmn im-vmn closed this as completed Jan 29, 2025
@qstokkink
Copy link
Contributor

qstokkink commented Jan 29, 2025

You're welcome. 👌

By the way, we do have a systemd service file, technically. However, it hasn't been touched in 6 years and it is now completely broken. We would very much enjoy any contributions, if you have a working setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants