Merge branch 'fix-labsync-seeder' into 'master'

Fix labsync seeder

See merge request fablab/labsync!40
This commit is contained in:
Simon Bruder 2018-10-25 15:56:37 +00:00
commit 49bc44cad2
3 changed files with 9 additions and 2 deletions

View file

@ -7,6 +7,8 @@ ExecStart=/usr/local/sbin/labsync-seeder.sh
PrivateTmp=yes
Type=simple
EnvironmentFile=/etc/environment
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

View file

@ -2,15 +2,16 @@
set -e
cd /tmp
cd /var/lib/labsync
rm -f "$LABSYNC_SQUASHFS_FILE"
ln -s "$LABSYNC_SQUASHFS_LV" "$LABSYNC_SQUASHFS_FILE"
exec aria2c \
--allow-overwrite \
--check-integrity \
--seed-ratio=0.0 \
--summary-interval=60 \
--file-allocation=none \
--enable-dht=false \
--force-save \
"$LABSYNC_TORRENT"

View file

@ -176,6 +176,7 @@ PARTTABLE
--summary-interval=0 \
--file-allocation=none \
--enable-dht=false \
--force-save \
/tmp/torrent
)
else
@ -201,6 +202,9 @@ PARTTABLE
echo $hostname > ${rootmnt}/etc/hostname
sed "s/@@HOSTNAME@@/$hostname/" ${rootmnt}/etc/hosts.template > ${rootmnt}/etc/hosts
mkdir -p ${rootmnt}/var/lib/labsync
cp /tmp/torrent.aria2 ${rootmnt}/var/lib/labsync
if [ -z "$labsync_localboot" ]; then
labsync_set_environment LABSYNC "$torrent_name"
labsync_set_environment LABSYNC_TORRENT "${labsync_torrent}"