shiningw / ncdownloader

An easy-to-use web interface for Aria2 and Youtube-dl (downloading bittorrents, videos from twitter, youtube and the likes)运行在nextcloud下的多功能下载工具(Aria2 and youtube-dl)
GNU Affero General Public License v3.0
93 stars 29 forks source link

Aria2c is not running - how to autostart builtin aria2c #71

Closed tquest1 closed 2 years ago

tquest1 commented 2 years ago

It's been asked before but an explicit solution was not given. How can we make sure that the builtin aria2c that is included in the app is automatically started on server reboot.

Our server shuts down & restarts for backups & then our users can't use ncdownloader because they are not admin users & can't start aria2 from the gui. Is there anyway this can be scripted - maybe with a systemd file. Ideally a feature could be added to the app's config for this. I imagine almost everyone would require that aria2 runs on boot.

shiningw commented 2 years ago

Hi, You can try this patch


index 7d5bf0f..734e05c 100644
--- a/lib/Controller/MainController.php
+++ b/lib/Controller/MainController.php
@@ -88,7 +88,8 @@ class MainController extends Controller
                 array_push($errors, sprintf("aria2 is installed but don't have the right permissions.Please execute command sudo chmod 755 %s", $aria2_bin));
             }
             if (!$params['aria2_running']) {
-                array_push($errors, $this->l10n->t("Aria2c is not running!"));
+               // array_push($errors, $this->l10n->t("Aria2c is not running!"));
+               $this->aria2->start();
             }
         }
         if ($youtube_installed && (!$youtube_executable || !@is_readable($youtube_bin))) {`
tquest1 commented 2 years ago

Thanks - works great!

afzl-wtu commented 2 years ago

Hi, You can try this patch

index 7d5bf0f..734e05c 100644
--- a/lib/Controller/MainController.php
+++ b/lib/Controller/MainController.php
@@ -88,7 +88,8 @@ class MainController extends Controller
                 array_push($errors, sprintf("aria2 is installed but don't have the right permissions.Please execute command sudo chmod 755 %s", $aria2_bin));
             }
             if (!$params['aria2_running']) {
-                array_push($errors, $this->l10n->t("Aria2c is not running!"));
+               // array_push($errors, $this->l10n->t("Aria2c is not running!"));
+               $this->aria2->start();
             }
         }
         if ($youtube_installed && (!$youtube_executable || !@is_readable($youtube_bin))) {`

How to apply this patch. which and where this file lives?