Discussion:
dhcrelay prints these logs and doesn't live normally. [Can't initialize context: not enough free resources.]
박기당
2021-05-26 00:52:28 UTC
Permalink
thanks for reply Glenn.Sounds like you don't have enough free memory for it to run. Try running "free -h" to see if you have enough memory available. You may need to shut down some other services first. -> my system free memory status is normal.MemTotal: 1027004 kB MemFree: 236040 kB Buffers: 0 kB Cached: 278888 kB SwapCached: 0 kB Active: 469624 kB Inactive: 192112 kB Active(anon): 382848 kB Inactive(anon): 0 kB Active(file): 86776 kB Inactive(file): 192112 kB Unevictable: 0 kB Mlocked: 0 kB HighTotal: 262144 kB HighFree: 508 kB LowTotal: 764860 kB LowFree: 235532 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 382944 kB Mapped: 94932 kB Shmem: 0 kB Slab: 19808 kB SReclaimable: 8604 kB SUnreclaim: 11204 kB KernelStack: 2392 kB PageTables: 3196 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 513500 kB Committed_AS: 987128 kB VmallocTotal: 245760 kB VmallocUsed: 53120 kB VmallocChunk: 159676 kB Secondly be sure you are running as root, it may be getting a permission denied message from some underlying system call.-> what does mean??
dhcrelay: Can't initialize context: not enough free resource ->opensocket function is return ISC_R_NORESOURCES. (bind/bind-9.9.5/lib/isc/unix/socket.c)I think it's the fd problem with the socket, but I don't know when it happens.
Thanks.
g***@uniq.com.au
2021-05-26 06:54:39 UTC
Permalink
Yeah, the free memory looks completely ok, so that's not it.

Do you by chance have dhcpd also running on the same system? I don't
believe you can have both dhcpd and dhcrelay trying to open the socket
on the same interface. So if you have both then each needs to listen on
different interfaces.

Failing that perhaps looking at the source might give some hints. Do you
have any limits on open files for example. ulimit -n will show the
permitted number of open files, which includes sockets.

regards,
Glenn
Post by 박기당
thanks for reply Glenn.
Sounds like you don't have enough free memory for it to run. Try
running
"free -h" to see if you have enough memory available. You may need to
shut down some other services first.
-> my system free memory status is normal.
MemTotal: 1027004 kB
MemFree: 236040 kB
Buffers: 0 kB
Cached: 278888 kB
SwapCached: 0 kB
Active: 469624 kB
Inactive: 192112 kB
Active(anon): 382848 kB
Inactive(anon): 0 kB
Active(file): 86776 kB
Inactive(file): 192112 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 262144 kB
HighFree: 508 kB
LowTotal: 764860 kB
LowFree: 235532 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 382944 kB
Mapped: 94932 kB
Shmem: 0 kB
Slab: 19808 kB
SReclaimable: 8604 kB
SUnreclaim: 11204 kB
KernelStack: 2392 kB
PageTables: 3196 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 513500 kB
Committed_AS: 987128 kB
VmallocTotal: 245760 kB
VmallocUsed: 53120 kB
VmallocChunk: 159676 kB
Secondly be sure you are running as root, it may be getting a
permission
denied message from some underlying system call.
-> what does mean??
dhcrelay: Can't initialize context: not enough free resource
->opensocket function is return ISC_R_NORESOURCES.
(bind/bind-9.9.5/lib/isc/unix/socket.c)
I think it's the fd problem with the socket, but I don't know when it
happens.
Thanks.
_______________________________________________
ISC funds the development of this software with paid support
subscriptions. Contact us at https://www.isc.org/contact/ for more
information.
dhcp-users mailing list
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-***@lists.isc.org
https://lists.is
박기당
2021-05-28 03:17:22 UTC
Permalink
thanks for reply Glenn.Both dhcpd and dhcrelay can be run on one system, but only dhcrelay is currently used.
In addition, dhcrelay was well run and restarted, but logs occurred, and the restart failed continuously. The restart process is as follows.
kill -9 xxx; /usr/sbin/dhcrelay -i vlan200 A.B.C.D -i vlan100

The result of ulimit-n is 1024.
ISC_R_NORESOURCES is returned to its location: bind/bind-9.9.5/lib/isc/unix/socket.c.
The problem is when the fd value of the socket is greater than 1024, and when the fd value of the socket is less than 0.
I think the fd value is less than zero, what is the situation? It's not easy to reproduce.
regards, pkd
g***@uniq.com.au
2021-05-29 11:42:44 UTC
Permalink
hi pkd

kill -9 kills the process and it does not allow it to do any cleanup
such as deleting pid files and the like. A normal kill without -9 should
work just fine.

What platform is this running on, and what operating system (centos,
ubuntu, etc) and version? Did you compile from source yourself or use a
provided package? If you compiled yourself, maybe try a newer version?
This looks like it is dhcp-4.2.x, which is

Do you get this error every time you run dhcrelay, or only sometimes?

Do you get the error if you remove one of the interfaces? eg
/usr/sbin/dhcrelay -i vlan200 A.B.C.D
or
/usr/sbin/dhcrelay -i vlan100 A.B.C.D

That might mean the other interface is incorrectly configured.

If it's always can you put a sleep, eg kill; sleep 2; dhcrelay ...
between the kill and the startup to allow time for the old executables,
etc, to be released?

And finally the last test I can think of is to run using strace, eg:

kill <dhcrelay-pid>
strace /usr/sbin/dhcrelay -i vlan200 -i vlan100 A.B.C.D

and look at the system calls to see if there is something that happens
before the final error is printed that might suggest what the underlying
error is.

regards,
Glenn
Post by 박기당
thanks for reply Glenn.
Both dhcpd and dhcrelay can be run on one system, but only dhcrelay is
currently used.
In addition, dhcrelay was well run and restarted, but logs occurred,
and the restart failed continuously. The restart process is as
follows.
kill -9 xxx; /usr/sbin/dhcrelay -i vlan200 A.B.C.D -i vlan100
The result of ulimit-n is 1024.
bind/bind-9.9.5/lib/isc/unix/socket.c.
The problem is when the fd value of the socket is greater than 1024,
and when the fd value of the socket is less than 0.
I think the fd value is less than zero, what is the situation? It's not easy to reproduce.
regards,
pkd
_______________________________________________
ISC funds the development of this software with paid support
subscriptions. Contact us at https://www.isc.org/contact/ for more
information.
dhcp-users mailing list
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-***@lists.isc.org
https://lists.isc.org/mailman/listin
박기당
2021-05-31 05:59:50 UTC
Permalink
hi, Glenn.

How do I terminate to clean up without killi -9?
It compiles dhcp-4.2.6 and operates on embedded target systems.
dhcrelay is being restarted when the address of the interface associated with dhcrelay is added or deleted.
And I've never seen such an error before, and it's not reproduced afterwards, so I don't know if it's meaningful to apply strace.
I always kill dhcrelay and run it again two seconds later.

regards,
pkd.
g***@uniq.com.au
2021-05-31 06:38:36 UTC
Permalink
hi pkd,

So you're saying this only happens sometimes and it is not predictable
when it may or may not work?

Instead of "kill -9 <pid>" use "kill <pid>" where <pid> is replaced by
the process id number. The default is usually -15 (Terminate)

regards,
Glenn
Post by 박기당
hi, Glenn.
How do I terminate to clean up without killi -9?
It compiles dhcp-4.2.6 and operates on embedded target systems.
dhcrelay is being restarted when the address of the interface
associated with dhcrelay is added or deleted.
And I've never seen such an error before, and it's not reproduced
afterwards, so I don't know if it's meaningful to apply strace.
I always kill dhcrelay and run it again two seconds later.
regards,
pkd.
_______________________________________________
ISC funds the development of this software with paid support
subscriptions. Contact us at https://www.isc.org/contact/ for more
information.
dhcp-users mailing list
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-***@lists.isc.org
htt

Loading...