You are not logged in.

#1 2014-11-01 15:37:27

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Systemd - socket-based activation of transmission-daemon

Hello,

I am trying to set up socket-based activation of transmission-daemon with systemd.

Here is what i have,

[Unit]
Description=transmission-daemon socket
After=network.target

[Socket]
ListenStream=9091

[Install]
WantedBy=sockets.target
[Unit]
Description=transmission bittorrent client

[Service]
Type=notify
ExecStart=/usr/bin/transmission-daemon -f --log-error --no-utp
ExecStop=/usr/bin/killall transmission-daemon
Restart=on-abnormal

When trying to connect to the daemon using transmission-remote, the service is successfully started.
However, any connection times-out:

[2014-11-01 15:44:08.383 WET] transmission-remote:  (http://localhost:9091/transmission/rpc/) Timeout was reached

On the other hand, if i start the service file manually, disableing the socket, i can connect to
the daemon.

What is going on?

Last edited by captaincurrie (2014-11-01 15:45:34)

Offline

#2 2014-12-19 17:44:47

intelfx
Member
From: Russia, Moscow
Registered: 2013-08-21
Posts: 13

Re: Systemd - socket-based activation of transmission-daemon

The socket-activation mechanism of systemd has to be supported on the application's side. To quote systemd.socket(5):

Note that the daemon software configured for socket activation with socket units needs to be able to accept sockets from systemd, either via systemd's native socket passing interface (see sd_listen_fds(3) for details) or via the traditional inetd(8)-style socket passing (i.e. sockets passed in via standard input and output, using StandardInput=socket in the service file).

So, IIUC, currently transmission-daemon can't be socket-activated.

P. S.: What are you seeing (a connection timeout) happens because the sockets are listened to by systemd. It accepts the incoming connection, starts transmission-daemon and waits for it to take control of the socket, which never happens.

Last edited by intelfx (2014-12-19 17:47:05)

Offline

#3 2014-12-20 08:37:54

captaincurrie
Member
From: /dev/random
Registered: 2013-11-01
Posts: 82

Re: Systemd - socket-based activation of transmission-daemon

intelfx wrote:

The socket-activation mechanism of systemd has to be supported on the application's side. To quote systemd.socket(5):

Note that the daemon software configured for socket activation with socket units needs to be able to accept sockets from systemd, either via systemd's native socket passing interface (see sd_listen_fds(3) for details) or via the traditional inetd(8)-style socket passing (i.e. sockets passed in via standard input and output, using StandardInput=socket in the service file).

So, IIUC, currently transmission-daemon can't be socket-activated.

P. S.: What are you seeing (a connection timeout) happens because the sockets are listened to by systemd. It accepts the incoming connection, starts transmission-daemon and waits for it to take control of the socket, which never happens.

Hey intefx.

Thanks for your response, thats crystal clear.

I also attempted to use systemd-socket-proxyd, which sounds like it should make up for these 'inadequacies'. Quoting:

systemd-socket-proxyd is a generic socket-activated network socket forwarder proxy daemon for IPv4, IPv6 and UNIX stream sockets. It may be used to bi-directionally forward traffic from a local listening socket to a local or remote destination socket.

One use of this tool is to provide socket activation support for services that do not natively support socket activation. On behalf of the service to activate, the proxy inherits the socket from systemd, accepts each client connection, opens a connection to a configured server for each client, and then bidirectionally forwards data between the two.

However, i havn't had any success with this either...

Offline

Board footer

Powered by FluxBB