Differences
This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
topics:aria2-netns-systemd [2017/12/20 18:12] orzfly created |
topics:aria2-netns-systemd [2017/12/20 18:16] orzfly |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Run aria2 with isolated netns with Systemd ====== | ====== Run aria2 with isolated netns with Systemd ====== | ||
+ | < | ||
+ | git clone https:// | ||
+ | cd systemd-named-netns | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | <code - / | ||
+ | BRIDGE=br-lan | ||
+ | DHCPV4=1 | ||
+ | </ | ||
+ | |||
+ | <code - / | ||
+ | MACADDR=52: | ||
+ | </ | ||
+ | |||
+ | <code ini / | ||
+ | [Unit] | ||
+ | Requires=network-online.target | ||
+ | After=network-online.target netns-bridge@aria2c.service mts-Incoming.mount | ||
+ | BindsTo=netns-bridge@aria2c.service mts-Incoming.mount | ||
+ | JoinsNamespaceOf=netns@aria2c.service | ||
+ | |||
+ | [Service] | ||
+ | PrivateNetwork=yes | ||
+ | SyslogIdentifier=aria2c-daemon.service | ||
+ | User=orzfly | ||
+ | Group=orzfly | ||
+ | ExecStart=/ | ||
+ | --enable-rpc \ | ||
+ | --rpc-listen-all=true \ | ||
+ | --rpc-allow-origin-all \ | ||
+ | --rpc-listen-port=27679 \ | ||
+ | --rpc-secret=TOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKEN \ | ||
+ | --max-concurrent-downloads=10 \ | ||
+ | --max-connection-per-server=16 \ | ||
+ | --min-split-size=1M \ | ||
+ | --split=16 \ | ||
+ | --max-overall-download-limit=0 \ | ||
+ | --max-download-limit=0 \ | ||
+ | --max-overall-upload-limit=0 \ | ||
+ | --max-upload-limit=0 \ | ||
+ | --max-tries=1000 \ | ||
+ | --retry-wait=5 \ | ||
+ | --input-file=/ | ||
+ | --save-session=/ | ||
+ | --save-session-interval=15 \ | ||
+ | --disk-cache=0 \ | ||
+ | --allow-overwrite=false \ | ||
+ | --always-resume=true \ | ||
+ | --auto-file-renaming=false \ | ||
+ | --continue=true \ | ||
+ | --remote-time=true \ | ||
+ | --lowest-speed-limit=50K \ | ||
+ | --file-allocation=none \ | ||
+ | --dir=/ | ||
+ | --seed-time=60 \ | ||
+ | --bt-detach-seed-only=true \ | ||
+ | --bt-request-peer-speed-limit=2M \ | ||
+ | --bt-max-peers=100 \ | ||
+ | --bt-max-open-files=100 \ | ||
+ | --bt-save-metadata=true \ | ||
+ | --user-agent=' | ||
+ | --allow-piece-length-change=true | ||
+ | Restart=always | ||
+ | RestartSec=15s | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | <spoiler |Previous naive version with raw netns commands> | ||
<code ini / | <code ini / | ||
[Unit] | [Unit] | ||
Line 62: | Line 133: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</ | </ | ||
+ | </ | ||
===== See Alsos ===== | ===== See Alsos ===== | ||
+ | - [[topics: | ||
+ | - https:// | ||
- https:// | - https:// | ||
{{tag> | {{tag> |