Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: polikuo on October 17, 2020, 01:50:57 AM
-
Hi, I'm not sure if this belongs in TCB or TCE issue. :-\
Since I'm using piCore beta release, it could be in there, too.
Anyway, I have a relatively modern router: TP-LINK Mesh WDR7650
It refuses to assign an IP address to piCore from time to time.
Manually type
sudo pkill udhcpc
sudo udhcpc eth0
would start an endless request loop.
This behavior never happens on older routers.
A TCB busybox issue maybe ?
Not sure about the other architectures.
When I switch to Raspbian, the network is back to normal.
Then I see they're using a different DHCP client (https://roy.marples.name/projects/dhcpcd/).
I download the source and compile it.
Using this client, I manage to resolve the network problem.
If I were to submit this extension, what value should I choose for "--localstatedir" in configure ?
The default path is /var (It creates empty directory /var/db/dhcpcd for later use)
Should I use /usr/local/var instead ?
-
Please use /var
-
Please use /var
Hi, before I submit the thing.
There's an option, "--privsepuser", in the configure script.
The default value is "dhcpcd".
When you start the client, it returns: [no such user dhcpcd]
CFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe' LDFLAGS='-Wl,-O1' ./configure --prefix='/usr/local' --libexecdir='/usr/local/lib/dhcpcd'
tc@box:~$ sudo /tmp/dhcpcd/usr/local/sbin/dhcpcd
no such user dhcpcd
main: control_open: Connection refused
dhcpcd-9.3.1 starting
DUID 00:01:00:01:27:1d:77:30:dc:a6:32:37:c7:eb
eth0: IAID 32:37:c7:eb
eth0: rebinding lease of 192.168.0.101
eth0: leased 192.168.0.101 for 7200 seconds
eth0: adding route to 192.168.0.0/24
eth0: adding default route via 192.168.0.1
forked to background, child pid 9294
tc@box:~$
The process is forked to background.
I recompiled with "--privsepuser=tc":
CFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe' LDFLAGS='-Wl,-O1' ./configure --prefix='/usr/local' --libexecdir='/usr/local/lib/dhcpcd' --privsepuser='tc'
tc@box:~$ sudo /tmp/usrtc/usr/local/sbin/dhcpcd
dhcpcd-9.3.1 starting
DUID 00:01:00:01:27:1d:77:30:dc:a6:32:37:c7:eb
eth0: IAID 32:37:c7:eb
ps_ctl_listen: read: Success
The process is NOT backgrounded.
The console hangs.
Does it has anything to do with openssh "sshd privsep" ?
I think I've seen it somewhere.
What should I do ?
Please advice.
-
Hi polikuo
If you look at at /etc/init.d/dhcp.sh you'll see that Roberts included this at the end of his command:
/dev/null 2>&1 &
-
Hi polikuo
Hi, I'm not sure if this belongs in TCB or TCE issue. :-\
Since I'm using piCore beta release, it could be in there, too.
Since it's part of busybox TCB Bugs sounds appropriate. If you find only piCore Beta is affected, it can be moved later on.
-
Normally privesep needs to point to a user with no login shell.
Use “nobody”.
-
/dev/null 2>&1 &
Sure, I know that it's forked, but if the router assigns an IP, udhcpc will background itself.
Try it yourself, kill the running udhcp, then start it again without '&'
tc@box:~$ sudo udhcpc
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.0.101
udhcpc: lease of 192.168.0.101 obtained, lease time 7200
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.1.1
adding dns 192.168.0.1
tc@box:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=115 time=11.945 ms
64 bytes from 8.8.8.8: seq=1 ttl=115 time=8.994 ms
64 bytes from 8.8.8.8: seq=2 ttl=115 time=9.137 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 8.994/10.025/11.945 ms
-
Normally privesep needs to point to a user with no login shell.
Use “nobody”.
I think it's working ?
root@box:~# pkill udhcpc
root@box:~# dhcpcd
refusing chroot: nobody: /nonexistent
dhcpcd-9.3.1 starting
DUID 00:01:00:01:27:1d:a7:f6:dc:a6:32:37:c7:eb
eth0: IAID 32:37:c7:eb
eth0: soliciting a DHCP lease
eth0: offered 192.168.0.101 from 192.168.0.1
eth0: leased 192.168.0.101 for 7200 seconds
eth0: adding route to 192.168.0.0/24
eth0: adding default route via 192.168.0.1
forked to background, child pid 6774
root@box:~# ifconfig
eth0 Link encap:Ethernet HWaddr DC:A6:32:37:C7:EB
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:251 errors:0 dropped:0 overruns:0 frame:0
TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19725 (19.2 KiB) TX bytes:5996 (5.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:200 (200.0 B) TX bytes:200 (200.0 B)
root@box:~# ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=115 time=11.520 ms
64 bytes from 8.8.8.8: seq=1 ttl=115 time=10.977 ms
64 bytes from 8.8.8.8: seq=2 ttl=115 time=11.002 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 10.977/11.166/11.520 ms
root@box:~#
If you think my configs are OK, then I'll mail it.
-
I might have steered you wrong. Looking at the source https://roy.marples.name/cgit/dhcpcd.git/tree/src/privsep.c#n85
That printed message would mean in init error. Looks like it needs a user that can spawn a chroot environment. The requirements are not clear.
-
For busybox bugs, since bb is easy to build, you could try git busybox, and if it still happens report a bug to them.
-
I might have steered you wrong. Looking at the source https://roy.marples.name/cgit/dhcpcd.git/tree/src/privsep.c#n85
That printed message would mean in init error. Looks like it needs a user that can spawn a chroot environment. The requirements are not clear.
I have no idea what privesep do, but I found this on LFS (http://www.linuxfromscratch.org/blfs/view/svn/basicnet/dhcpcd.html)
Have a look at the Installation of dhcpcd section
Do you know what they're doing there ? (groupadd, useradd, chown)
Does 'nobody' meets the requirement ?
On the other hand, I can just '--disable-privsep' when configuring and forget about it altogether :P