Uhttpd install

Device suddenly can't not log into luci but ssh still work, tried to force reinstall luci but failed

root@iStoreOS:~# opkg install luci
Installing luci (git-23.093.42303-d58cd69) to root...
Downloading https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.4/packages/x86_64/luci/luci_git-23.093.42303-d58cd69_all.ipk
Installing uhttpd (2022-10-31-23977554-2) to root...
Collected errors:
 * opkg_download_pkg: Package uhttpd is not available from any configured src.
 * opkg_install_pkg: Failed to download uhttpd. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package luci.

now uhttpd is gone as well

root@iStoreOS:~# /etc/init.d/uhttpd restart
-ash: /etc/init.d/uhttpd: not found

I tried to search how to reinstall uhttpd and no luck, seems official repository doesn't contain uhttpd anymore.
Any thoughts? Or I have to reinstall the whole system? Thanks.

Did you ???

Yes, I did, thanks for the input.

It appears you are using firmware that is not from the official OpenWrt project.

When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).

If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.

Curiously, your package database seems to assume that there version "-2" of uhttpd from that date. The 22.03 download for contains only version 1.

uhttpd_2022-10-31-23977554-1_x86_64.ipk

You could manually download the .ipk to /tmp in router, install it with opkg, and see if that helps.

1 Like

Thanks, that was what I was asking. After reboot it is running in the service.
But I still don't see port 80 being listening.

root@iStoreOS:~# netstat -anl 
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 127.0.0.1:5234          0.0.0.0:*               LISTEN      
tcp        0      0 100.104.210.112:53      0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      
tcp        0      0 192.168.66.26:53        0.0.0.0:*               LISTEN      
tcp        0      0 172.17.0.1:53           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
tcp        0      0 192.168.66.26:445       0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:3038          0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:7681            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:6789            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:32777           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:32778           0.0.0.0:*               LISTEN      
tcp        0      0 100.104.210.112:38187   0.0.0.0:*               LISTEN      
tcp        0      0 192.168.66.26:139       0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:32780           0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:5037          0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      
tcp        0      0 192.168.66.26:33092     34.229.201.48:443       ESTABLISHED 
tcp        0      0 127.0.0.1:5037          127.0.0.1:37658         ESTABLISHED 
tcp        0      0 192.168.66.26:50390     3.74.105.242:443        ESTABLISHED 
tcp        0      0 192.168.66.26:55576     103.84.155.46:443       ESTABLISHED 
tcp        0      0 127.0.0.1:37658         127.0.0.1:5037          ESTABLISHED 
tcp        0  17568 192.168.66.26:22        100.98.94.115:51870     ESTABLISHED 
tcp        0      0 :::5233                 :::*                    LISTEN      
tcp        0      0 fd7a:115c:a1e0:ab12:4843:cd96:6268:d270:53 :::*                    LISTEN      
tcp        0      0 fe80::edbf:dc1c:49eb:7d34:53 :::*                    LISTEN      
tcp        0      0 ::1:53                  :::*                    LISTEN      
tcp        0      0 fd6e:19c5:d9c2::1:53    :::*                    LISTEN      
tcp        0      0 fe80::11:32ff:fe21:8e70:53 :::*                    LISTEN      
tcp        0      0 :::22                   :::*                    LISTEN      
tcp        0      0 fd6e:19c5:d9c2::1:445   :::*                    LISTEN      
tcp        0      0 :::8897                 :::*                    LISTEN      
tcp        0      0 :::2049                 :::*                    LISTEN      
tcp        0      0 :::6789                 :::*                    LISTEN      
tcp        0      0 :::32777                :::*                    LISTEN      
tcp        0      0 :::32778                :::*                    LISTEN      
tcp        0      0 fd7a:115c:a1e0:ab12:4843:cd96:6268:d270:38187 :::*                    LISTEN      
tcp        0      0 fd6e:19c5:d9c2::1:139   :::*                    LISTEN      
tcp        0      0 :::32780                :::*                    LISTEN      
tcp        0      0 :::111                  :::*                    LISTEN      
udp        0      0 0.0.0.0:41641           0.0.0.0:*                           
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           
udp        0      0 127.0.0.1:986           0.0.0.0:*                           
udp        0      0 0.0.0.0:32777           0.0.0.0:*                           
udp        0      0 0.0.0.0:32778           0.0.0.0:*                           
udp        0      0 0.0.0.0:32780           0.0.0.0:*                           
udp        0      0 100.104.210.112:53      0.0.0.0:*                           
udp        0      0 127.0.0.1:53            0.0.0.0:*                           
udp        0      0 192.168.66.26:53        0.0.0.0:*                           
udp        0      0 172.17.0.1:53           0.0.0.0:*                           
udp        0      0 0.0.0.0:111             0.0.0.0:*                           
udp        0      0 192.168.66.255:137      0.0.0.0:*                           
udp        0      0 192.168.66.26:137       0.0.0.0:*                           
udp        0      0 0.0.0.0:137             0.0.0.0:*                           
udp        0      0 0.0.0.0:58505           0.0.0.0:*                           
udp        0      0 192.168.66.255:138      0.0.0.0:*                           
udp        0      0 192.168.66.26:138       0.0.0.0:*                           
udp        0      0 0.0.0.0:138             0.0.0.0:*                           
udp        0      0 :::41641                :::*                                
udp        0      0 :::5353                 :::*                                
udp        0      0 :::63820                :::*                                
udp        0      0 :::32777                :::*                                
udp        0      0 :::32778                :::*                                
udp        0      0 :::32780                :::*                                
udp        0      0 fd7a:115c:a1e0:ab12:4843:cd96:6268:d270:53 :::*                                
udp        0      0 fe80::edbf:dc1c:49eb:7d34:53 :::*                                
udp        0      0 ::1:53                  :::*                                
udp        0      0 fd6e:19c5:d9c2::1:53    :::*                                
udp        0      0 fe80::11:32ff:fe21:8e70:53 :::*                                
udp        0      0 :::111                  :::*                                
raw        0      0 0.0.0.0:17              0.0.0.0:*               17          
raw        0      0 ::%1881168640:17        :::*                    17  

Any idea? Thanks.

Is the process there ?

1 Like

Thanks for reminding me, when I reboot and check it right away it shows

/etc/init.d/uhttpd                 enabled         running

and now it shows

/etc/init.d/uhttpd                 enabled         stopped

Any idea how I can address the problem? Thanks.

So it dies, check dmesg, but I would guess it's a conf issue, like missing dirs or perhaps package dependencies.

Check the system log with logread, hopefully it shows some explanation.
Possibly a crash?

Then it is a question of reason...
Something in your uhttpd config?
Binary incompatibility, especially if if you downloaded the package from a different site than your firmware.

Try to execute the binary from os, w/o any params, see if it even starts.

I install the uhttpd with

--force-maintainer 
--force-reinstall  
--force-overwrite 

So I assume the uhttpd config is by default right now?

how can I read the log with logread while it is running? I am pretty new to this, appreciate your help.

"logread" is the command to read the log from ssh console. Just type it from ssh and see if there is anything about uhttpd.

("dmesg" would be the command for kernel log)

How can I execute what you said? Do you mean?

/firstboot

firstboot will reset your device.

Just type uhttpd (or uhttpd).

Error: No sockets bound, unable to continue

That's what I got.
And I looked up on the internet and tried

uhttpd -p 80 -h /www

And I can logged into luci for now.
What am I missing?

# Server configuration
config uhttpd main
	list listen_http	0.0.0.0:80
	list listen_http	[::]:80
	list listen_https	0.0.0.0:443
	list listen_https	[::]:443
	option redirect_https	0
	option home		/www
	option rfc1918_filter 1
	option max_requests 3
	option max_connections 100
	option cert		/etc/uhttpd.crt
	option key		/etc/uhttpd.key
	option cgi_prefix	/cgi-bin
	list lua_prefix		"/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua"
	option script_timeout	60
	option network_timeout	30
	option http_keepalive	20
        option tcp_keepalive	1
        option days		730
	option key_type		ec
	option bits		2048
	option ec_curve		P-256
	option country		ZZ
	option state		Somewhere
	option location		Unknown
	option commonname	'OpenWrt'

That's what I got from

/etc/config/uhttpd

Any idea? Thanks