[Libtorrent-devel] XMLRPC: add shutdown method
Yann
hado.pipi.kk at gmail.com
Fri Sep 10 22:25:46 UTC 2010
On Wednesday 08 September 2010 20:15:00 Jürgen Hermann wrote:
> Yann wrote:
> > 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.
> As Sergei wrote, why use xmlrpc when signals do the job:
Hmmm. I forgot that part: it can happen I want to remotely stop rtorrent,
and sending an xmlrpc request is easier than ssh-ing in the box, su - to
the user , ps|grep and kill. And as such, always resorting to xmlrpc,
even in the startup script, if much easier.
I guess I have an idea to implement system.shutdown. Is this something I
can submit for inclusion, or do you guys not want system.shutdown?
> main.cc: SignalHandler::set_handler(SIGINT, sigc::mem_fun(control,
> &Control::receive_normal_shutdown));
> main.cc: SignalHandler::set_handler(SIGTERM, sigc::mem_fun(control,
> &Control::receive_quick_shutdown));
I was sending SIGTERM until now, but I've now switched to using SIGINT.
What's the delta between the normal and the quick shutdown?
> As for system.pid, that works perfectly in 0.8.6, the problem lies in
> the xmlrpc tool you use, which likely doesn't support 64bit values (and
> that is a general problem if you use xmlrpc for anything serious).
Ah yes... That's it. I compiled my own xmlrpc, but somehow it was choking
on UTF-8 non-ASCII chars, and was sending something like \xff for each
of them (eg. on d.get_base_filename). So I switched to using my distro's
xmlrpc (debian lenny on 64-bit) and that was working. But it lacks 64-bit.
I just tried again with my own xmlrpc, and system.pid *is* working, indeed.
Thank you both for your answers! :-)
Regards,
Yann.
More information about the Libtorrent-devel
mailing list