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

Can't use the RPC plugin with scgi_local #159

Closed
nicobubulle opened this issue Aug 22, 2014 · 15 comments
Closed

Can't use the RPC plugin with scgi_local #159

nicobubulle opened this issue Aug 22, 2014 · 15 comments

Comments

@nicobubulle
Copy link
Collaborator

From [email protected] on November 07, 2009 20:00:12

I setup rtorrent.rc with scgi_local:

$ grep scgi /etc/rtorrent.rc
scgi_local = /tmp/rpc.socket

I use the RPC plugin, and configured rutorrent to use the RPC socket:

$ grep
scgi /var/www/rtorrent/config.php

$scgi_port = 0;
$scgi_host = "unix:///tmp/rpc.socket";

When I load the rutorrent webpage, I get the following error:

[07.11.2009 19:44:30] WebUI started.
[07.11.2009 19:44:31] Bad link to rTorrent. Check if it is really running.
Check $scgi_port and $scgi_host settings in config.php and scgi_port in
rTorrent configuration file.
[07.11.2009 19:44:31] Bad response: (404) <title>404 - Not Found</title>

404 - Not Found

From the logs of the web server, it appears that rutorrent is trying to

access /RPC2:

xxx.xxx.xxx.xxx hostname username [07/Nov/2009:19:44:32
+0100] "POST /RPC2 HTTP/1.1" 404

345 "http://hostname/rtorrent/ "Mozilla/4.0"

Is this a bug or a configuration problem?
Thanks.

Original issue: http://code.google.com/p/rutorrent/issues/detail?id=160

@nicobubulle
Copy link
Collaborator Author

From novik65 on November 07, 2009 23:57:52

  1. Is file /tmp/rpc.socket really exists?
  2. What about it access rights?
  3. What about your OS?

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 08, 2009 00:35:33

Hi.

  1. yes, it's indeed a socket:
    $ file /tmp/rpc.socket
    /tmp/rpc.socket: socket
  2. World-readable:
    $ ls -al /tmp/rpc.socket
    srwxr-xr-x 1 rtorrent nogroup 0 2009-11-08 09:32 /tmp/rpc.socket
  3. uname -a
    Linux hostname 2.6.31-1-amd64 Путь к лог-файлу #1 SMP Sat Oct 24 17:50:31 UTC 2009 x86_64 GNU/Linux

rtorrent-2.7,
rpc plugin svn rev. 11

Thanks,

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 08, 2009 10:30:36

try putting something like this in rtorrent.rc
schedule = chmod,0,0,"execute=chmod,777,/tmp/rpc.socket"

@nicobubulle
Copy link
Collaborator Author

From novik65 on November 09, 2009 00:22:17

World-readable:

Web-server user must has the read/write access to this socket. See comment 4 above.

Status: Invalid

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 10, 2009 10:54:47

I tried with:

$ ls -al /tmp/rpc.socket
srwxrwxrwx 1 rtorrent nogroup 0 2009-11-10 19:49 /tmp/rpc.socket

and still got the same 404 error.

Any other idea?

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 10, 2009 19:14:41

which webserver? you have the socket set correctly in all locations?

@nicobubulle
Copy link
Collaborator Author

From novik65 on November 11, 2009 00:32:11

I use the RPC plugin, and configured rutorrent to use the RPC socket:

  1. If you see in web-server log lines "POST /RPC2 HTTP/1.1" => RPC plugin is not
    installed.
  2. If you see in WebUI log lines "Bad link to rTorrent. Check if it is really running.
    Check $scgi_port and $scgi_host settings in config.php and scgi_port in
    rTorrent configuration file." => php can't connect to $scgi_host:$scgi_port.

Check configuration. Doesn't post here incorrect data, please.

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 12, 2009 10:54:51

which webserver? you have the socket set correctly in all locations?
lighttpd. Yes.

  1. If you see in web-server log lines "POST /RPC2 HTTP/1.1" => RPC plugin is not
    installed.
    I do see POST /RPC2 in the web server log, AND the RPC plugin is installed. At least,
    I have a rpc/ directory under plugins/ which contains the RPC plugin files :
    $ ls /var/www/rtorrent/plugins/rpc
    init.js rpc.php
    Is there anything else required to enable the RPC plugin?

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 12, 2009 11:03:05

do you have the port set in .rtorrent.rc

scgi_port = 127.0.0.1:5000

@nicobubulle
Copy link
Collaborator Author

From novik65 on November 13, 2009 00:32:26

Is there anything else required to enable the RPC plugin?

Web-server user must has read\execute access to directory rpc and read access to it
contents. If plugin is installed correctly, you will see in web-server access log
lines like "POST /rtorrent/plugins/rpc/rpc.php HTTP/1.1" instead "POST /RPC2 HTTP/1.1".

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 22, 2009 02:34:09

Wait, it doesn't make any sense: I don't have anything related to SCGI nor RPC in my
webserver configuration, and the rpc plugin works when I have
scgi_port=localhost:5000 in rtorrent.rc. But as soon as I try to use
scgi_local=/tmp/rpc.socket (and updating config.php accordingly), it doesn't work
anymore.

Would it be possible to have simple instructions on how to use the RPC plugin with a
local socket?

To summarize :

  1. my rtorrent.rc file contains:
    scgi_local = /tmp/rpc.socket
    (no scgi_port)

  2. permissions on the socket are enough for every user to read and write to it:

    ls -al /tmp/rpc.socket

    srwxr-xr-x 1 rtorrent nogroup 0 2009-11-22 11:16 /tmp/rpc.socket

  3. my lighttpd.conf does not contain anything related to SCGI nor RPC

  4. the rpc plugin is here and readable by the webserver user:

    ls -al /var/www/rtorrent/plugins/rpc/

    total 20
    drwxr-xr-x 3 www-data www-data 4096 2009-11-21 21:59 .
    drwxr-xr-x 24 www-data www-data 4096 2009-09-30 12:23 ..
    -rw-r--r-- 1 www-data www-data 55 2009-11-07 19:47 init.js
    -rw-r--r-- 1 www-data www-data 627 2009-11-10 19:51 rpc.php

  5. ruTorrent's config.php contains:
    $scgi_port = 0;
    $scgi_host = "unix:///var/lib/rtorrent/rpc.socket";

When I load the ruTorrent web interface, I get the following error in the browser:

[22.11.2009 11:24:54] Bad link to rTorrent. Check if it is really running. Check
$scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent
configuration file.
[22.11.2009 11:24:55] Bad response: (404) <title>404 -
Not Found</title>

404 - Not Found

And the webserver (lighttpd) log file contains :

::ffff:xxx.xxx.xxx.xxx host.tld - [22/Nov/2009:11:24:58 +0100] "POST /RPC2 HTTP/1.1"
404 345 " https://host.tld/rtorrent/ " "-"

So it seems to me that the RPC plugin does not understand it needs to connect to the
/tmp/rpc.socket socket, and that it still tries to connect through the network
socket. Everything works fine if I just change back
scgi_local = /tmp/rpc.socket
to
scgi_port = localhost:5000
in rtorrent.rc, and
$scgi_port = 0;
$scgi_host = "unix:///var/lib/rtorrent/rpc.socket";
to
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
in config.php

Thanks for any insight.
Cheers,

@nicobubulle
Copy link
Collaborator Author

From novik65 on November 23, 2009 00:32:55

  1. permissions on the socket are enough for every user to read and write to it:

    ls -al /tmp/rpc.socket

    srwxr-xr-x 1 rtorrent nogroup 0 2009-11-22 11:16 /tmp/rpc.socket

Don't understand. You really thinking - "srwxr-xr-x" is mean "every user to read and
write"?

  1. my rtorrent.rc file contains: scgi_local = /tmp/rpc.socket
  2. ruTorrent's config.php contains: $scgi_host = "unix:///var/lib/rtorrent/rpc.socket";

For wich reason rtorrent.rc and config.php contains different path to rpc socket?

@nicobubulle
Copy link
Collaborator Author

From [email protected] on November 23, 2009 10:31:48

Nevermind, I screwed it up. My configuration was not coherent... My bad.
The RPC plugin seems to be working with a local scgi socket, now.

Thanks a lot for your time.

@nicobubulle
Copy link
Collaborator Author

From lucasreddinger on July 14, 2012 04:31:10

What was wrong? I'm trying to set this up myself. Was it this?

  1. permissions on the socket are enough for every user to read and write to it:

    ls -al /tmp/rpc.socket

    srwxr-xr-x 1 rtorrent nogroup 0 2009-11-22 11:16 /tmp/rpc.socket

@nicobubulle
Copy link
Collaborator Author

From novik65 on July 14, 2012 04:39:54

This place is not a forum. Use forum for your questions.

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

No branches or pull requests

1 participant