Seems like this forum is dead, but posting for posterity.
Didn't get a elegant solution like that reddit comment suggested, but got it working with multiple systemd unit files.
Not pretty, but works.
You need to do some things differently from the guides.
Changes to the "
Configure Deluge for VPN Split Tunneling Debian 8" guide:
Guide works for Ubuntu 16.04+ as well.
Instead of this:
Code:
mkdir -p /etc/systemd/system/deluged.service.d/
nano /etc/systemd/system/deluged.service.d/local.conf
Do this:
Code:
sudo nano /etc/systemd/system/deluged1.service
And copy+paste the following:
Code:
[Unit]
Description=Deluge Bittorrent Client Daemon
After=sys-devices-virtual-net-tun0.device
Wants=sys-devices-virtual-net-tun0.device
[Service]
Type=simple
User=vpn
Group=vpn
UMask=007
ExecStart=/usr/bin/deluged -d -c /home/vpn/deluge1/ -l /var/log/deluge/daemon1.log -L warning
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
Ctrl+x to exit. 'y' and enter to save.
Code:
sudo systemctl daemon-reload
As seen in two of the code snippets I used the numeral "1" to differentiate this deluged instance. Called the next instance "deluged2" and so on. You can change that to whatever.
Now for another instance:
Code:
sudo nano /etc/systemd/system/deluged2.service
And copy+paste the unit file text again, just change the 1's to 2's.
Continue doing that for as many instances that you want.
When finished, start each deluged instance with
Code:
sudo systemctl start deluged1.service
and
Code:
sudo systemctl start deluged2.service
etc...
Then stop them.
Code:
sudo systemctl stop deluged#.service
After each start you'll need to change that deluged instance's "core.conf" file. And "auth" file if you're connecting with the Deluge thinclient.
If the deluged "core.conf" is blank, try starting deluged again and add a torrent and change some settings. Or just copy+paste my template. I'll add in in the end of this post.
Stop it again before editing files.
The "auth" file is explained in the thinclient guide.
Code:
sudo nano /home/vpn/deluge#/auth
sudo nano /home/vpn/deluge#/core.conf
In the "core.conf" file you need to change the " "daemon_port": 58851," line to get each instance on a different port. Deluged2 on port '58852', deluged3 on port '58852' etc is fine.
Also edit "autoadd_location" and "plugins_location" if you are going to have those different on each instance.
Ctrl+x to exit. 'y' and enter to save.
Throw in a
Code:
sudo systemctl daemon-reload
before after each change/before starting them.
Check their status with
Code:
sudo systemctl status deluged#.service
If everything seems OK, enable the services with
Code:
sudo systemctl enable deluged#.service
You need to start and enable each one of the services individually.
Possible to control them all together, but haven't gotten there yet. Google "systemd.slice" for more info.
After you have enabled the services, they will start automatically at launch.
That should roughly cover it. Probably need to fix some permission issues or something. But with some external reading, I think this should be enough.
And read up on the linux logupdate utility. Didn't cover that.
And also no web UI stuff, because I didn't set that up.
Remember to check the logs if something doesn't work.
Code:
nano /var/log/deluge/daemon#.log
Hope this helps someone. I made it work with less, so it's very possible (not very good on linux yet).
--------------------------------------------
--------------------------------------------
core.conf template:
Code:
{
"file": 1,
"format": 1
}{
"info_sent": 0.0,
"lsd": false,
"send_info": false,
"move_completed_path": "/home/vpn/Downloads",
"enc_in_policy": 1,
"queue_new_to_top": false,
"ignore_limits_on_local_network": true,
"rate_limit_ip_overhead": true,
"daemon_port": 58851,
"natpmp": false,
"max_active_limit": -1,
"utpex": false,
"max_active_downloading": 8,
"max_active_seeding": -1,
"allow_remote": true,
"max_half_open_connections": 20,
"download_location": "/somefolder/someotherfolder",
"compact_allocation": false,
"max_upload_speed": -1.0,
"cache_expiry": 60,
"prioritize_first_last_pieces": false,
"auto_managed": true,
"enc_level": 2,
"max_connections_per_second": 5,
"dont_count_slow_torrents": false,
"random_outgoing_ports": true,
"max_upload_slots_per_torrent": 6,
"new_release_check": false,
"enc_out_policy": 2,
"outgoing_ports": [
0,
0
],
"seed_time_limit": 180,
"cache_size": 512,
"share_ratio_limit": 2.0,
"max_download_speed": -1.0,
"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
"torrentfiles_location": "/home/vpn/Downloads",
"stop_seed_at_ratio": false,
"peer_tos": "0x00",
"listen_interface": "",
"upnp": false,
"max_download_speed_per_torrent": -1,
"max_upload_slots_global": 20,
"enabled_plugins": [],
"random_port": true,
"autoadd_enable": false,
"max_connections_global": 40,
"enc_prefer_rc4": false,
"listen_ports": [
6881,
6891
],
"dht": false,
"stop_seed_ratio": 2.0,
"seed_time_ratio_limit": 7.0,
"max_upload_speed_per_torrent": -1,
"copy_torrent_file": false,
"del_copy_torrent_file": false,
"move_completed": false,
"proxies": {
"peer": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"web_seed": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"tracker": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
},
"dht": {
"username": "",
"password": "",
"type": 0,
"hostname": "",
"port": 8080
}
},
"add_paused": true,
"max_connections_per_torrent": 10,
"remove_seed_at_ratio": false,
"autoadd_location": "/home/vpn/deluge/Downloads",
"plugins_location": "/home/vpn/deluge/plugins"
}