Jump to content

Question

Posted (edited)

Всем доброго дня.

Имеется роутер Keenetic Giga III EAEU с версией ПО 5.2 Alpha 7

Установлен OPKG во внутреннюю память.

Настроен proxy.

После перезагрузки, сам скрипт не стартует, приходиться подключаться по SSH

Далее exec sh и запуск моего скрипта startproxy (линк)

 

Скрипт с именем: S100startproxy расположен в директории: /opt/etc/init.d

Содержимое: 

#!/bin/sh
exec sh -c "/opt/bin/startproxy"

 

В самом startproxy

#!/bin/sh
/opt/bin/python3 /opt/mtprotoproxy/mtprotoproxy.py > /dev/null 2>&1 &

 

В логах после перезагрузки:

Спойлер
Opkg::Manager: missing initrc "/opt/etc/initrc": no such file or directory, trying default one (/opt/etc/init.d/).
Сен 1 20:40:55
ndm
Process: "/opt/bin/sh" executable not found.
Сен 1 20:40:55
ndm
Process: unable to create and initialize "Opkg shell" process.
Сен 1 20:40:55
ndm
Io::Process: "Opkg shell" is broken.
Сен 1 20:40:55
ndm
Opkg::Manager: process /opt/etc/init.d/S100startproxy: failed to start.
Сен 1 20:40:55
ndm
Process: "/opt/bin/sh" executable not found.
Сен 1 20:40:55
ndm
Process: unable to create and initialize "Opkg shell" process.
Сен 1 20:40:55
kernel
hw_nat: MediaTek HW NAT module v5.0.7.0-23 loaded, FoE size: 16384, AG pairs: 31
Сен 1 20:40:55
ndm
Io::Process: "Opkg shell" is broken.
Сен 1 20:40:55
ndm
Opkg::Manager: process /opt/etc/init.d/doinstall: failed to start.

 

Edited by srs
Добавление лога

4 answers to this question

Recommended Posts

  • 0
Posted

зачем такие сложности с двумя скриптами?

полагаю ломается на этом: exec sh -c "/opt/bin/startproxy"

попробовать указать полный путь до sh и, как минимум, ввод-вывод перенаправить в /dev/null

 

  • 0
Posted

Сделал так:

/opt/etc/init.d/S100startproxy

Содержимое:

 

#!/bin/sh
while [ ! -x /opt/bin/sh ]; do
    sleep 2
done
sleep 10
/bin/sh -c "/opt/bin/sh /opt/bin/startproxy" > /dev/null 2>&1 &

Дал права: 

chmod +x /opt/etc/init.d/S100startproxy

Всё равно не стартует, в ручную стартует(

 

  • 0
Posted
4 часа назад, srs сказал:

/bin/sh -c "/opt/bin/sh

это тут зачем, удали

  • 0
Posted

Что ни делаю, не стартует автоматом(

В идеале, мне нужно чтобы запускалась данная команда.

/opt/bin/python3 /opt/mt/proxy.py > /dev/null 2>&1 &

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies. By clicking "I accept" or continuing to browse the site, you authorize their use in accordance with the Privacy Policy.