Jump to content

Question

Posted

Проверял на Ultra KN-1810 (mipsel). 5.2 Бета 2

Проблема:

ndm добавляет в конфигурацию nginx `listen` на настроенный адрес интерфейса, не проверяя, что адрес есть в ядре. Если адреса нет, nginx при запуске завершается с `bind() failed (126)`, ndm запускает его снова с тем же конфигом, и так по кругу. Пока запись интерфейса на месте без адреса, веб-интерфейс и RCI на `127.0.0.1:79` не отвечают. Один интерфейс лишает управления роутером.Сторонних программ в Entware нет, воспроизвести можно:
 

ndmc -c "interface OpkgTun9"
ndmc -c "interface OpkgTun9 security-level private"
ndmc -c "interface OpkgTun9 ip address 172.31.99.1 255.255.255.252"
ndmc -c "interface OpkgTun9 ip global auto"
ndmc -c "interface OpkgTun9 up"
sleep 20
grep -c 172.31.99.1 /tmp/nginx/nginx.conf       
ip addr del 172.31.99.1/30 dev opkgtun9          
kill -TERM $(cat /tmp/nginx/nginx.pid)           
sleep 20
ndmc -c "show log" | grep -E 'bind\(\)|"Nginx"'


`kill -HUP` при снятом адресе и reload не проходит (`[emerg] bind()`)
остановка nginx при снятом адресе и nginx не запускается, перезапуск каждые 3–4 с 
`no interface OpkgTun9` и nginx запустился в пределах 5 с 

Журнал:


[emerg] bind() to 172.31.99.1:80 failed (126: Address not available)
E ndm: Service: "Nginx": unexpectedly stopped.


 Чего бы хотелось

- `listen` только по адресам, которые есть в ядре, либо разрешить не делать bind на OpkgTun/Proxy или вообще выбирать эти интерфейсы. 
- Можно делать конечно  `net.ipv4.ip_nonlocal_bind=1` и `net.ipv6.ip_nonlocal_bind=1`: nginx с ними запускался. 
- Не давать одному `listen` на необязательном интерфейсе останавливать весь веб-сервер и RCI и запускать nginx без него.

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.