[Libtorrent-devel] XMLRPC: add shutdown method

Yann hado.pipi.kk at gmail.com
Wed Sep 8 14:37:10 UTC 2010


Hello All!

What would be needed to add the system.shutdown and system.pid methods to
the client rtorrent?

I'm using rtorrent in a completely blind system, using a startup script to
start/stop it automatically when the system goes on/off. Currently, I'm
relying on some ps|grep to get the pid to sigterm.

This is not an ideal solution, and I first thought of using system.pid,
but that does not look to be working [*]:
  # xmlrpc localhost system.pid
  Result:
  Don't recognize value type 10 of xmlrpc_value 133fcc0.
  Can't print it.

So, I thought I might better use the system.shutdown method, but it is
not working either:
  # xmlrpc localhost system.shutdown
  Error: RPC failed at server.  Invalid parameter list.  Format string requests
  1 items from array, but array has only 0 items. (-502)

OK, trying with any parameter, it seems shutdown is not implemented:
  # xmlrpc localhost system.shutdown 0
  Error: RPC failed at server.  This server program is not capable of
  shutting down (0)

So, where should I look at to properly implement shutdown (and pid) ?
What is this parameter that shutdown expects? Is it boolean, integer...?

As a side note, where can I find the complete documentation for the XMLRPC
API, with a comprehensive list of methods implemented, and what parameters
they expect, with their meaning, types, limits... ?

Regards,
Yann.

[*] Of course, xmlrpc is otherwise working:
  # xmlrpc localhost system.client_version
  Result:
  String: '0.8.6'
  # xmlrpc localhost system.library_version
  Result:
  String: '0.12.6'




More information about the Libtorrent-devel mailing list