Closed Magisdn closed 1 year ago
So the problem was the missing ssh
binary ? You can use the INSTALL_PACKAGES
variable to automatically install the required package. See https://github.com/jlesage/docker-jdownloader-2#environment-variables for more details.
Before that, I installed the ssh client in the container.
Ok, so using INSTALL_PACKAGES
fixes your problem ?
I installed the ssh slient after deploying the container and it didn't solve the problem.
So what is the problem once the ssh client is installed ?
In output.log
Thread[Executer: /bin/ash ERRstreamobserver,6,main]: /bin/ash: can't open 'ssh admin@192.168.1.1 "system resource print; quit"': No such file or directory
Ssh doesn't run from jdownloader, but it runs manually from the container shell.
In the script, did you try to use the full path to the ssh binary (e.g. /usr/bin/ssh
) ?
1699710373323_Sat, Nov 11, 2023 13.46 +0000/jd.gui.swing.jdgui.views.settings.panels.reconnect.ReconnectDialog$1.log.0: /bin/ash: can't open '/usr/bin/ssh admin@192.168.1.1 "system resource print; quit"': No such file or directory
Use /bin/sh
as the interpreter. It worked for me.
From container shell manual run
/tmp $ ssh admin@192.168.1.1 "system resource print; quit"
uptime: 3d5h15m4s
version: 7.12 (stable)
build-time: Nov/09/2023 07:45:06
factory-software: 6.45.9
free-memory: 51.8MiB
total-memory: 128.0MiB
cpu: ARM
cpu-count: 4
cpu-frequency: 672MHz
cpu-load: 4%
free-hdd-space: 1116.0KiB
total-hdd-space: 15.2MiB
write-sect-since-reboot: 6777
write-sect-total: 228308
architecture-name: arm
board-name: hAP ac^2
platform: MikroTik
interrupted
/tmp $
Mikrotik log
Nov/14/2023 22:04:06 user admin logged in from 192.168.1.7 via ssh
Nov/14/2023 22:04:07 user admin logged out from 192.168.1.7 via ssh
But in the jdownloader log after pressing the Test button
1699988999373_Tue, Nov 14, 2023 19.09 +0000/jd.gui.swing.jdgui.views.settings.panels.reconnect.ReconnectDialog$1.log.0: /bin/sh: can't open '/usr/bin/ssh admin@192.168.1.1 "system resource print; quit"': No such file or directory
Looks like there is a bug in JD... or at least on Linux the way the content of "batch script" is used doesn't work well. The content is passed as a single parameter to the interpreter.
I would suggest that you instead put your command in a file. For example, in /config/reconnect.sh
:
#!/bin/sh
/usr/bin/ssh admin@192.168.1.1 "system resource print; quit"
Then, in JD, put this in batch script:
/config/reconnect.sh
/config/reconnect.sh
It won't start at all. Not found in the logs
./config/reconnect.sh
1700076373524_Wed, Nov 15, 2023 19.26 +0000/jd.gui.swing.jdgui.views.settings.panels.reconnect.ReconnectDialog$1.log.0: /bin/sh: can't open './config/reconnect.sh': No such file or directory
1700076373524_Wed, Nov 15, 2023 19.26 +0000/jd.gui.swing.jdgui.views.settings.panels.reconnect.ReconnectDialog$1.log.0: /bin/sh: can't open 'ls': No such file or directory
Any command fails to start.
'./config/reconnect.sh': No such file or directory
It should be an absolute path, without an initial dot (/config/reconnect.sh
instead of ./config/reconnect.sh
).
/config/reconnect.sh
It won't start at all. Not found in the logs
According to the log you provided, ./config/reconnect.sh
was specified in JD under "Batch Script", instead of /config/reconnect.sh
.
It should look like this:
If you want to manually execute the script, you can do:
/bin/sh /config/reconnect.sh
I changed the jd interface back to English and the reconnect started working. Miracle :)
Current Behavior
Hi! Jdownloader does not run the reconnect script Reconnect should work by running the command
ssh admin@192.168.1.1 'system script run reconnect; quit'
(reconnect for microtik router)I output.log
Thread[Executer: /bin/ash ERRstreamobserver,6,main]: /bin/ash: can't open 'ssh admin@192.168.1.1 "system resource print; quit"': No such file or directory
If you install openssh client, set up key authorization between container and router from user app, then the command
ssh admin@192.168.1.1 'system script run reconnect; quit'
runs fine.Expected Behavior
Running the reconnect script and changing the IP.
Steps To Reproduce
Settings -> Reconnect -> Reconnect method External batch Reconnect /bin/ash ssh admin@192.168.1.1 'system script run reconnect'
Environment
Container creation
The compose file used.
Container log
Container inspect
Anything else?
No response