Problems assigning rpc port to armv7-transmission-app-osmc

— I’ve edited settings.json to change rpc-port to port 80 —

cat /home/osmc/.config/transmission-daemon/settings.json | grep rpc-port

"rpc-port": 80,

— I’ve edited transmission.service to include “-p 80” —

cat /lib/systemd/system/transmission.service | grep ExecStart=

ExecStart=/usr/bin/transmission-daemon -f --log-error --allowed *.*.*.* -p 80

sudo systemctl daemon-reload

sudo service transmission restart

service transmission status

● transmission.service - Transmission BitTorrent Daemon Loaded: loaded (/lib/systemd/system/transmission.service; enabled) Active: active (running) since Thu 2017-09-07 22:25:02 CEST; 7min ago Process: 11761 ExecStartPre=/bin/sleep 10 (code=exited, status=0/SUCCESS) Main PID: 11763 (transmission-da) Status: "Idle." CGroup: /system.slice/transmission.service └─11763 /usr/bin/transmission-daemon -f --log-error --allowed *.*.*.* -p 80

sudo lsof -nP | grep LISTEN

`rpcbind     360             root    8u     IPv4       7001       0t0        TCP *:111 (LISTEN)
rpcbind     360             root   11u     IPv6       7004       0t0        TCP *:111 (LISTEN)
vsftpd     3899             root    3u     IPv6      25621       0t0        TCP *:21 (LISTEN)
sshd      11335             root    3u     IPv4    1763786       0t0        TCP *:22 (LISTEN)
sshd      11335             root    4u     IPv6    1763788       0t0        TCP *:22 (LISTEN)
transmiss 11763             osmc   13u     IPv4    1772563       0t0        TCP *:51413 (LISTEN)
transmiss 11763             osmc   14u     IPv6    1772565       0t0        TCP *:51413 (LISTEN)
transmiss 11763 11765       osmc   13u     IPv4    1772563       0t0        TCP *:51413 (LISTEN)
transmiss 11763 11765       osmc   14u     IPv6    1772565       0t0        TCP *:51413 (LISTEN)`

sudo netstat -lntp

`Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      360/rpcbind
tcp        0      0 0.0.0.0:51413           0.0.0.0:*               LISTEN      11763/transmission-
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      11335/sshd
tcp6       0      0 :::111                  :::*                    LISTEN      360/rpcbind
tcp6       0      0 :::51413                :::*                    LISTEN      11763/transmission-
tcp6       0      0 :::21                   :::*                    LISTEN      3899/vsftpd
tcp6       0      0 :::22                   :::*                    LISTEN      11335/sshd`

Is there some kind of mechanism built in to OSMC that prevents port 80 being assigned to a daemon? P.s. the mediacenter daemon is not running, hence port 8080 is not in use by kodi.bin.

Did you ever have it working on the default port, 9091?

@dillthedog yes, when changing the port in settings.json (not even editing the service) to 9091 or 8081, everything is working fine.

Is the Kodi webserver running on port 80?

A non-root user cannot bind to port 80. If the service runs under a different user, such as osmc, it will probably fail as a result.

You might also have a conflict between the -p 80 you’ve added to transmission.service and settings.json. Check settings.json again. You need to edit it when transmission is shut down because it saves its settings on shutdown, overwriting any changes you might have made.

You can do it with cap_net_bind_service=+ep. systemd also has a
method for setting this.

But we didn’t add this capability because we expect Kodi to be on Port 80.

1 Like

I tend to go the other way with Internet-facing applications like Transmission: lock it down as much as possible and stick it in some kind of sandbox/jail. Firejail works with Transmission but still has a few rough edges.

My recommendation would be to stick with port 9091.

This did the trick. Thankyou for the comments gentlemen. I do happen to have the luxury of having a hardware firewall in front of the Raspberry that allows me to fine-tune whatever may be done.

As such, I do not have a WAN-to-LAN policy, only allow LAN-to-WAN P2P communications via Application Control and limit LAN-to-LAN policies to myself as being the only authorised person to reach port 80 towards the IP of my Raspberry.

Being able to host it on port 80 is, truth be told, pure laziness from my side. I tend to forget to assign the right port when opening up the IP in my browser. Now I have to figure out how to get it to run on 443 with HTTPS :’).