Skip to content

Instantly share code, notes, and snippets.

@likebeta likebeta/aria2.conf
Last active Sep 5, 2015

Embed
What would you like to do?
dir=/home/nas/download
disable-ipv6=true
daemon=true
disk-cache=32M
enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true
max-concurrent-downloads=1
max-connection-per-server=10
min-split-size=10M
split=10
max-overall-download-limit=0
max-download-limit=0
max-overall-upload-limit=0
max-upload-limit=0
save-session=/home/nas/.aria2/aria2.session
save-session-interval=60
force-save=false
continue=true
input-file=/home/nas/.aria2/aria2.session
log=/home/nas/.aria2/aria2.log
log-level=warn
#rpc-secret=secret
#rpc-user=user
#rpc-passwd=passwd
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Aria2 Downloader
### END INIT INFO
case "$1" in
start)
echo "Starting aria2c ..."
sudo -u nas aria2c --conf-path=/home/nas/.aria2/aria2.conf -D
#sudo -u后面的是你正在使用的用户名,用debian的是nas(没改用户的话)
;;
stop)
echo "Shutting down aria2c ..."
killall aria2c
;;
restart)
killall aria2c
sleep 3
sudo -u nas aria2c --conf-path=/home/nas/.aria2/aria2.conf -D
#同上面的一样,根据自己的用户名改nas
;;
esac
exit
@likebeta

This comment has been minimized.

Copy link
Owner Author

likebeta commented Sep 5, 2015

然后设置这个文件的权限。
sudo chmod 755 /etc/init.d/aria2c

测试服务是否可以启动:
sudo service aria2c start

添加aria2c服务自动运行:
sudo update-rc.d aria2c defaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.