dhclient-script, hooks, and changing the environment

Brian May brian at microcomaustralia.com.au
Thu Aug 7 03:56:44 UTC 2008


martin f krafft wrote:
>
> The problem is that netconf has no dhclient-script anymore as it
> parses dhclient REASONS directly and then proceeds to use e.g. IP
> address and router stuff as if it had been gathered from /e/n/i.
> Thus, hooks are execvp()'d from netconf directly. If I wanted to
> allow hooks to modify the environment, I'd have to execvp()
>
>   sh -c '. the_hook; env | while read line; do echo "ENVIRONMENT:$line'
>
> and then parse that stuff out of stdout, which, to put it mildly, is
> ASS. I'd really rather not.
>   
sh -c '. the_hook; env | while read line; do echo "ENVIRONMENT:$line"; done > /tmp/file'

Still extremely ugly, but at least you don't have to redirect stdout in 
the_hook. Need to do something better for
/tmp/file of course.

How many dhclient scripts actually make use of this "feature" of being 
able to change environment variables?  If it is little used maybe it 
isn't worth the effort in supporting.

Brian May



More information about the netconf-devel mailing list