From f96c661e27523766b825675219194187f9f47c05 Mon Sep 17 00:00:00 2001 From: Hostkit Date: Sun, 17 Jul 2016 04:46:14 +0700 Subject: [PATCH] aria2: add log add aria2.log and replace logger -t ARIA2C 'Restarting aria2s service' with logger -t ARIA2C 'Restarting aria2c service' :D :p Signed-off-by: Hsing-Wang Liao --- net/aria2/files/aria2.init | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/aria2/files/aria2.init b/net/aria2/files/aria2.init index 9d17f4d05..ab5a0e6b0 100755 --- a/net/aria2/files/aria2.init +++ b/net/aria2/files/aria2.init @@ -42,16 +42,24 @@ start_instance() { config_file="$config_dir/aria2.conf" session_file="$config_dir/aria2.session" dht_file="$config_dir/dht.dat" + log_file="$config_dir/aria2.log" + [ -d "$config_dir" ] || { mkdir -m 0755 -p "$config_dir" touch "$config_file" [ -z "$user" ] || chown -R $user $config_dir } + touch "$session_file" echo -e "enable-rpc=true\nrpc-allow-origin-all=true\nrpc-listen-all=true\nquiet=true" > $config_file echo -e "continue=true\ninput-file=$session_file\nsave-session=$session_file" >> $config_file + option_disabled "$s" 'enable_dht' || echo "dht-file-path=$dht_file" >> $config_file + option_disabled "$s" 'enable_log' || { + touch "$log_file" + echo -e "log=$log_file" >> $config_file + } append_params "$s" \ file_allocation bt_enable_lpd enable_dht rpc_user rpc_passwd rpc_listen_port dir bt_tracker disk_cache \ @@ -85,7 +93,7 @@ stop() { } restart() { - logger -t ARIA2C 'Restarting aria2s service' + logger -t ARIA2C 'Restarting aria2c service' stop sleep 2 # give time to shutdown start