|
|
Hi experts I am using dhcpclient and dhcpd 4.3.4 I am testing reboot time in my system. I do not have much knowledge about dhcpclient and dhcpd apps.
I see that dhcpclient and dhcpd do not stop on sigterm signal. when systemd starts system shutdown, it send sigterm to all apps including dhcpclient and dhcpd.i see that these two apps do not stop. after 90 sec systemd sends sigkill and then these apps gets killed.
Is this a bug in 4.3.4 version ? is this fixed in latest version ? if not, what is the work-around for this issue ?
strace and systemd service files are below
Thanks for you help Regards
strace:
root@re:~# /usr/bin/strace
-ttT -s 100 -ff -p `pidof dhclient`
/usr/bin/strace: Process
21228 attached
02:29:42.167613
futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be
restarted if SA_RESTART is set) <20.048539>
02:30:02.216314 --- SIGCONT
{si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
02:30:02.216460
futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
02:31:32.310754 +++ killed by
SIGKILL +++
root@re:~#
++++
root@evo-ptx-h-re1:~# /usr/bin/strace
-ttT -s 100 -ff -p `pidof dhcpd`
/usr/bin/strace: Process
22040 attached with 4 threads
[pid 22046] 02:52:57.774430
futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22045] 02:52:57.774547
epoll_wait(5, <unfinished ...>
[pid 22044] 02:52:57.774560
futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22040] 02:52:57.774570
futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22046] 02:53:03.351769
<... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is
set) <5.577214>
[pid 22045] 02:53:03.351792
<... epoll_wait resumed> 0x7f54707a3010, 64, -1) = -1 EINTR (Interrupted
system call) <5.577239>
[pid 22044] 02:53:03.351952
<... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is
set) <5.577387>
[pid 22046] 02:53:03.351972
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
[pid 22040] 02:53:03.351992
<... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is
set) <5.577417>
[pid 22046] 02:53:03.352001
futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22045] 02:53:03.352016
epoll_wait(5, <unfinished ...>
[pid 22040] 02:53:03.352049
futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22044] 02:53:03.352142
futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 22046] 02:54:33.552465
+++ killed by SIGKILL +++
[pid 22045] 02:54:33.552485
+++ killed by SIGKILL +++
[pid 22044] 02:54:33.552494
+++ killed by SIGKILL +++
02:54:33.559654 +++ killed by
SIGKILL +++
root@evo-ptx-h-re1:~#
systemd service
files:
root@evo-ptx-h-re1:~# cat
/lib/systemd/system/dhclient.service
[Unit]
Description=Dynamic Host Configuration Protocol (DHCP)
[hidden email]
Before=ypbind.service
After=syslog.target network.target [hidden email]
[Service]
Type=forking
PIDFile=/var/run/dhclient.pid
EnvironmentFile=-/etc/default/dhcp-client
ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient.conf -q -lf
/var/lib/dhcp/dhclient.leases $INTERFACES
#ExecStart=/usr/bin/strace -ttT -s 100 -ff /sbin/dhclient -cf
/etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $INTERFACES
Restart=on-failure
RestartSec=1
[Install]
WantedBy=multi-user.target network-online.target
root@evo-ptx-h-re1:~# cat
/lib/systemd/system/dhcpd.service
[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
After=network.target
After=time-sync.target
[hidden email]
[hidden email]
[Service]
PIDFile=/var/run/dhcpd.pid
EnvironmentFile=/etc/default/dhcp-server
EnvironmentFile=-/etc/sysconfig/dhcp-server
ExecStartPre=/bin/touch /var/lib/dhcp/dhcpd.leases
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -pf
/var/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
[Install]
WantedBy=multi-user.target
root@evo-ptx-h-re1:~#
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
|
|
Hello,
This change may be relevant:
https://github.com/mirroring/dhcp/commit/0985d149c60754feb41b34221f292de60d1ee80bprashantkumar dhotre < [hidden email]> writes:
> Hi experts
>
> I am using dhcpclient and dhcpd 4.3.4
>
> I am testing reboot time in my system.
> I do not have much knowledge about dhcpclient and dhcpd apps.
>
> I see that dhcpclient and dhcpd do not stop on sigterm signal.
>
> when systemd starts system shutdown, it send sigterm to all apps including dhcpclient and dhcpd.i see that these two apps do not stop.
>
> after 90 sec systemd sends sigkill and then these apps gets killed.
>
> Is this a bug in 4.3.4 version ?
>
> is this fixed in latest version ?
>
> if not, what is the work-around for this issue ?
>
> strace and systemd service files are below
>
> Thanks for you help
>
> Regards
>
> strace:
>
> root@re:~# /usr/bin/strace -ttT -s 100 -ff -p `pidof dhclient`
>
> /usr/bin/strace: Process 21228 attached
>
> 02:29:42.167613 futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <20.048539>
>
> 02:30:02.216314 --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
>
> 02:30:02.216460 futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> 02:31:32.310754 +++ killed by SIGKILL +++
>
> root@re:~#
>
>
>
> ++++
>
> root@evo-ptx-h-re1:~# /usr/bin/strace -ttT -s 100 -ff -p `pidof dhcpd`
>
> /usr/bin/strace: Process 22040 attached with 4 threads
>
> [pid 22046] 02:52:57.774430 futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22045] 02:52:57.774547 epoll_wait(5, <unfinished ...>
>
> [pid 22044] 02:52:57.774560 futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22040] 02:52:57.774570 futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22046] 02:53:03.351769 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577214>
>
> [pid 22045] 02:53:03.351792 <... epoll_wait resumed> 0x7f54707a3010, 64, -1) = -1 EINTR (Interrupted system call) <5.577239>
>
> [pid 22044] 02:53:03.351952 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577387>
>
> [pid 22046] 02:53:03.351972 --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
>
> [pid 22040] 02:53:03.351992 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577417>
>
> [pid 22046] 02:53:03.352001 futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22045] 02:53:03.352016 epoll_wait(5, <unfinished ...>
>
> [pid 22040] 02:53:03.352049 futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22044] 02:53:03.352142 futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22046] 02:54:33.552465 +++ killed by SIGKILL +++
>
> [pid 22045] 02:54:33.552485 +++ killed by SIGKILL +++
>
> [pid 22044] 02:54:33.552494 +++ killed by SIGKILL +++
>
> 02:54:33.559654 +++ killed by SIGKILL +++
>
> root@evo-ptx-h-re1:~#
>
>
>
>
>
>
>
> systemd service files:
>
>
>
> root@evo-ptx-h-re1:~# cat /lib/systemd/system/dhclient.service
>
> [Unit]
>
> Description=Dynamic Host Configuration Protocol (DHCP)
>
> RequiresOverridable= [hidden email]
>
> Before=ypbind.service
>
> After=syslog.target network.target [hidden email]
>
>
>
> [Service]
>
> Type=forking
>
> PIDFile=/var/run/dhclient.pid
>
> EnvironmentFile=-/etc/default/dhcp-client
>
> ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $INTERFACES
>
> #ExecStart=/usr/bin/strace -ttT -s 100 -ff /sbin/dhclient -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $INTERFACES
>
> Restart=on-failure
>
> RestartSec=1
>
>
>
> [Install]
>
> WantedBy=multi-user.target network-online.target
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> root@evo-ptx-h-re1:~# cat /lib/systemd/system/dhcpd.service
>
> [Unit]
>
> Description=DHCPv4 Server Daemon
>
> Documentation=man:dhcpd(8) man:dhcpd.conf(5)
>
> After=network.target
>
> After=time-sync.target
>
> Wants= [hidden email]
>
> After= [hidden email]
>
>
>
> [Service]
>
> PIDFile=/var/run/dhcpd.pid
>
> EnvironmentFile=/etc/default/dhcp-server
>
> EnvironmentFile=-/etc/sysconfig/dhcp-server
>
> ExecStartPre=/bin/touch /var/lib/dhcp/dhcpd.leases
>
> ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
>
>
>
> [Install]
>
> WantedBy=multi-user.target
>
> root@evo-ptx-h-re1:~#
>
>
>
>
>
>
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users--
PAVEL ZHUKOV
SOFTWARE ENGINEER, RHCE, RHCVA
Red Hat
[hidden email] IM: IRC: landgraf
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
|
|
Thanks I did not understand. Is this a bug ? Is this issue fixed in latest release? Is there any work around in my version Hello,
This change may be relevant:
https://github.com/mirroring/dhcp/commit/0985d149c60754feb41b34221f292de60d1ee80b
prashantkumar dhotre <[hidden email]> writes:
> Hi experts
>
> I am using dhcpclient and dhcpd 4.3.4
>
> I am testing reboot time in my system.
> I do not have much knowledge about dhcpclient and dhcpd apps.
>
> I see that dhcpclient and dhcpd do not stop on sigterm signal.
>
> when systemd starts system shutdown, it send sigterm to all apps including dhcpclient and dhcpd.i see that these two apps do not stop.
>
> after 90 sec systemd sends sigkill and then these apps gets killed.
>
> Is this a bug in 4.3.4 version ?
>
> is this fixed in latest version ?
>
> if not, what is the work-around for this issue ?
>
> strace and systemd service files are below
>
> Thanks for you help
>
> Regards
>
> strace:
>
> root@re:~# /usr/bin/strace -ttT -s 100 -ff -p `pidof dhclient`
>
> /usr/bin/strace: Process 21228 attached
>
> 02:29:42.167613 futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <20.048539>
>
> 02:30:02.216314 --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
>
> 02:30:02.216460 futex(0x7ff92089c0cc, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> 02:31:32.310754 +++ killed by SIGKILL +++
>
> root@re:~#
>
>
>
> ++++
>
> root@evo-ptx-h-re1:~# /usr/bin/strace -ttT -s 100 -ff -p `pidof dhcpd`
>
> /usr/bin/strace: Process 22040 attached with 4 threads
>
> [pid 22046] 02:52:57.774430 futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22045] 02:52:57.774547 epoll_wait(5, <unfinished ...>
>
> [pid 22044] 02:52:57.774560 futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22040] 02:52:57.774570 futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22046] 02:53:03.351769 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577214>
>
> [pid 22045] 02:53:03.351792 <... epoll_wait resumed> 0x7f54707a3010, 64, -1) = -1 EINTR (Interrupted system call) <5.577239>
>
> [pid 22044] 02:53:03.351952 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577387>
>
> [pid 22046] 02:53:03.351972 --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
>
> [pid 22040] 02:53:03.351992 <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) <5.577417>
>
> [pid 22046] 02:53:03.352001 futex(0x7f54707a40a0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22045] 02:53:03.352016 epoll_wait(5, <unfinished ...>
>
> [pid 22040] 02:53:03.352049 futex(0x7f54707a00e0, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22044] 02:53:03.352142 futex(0x7f54707a10c8, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
>
> [pid 22046] 02:54:33.552465 +++ killed by SIGKILL +++
>
> [pid 22045] 02:54:33.552485 +++ killed by SIGKILL +++
>
> [pid 22044] 02:54:33.552494 +++ killed by SIGKILL +++
>
> 02:54:33.559654 +++ killed by SIGKILL +++
>
> root@evo-ptx-h-re1:~#
>
>
>
>
>
>
>
> systemd service files:
>
>
>
> root@evo-ptx-h-re1:~# cat /lib/systemd/system/dhclient.service
>
> [Unit]
>
> Description=Dynamic Host Configuration Protocol (DHCP)
>
> RequiresOverridable=[hidden email]
>
> Before=ypbind.service
>
> After=syslog.target network.target [hidden email]
>
>
>
> [Service]
>
> Type=forking
>
> PIDFile=/var/run/dhclient.pid
>
> EnvironmentFile=-/etc/default/dhcp-client
>
> ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $INTERFACES
>
> #ExecStart=/usr/bin/strace -ttT -s 100 -ff /sbin/dhclient -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $INTERFACES
>
> Restart=on-failure
>
> RestartSec=1
>
>
>
> [Install]
>
> WantedBy=multi-user.target network-online.target
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> root@evo-ptx-h-re1:~# cat /lib/systemd/system/dhcpd.service
>
> [Unit]
>
> Description=DHCPv4 Server Daemon
>
> Documentation=man:dhcpd(8) man:dhcpd.conf(5)
>
> After=network.target
>
> After=time-sync.target
>
> Wants=[hidden email]
>
> After=[hidden email]
>
>
>
> [Service]
>
> PIDFile=/var/run/dhcpd.pid
>
> EnvironmentFile=/etc/default/dhcp-server
>
> EnvironmentFile=-/etc/sysconfig/dhcp-server
>
> ExecStartPre=/bin/touch /var/lib/dhcp/dhcpd.leases
>
> ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
>
>
>
> [Install]
>
> WantedBy=multi-user.target
>
> root@evo-ptx-h-re1:~#
>
>
>
>
>
>
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
--
PAVEL ZHUKOV
SOFTWARE ENGINEER, RHCE, RHCVA
Red Hat
[hidden email] IM: IRC: landgraf
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
|
|
In reply to this post by prashantkumar dhotre
Hello Prashantkumar:
I suspect you may be running a packaged version of the software, rather than our officially released software. Unless you build from our source and define ENABLE_GENTLE_SHUTDOWN (undefined by default), neither dhcpd nor dhclient install signal handlers and will, if sent a SIGTERM promptly stop.
As you can see from the following strace of dhcpd built without ENABLE_GENTLE_SHUTDOWN (the default), the process terminates forthwith:
dhcpd without ENABLE_GENTLE_SHUTDOWN:
-------------------------------------------------------------------------------
tmark@cserver ~ $ sudo /usr/bin/strace -ttT -s 100 -ff -p `pgrep dhcpd`
/usr/bin/strace: Process 15129 attached
06:55:40.028953 select(22, [4 5 7 8 9], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler) <10.294941>
06:55:50.324192 --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=15191, si_uid=0} ---
06:55:50.340149 +++ killed by SIGTERM +++
--------------------------------------------------------------------------------
Defining ENABLE_GENTLE_SHUTDOWN adds signal handlers that for dhclient will cause it to release it's address(es) and for dhcpd, IF it's part of a failover pair, to go through partner down. Here's dhcpd strace after rebuilding with ENABLE_GENTLE_SHUTDOWN but not running as part of a failover pair:
-----------------------------------------------------------------------------
tmark@cserver ~ $ sudo /usr/bin/strace -ttT -s 100 -ff -p `pgrep dhcpd`
/usr/bin/strace: Process 14926 attached
06:53:30.163410 select(22, [4 5 7 8 9], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler) <18.171104>
06:53:48.334888 --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=15020, si_uid=0} ---
06:53:48.334957 rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system call) <0.000014>
06:53:48.335074 sendto(3, "<182>Mar 27 06:53:48 dhcpd: Received signal 15, initiating shutdown.", 68, MSG_NOSIGNAL, NULL, 0) = 68 <0.000108>
06:53:48.335258 write(2, "Received signal 15, initiating shutdown.", 40) = 40 <0.000147>
06:53:48.335447 write(2, "\n", 1) = 1 <0.000103>
06:53:48.335597 select(22, [4 5 7 8 9], [], NULL, {0, 0}) = 0 (Timeout) <0.000019>
06:53:48.335714 close(9) = 0 <0.000023>
06:53:48.335789 sendto(3, "<182>Mar 27 06:53:48 dhcpd: Disabling output on LPF/enp0s10/08:00:27:c7:c6:20/178.16.1.0/24", 91, MSG_NOSIGNAL, NULL, 0) = 91 <0.000030>
06:53:48.335856 write(2, "Disabling output on LPF/enp0s10/08:00:27:c7:c6:20/178.16.1.0/24", 63) = 63 <0.000103>
06:53:48.335991 write(2, "\n", 1) = 1 <0.000127>
06:53:48.336165 close(5) = 0 <0.006051>
06:53:48.342269 sendto(3, "<182>Mar 27 06:53:48 dhcpd: Disabling input on LPF/enp0s10/08:00:27:c7:c6:20/178.16.1.0/24", 90, MSG_NOSIGNAL, NULL, 0) = 90 <0.000035>
06:53:48.342347 write(2, "Disabling input on LPF/enp0s10/08:00:27:c7:c6:20/178.16.1.0/24", 62) = 62 <0.000114>
06:53:48.342497 write(2, "\n", 1) = 1 <0.000123>
06:53:48.342664 sendto(3, "<182>Mar 27 06:53:48 dhcpd: Disabling output on LPF/enp0s9/08:00:27:30:e5:6c/175.16.1.0/24", 90, MSG_NOSIGNAL, NULL, 0) = 90 <0.000064>
06:53:48.342764 write(2, "Disabling output on LPF/enp0s9/08:00:27:30:e5:6c/175.16.1.0/24", 62) = 62 <0.000110>
06:53:48.342943 write(2, "\n", 1) = 1 <0.000091>
06:53:48.343063 close(7) = 0 <0.016188>
06:53:48.359464 sendto(3, "<182>Mar 27 06:53:48 dhcpd: Disabling input on LPF/enp0s9/08:00:27:30:e5:6c/175.16.1.0/24", 89, MSG_NOSIGNAL, NULL, 0) = 89 <0.000124>
06:53:48.359753 write(2, "Disabling input on LPF/enp0s9/08:00:27:30:e5:6c/175.16.1.0/24", 61) = 61 <0.001290>
06:53:48.361294 write(2, "\n", 1) = 1 <0.000565>
06:53:48.362482 unlink("output/v4.pid") = 0 <0.001224>
06:53:48.364292 exit_group(0) = ?
06:53:48.366991 +++ exited with 0 +++
-------------------------------------------------------------------------------
Please note the log message being emitted, reflecting that the signal has been received;
06:53:48.335258 write(2, "Received signal 15, initiating shutdown.", 40) = 40 <0.000147>
And you can see from the above that does a bit more tidying up before stopping.
If you are not building from our released source, you may wish to try that:
https://www.isc.org/downloads/dhcp/
otherwise, you will need to reach out to the packager.
Regards,
Thomas Markwalder
ISC Software Engineering
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
|
|