Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dhclient exit codes

42 views
Skip to first unread message

Java Jive

unread,
Mar 13, 2011, 6:16:41 PM3/13/11
to
On an embedded platform I'm trying to establish why dhclient is
returning an exit code of 143 when apparently successfully obtaining a
leased IP. Can anyone point me to a table of dhclient's exit codes
and their meanings?
--
=========================================================
Please always reply to ng as the email in this post's
header does not exist. Or use a contact address at:
http://www.macfh.co.uk/JavaJive/JavaJive.html
http://www.macfh.co.uk/Macfarlane/Macfarlane.html

bosco

unread,
Mar 13, 2011, 10:33:35 PM3/13/11
to
On 2011-03-13 16:16:41 -0600, Java Jive <ja...@evij.com.invalid> said:

> On an embedded platform I'm trying to establish why dhclient is
> returning an exit code of 143 when apparently successfully obtaining a
> leased IP. Can anyone point me to a table of dhclient's exit codes
> and their meanings?

I think most people read multiple Linux groups, there really is no need
to spam them with the same message.

J.O. Aho

unread,
Mar 14, 2011, 12:47:53 AM3/14/11
to
Java Jive wrote:
> On an embedded platform I'm trying to establish why dhclient is
> returning an exit code of 143 when apparently successfully obtaining a
> leased IP. Can anyone point me to a table of dhclient's exit codes
> and their meanings?

A tool exiting with something else than 0 will mean something didn't go as
planed. To see what different error codes mean, check then source code if you
can't find it in the man page.

--

//Aho

Java Jive

unread,
Mar 14, 2011, 7:25:10 AM3/14/11
to
Really, I shouldn't have to do that, should I? Exit codes ought to be
part of the documentation as standard.

However, I guess it's going to come down to that. Where can I find
the source?

On Mon, 14 Mar 2011 05:47:53 +0100, "J.O. Aho" <us...@example.net>
wrote:


>
> A tool exiting with something else than 0 will mean something didn't go as
> planed. To see what different error codes mean, check then source code if you
> can't find it in the man page.
--

Richard Kettlewell

unread,
Mar 14, 2011, 8:02:19 AM3/14/11
to
Java Jive <ja...@evij.com.invalid> writes:

> On an embedded platform I'm trying to establish why dhclient is
> returning an exit code of 143 when apparently successfully obtaining a
> leased IP. Can anyone point me to a table of dhclient's exit codes
> and their meanings?

143 corresponds to SIGTERM, as the exit status of any program, not just
dhclient. The ISC DHCP client at least will send a SIGTERM to other
instances of itself.

--
http://www.greenend.org.uk/rjk/

John Hasler

unread,
Mar 14, 2011, 8:22:42 AM3/14/11
to
Java Jive writes:
> Really, I shouldn't have to do that, should I?

No, you shouldn't. Demand your money back.

> Exit codes ought to be part of the documentation as standard.

Yes, they should. Submit a patch when you've solved your problem.

> Where can I find the source?

You received the source or a written offer of it with the binary. If
you no longer have that Google can find it for you. We can help if you
tell us the exact package name and version.
--
John Hasler
jha...@newsguy.com
Dancing Horse Hill
Elmwood, WI USA

Java Jive

unread,
Mar 14, 2011, 10:14:31 PM3/14/11
to
Ah! Thanks for that thought-provoking response ...

So the theory would go that because I was running ...
service network restart
... there was already an instance of dhclient running, whereas when
the device boots from scratch, there won't be, and the subsequent
script will complete properly.

I can test that theory ...

bash-3.2# ps aux | grep dhclient
root 1199 ... /sbin/dhclient ...
root 2471 ... grep dhclient ...
bash-3.2# kill 1199
bash-3.2# service network restart
Shutting down interface eth0: OK ]
Shutting down loopback interface: OK ]
Bringing up loopback interface: OK ]
Bringing up interface eth0:
Determining IP information for
eth0.../etc/sysconfig/network-scripts/ifup-eth: l
ine 296: 2805 Terminated /sbin/dhclient ${DHCLIENTARGS}
${DEVICE}
failed.
FAILED]

Bummer! It sounded so reasonable too ...

But, even if that had been the case, that would still have meant the
script that calls dhclient was buggy, because there already being an
instance running is not really a failure, is it, so surely the script
should continue? The relevant code segment reads ...

if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
else
echo $" failed."
exit 1
fi

... where the variables being used in the command-line appear to have
sensible values.

On Mon, 14 Mar 2011 12:02:19 +0000, Richard Kettlewell
<r...@greenend.org.uk> wrote:
>
> 143 corresponds to SIGTERM, as the exit status of any program, not just
> dhclient. The ISC DHCP client at least will send a SIGTERM to other
> instances of itself.
--

0 new messages