dhcpclient and dhcpd do not stop on sigterm
prashantkumar dhotre
prashantkumardhotre at gmail.com
Mon Mar 26 10:55:19 UTC 2018
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 at 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 at re:~#
++++
root at 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 at evo-ptx-h-re1:~#
systemd service files:
root at evo-ptx-h-re1:~# cat /lib/systemd/system/dhclient.service
[Unit]
Description=Dynamic Host Configuration Protocol (DHCP)
RequiresOverridable=network at vmb.service
Before=ypbind.service
After=syslog.target network.target network at vmb.service
[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 at 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=network at vib.service
After=network at vib.service
[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 at evo-ptx-h-re1:~#
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20180326/9c08d02f/attachment-0001.html>
More information about the dhcp-users
mailing list