Obtendo permissão negada ao tentar configurar o rTorrent com lighttpd

0

Eu quero criar localmente um servidor RPC do rTorrent.

Eu instalei o rTorrent, aqui está o ~/.rtorrent.rc

download_rate = 500
#upload_rate = 150

directory = ~/torrent/data

session = ~/torrent/session

port_range = 6881-6999
port_random = no

check_hash = yes

schedule = watch_directory,15,15,load_start=~/torrent/torrent_active/*.torrent

dht = auto

dht_port = 6880

encryption = allow_incoming,require,require_rc4

scgi_local = /home/vinz243/torrent/rpc.socket

e meu lighttpd.conf :

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
#       "mod_rewrite",
)

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"


include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

server.modules += ( "mod_scgi" )
scgi.server = (
                "/RPC2" =>
                  ( "127.0.0.1" =>
                    (
                      "socket" => "/home/vinz243/torrent/rpc.socket",
                      "check-local" => "disable",
                      "disable-time" => 0,  # don't disable scgi if connection fails
                    )
                  )
              )

Quando eu executo o rTorrent ele roda corretamente, eu só tenho essas linhas na parte inferior:

(20:00:31) Using 'epoll' based polling.
(20:00:31) Using 'epoll' based polling.
(20:00:31) Using 'epoll' based polling.
(20:00:31) Closed XMLRPC log.

No entanto, quando tento no meu navegador ir para localhost/RPC2 , Aqui está o /var/log/lighttpd/error.log :

2015-12-23 19:45:08: (log.c.164) server started 
2015-12-23 19:45:29: (mod_scgi.c.1393) connect failed: 7 Permission denied 13 0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:29: (mod_scgi.c.2410) fcgi-server disabled:  0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:29: (mod_scgi.c.2790) all handlers for  /RPC2 on /RPC2 are down. 
2015-12-23 19:45:30: (mod_scgi.c.2108) fcgi-server re-enabled:  0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:35: (mod_scgi.c.1393) connect failed: 7 Permission denied 13 0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:35: (mod_scgi.c.2410) fcgi-server disabled:  0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:35: (mod_scgi.c.2790) all handlers for  /RPC2 on /RPC2 are down. 
2015-12-23 19:45:36: (mod_scgi.c.2108) fcgi-server re-enabled:  0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:45: (mod_scgi.c.1393) connect failed: 7 No such file or directory 2 0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:45: (mod_scgi.c.2410) fcgi-server disabled:  0 /home/claire/torrent/rpc.socket 
2015-12-23 19:45:45: (mod_scgi.c.2790) all handlers for  /RPC2 on /RPC2 are down. 
2015-12-23 19:45:46: (mod_scgi.c.2108) fcgi-server re-enabled:  0 /home/claire/torrent/rpc.socket 
    
por Vinz243 23.12.2015 / 20:04

1 resposta

0

Resposta correta

Para resolver o problema, basta adicionar isso ao seu rtorrent.rc :

schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"

Resposta antiga com histórico

O rTorrent é estranho. Depois do início ele altera os direitos de acesso do arquivo socket , tornando-o inacessível para o lighttpd.

Estou com o mesmo problema e atualmente apenas corro

chmod 777 /home/vinz243/torrent/rpc.socket

sempre, depois que o rtorrent é iniciado, mas eu acho que chmod 777 não é uma solução melhor.

Existe o problema do github: link

Espero que isso possa ser útil para você.

UPD : parece que é um problema típico da instalação do rtorrent.

Para resolver o problema, basta adicionar isso ao seu rtorrent.rc :

schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"
    
por maxkoryukov 11.02.2016 / 21:58