[PATCH] Cause udhcpc to return with failure when script fails

Denys Vlasenko vda.linux at googlemail.com
Thu Nov 23 16:00:56 UTC 2017


On Thu, Nov 23, 2017 at 11:37 AM, Fabien Lahoudere
<fabien.lahoudere at collabora.co.uk> wrote:
> Udhcpc uses scripts to perform many system dependent tasks. The return value
> of these scripts isn't checked and udhcpc will continue on assuming that
> they've worked.
>
> It may also be advantage to be able to abort should certain situations
> arise. In our case, we implement a basic RFC5227 check using scripts and we
> wish for DHCP configuration to abort when certain circumstances are met.
>
> Return an error so that the udhcpc caller knows the scripts have failed.

Would it work if the script would just kill the parent, a-la

        kill $PPID

If necessary, also issue a command which prevent udhcpc to restart,
if it is run under a service monitor. For example, "sv o ."
for a runit-based service monitoring.


More information about the busybox mailing list