Glenn.Satchell at uniq.com.au
Tue Sep 19 13:45:10 UTC 2006
>Date: Tue, 19 Sep 2006 10:30:32 +0200
>From: Jon Otterholm <jon.otterholm at ide.resurscentrum.se>
>To: dhcp-users at isc.org
>Subject: Re: execute problems
>There is not much info on these functions. I hope that someone out there
>could share some working examples - but the response on this list is
>> i'm interested in this new option. where can i find more information?
execute(command-path, data-expr1 ... data-exprN);
External command execution is made possible through exe-
cute(); expressions. These expressions take a variable
number of arguments, where the first is the command name
(full path or only the name of the executable) and is fol-
lowed by zero or more are data-expressions whose values
will be evaluated and passed as external arguments
(assumed to be text strings suitable for use as a
command-line argument). It returns the numeric return
code of the external command, or one of the following spe-
o 125: Invalid arguments.
o 126: fork() failure
o 127: execvp() failure
o -SIGNAL: Should the child exit due to a signal, rather
than exiting normally with an exit status, the signal
number multiplied by negative 1 will be returned.
Execute is synchronous, and the program will block until
the external command being run has finished. Please note
that lengthy program execution (for example, in an "on
commit" in dhcpd.conf) may result in bad performance and
timeouts. Only external applications with very short exe-
cution times are suitable for use.
Passing user-supplied data to an external application
might be dangerous. Make sure the external application
checks input buffers for validity. Non-printable ASCII
characters will be converted into dhcpd.conf language
octal escapes ("777"), make sure your external command
handles them as such.
It is possible to use the execute expression in any con-
text, not only on events. If you put it in a regular scope
in the configuration file you will execute that command
every time a scope is evaluated.
What particular type of information are you interested in?
Glenn Satchell mailto:glenn.satchell at uniq.com.au | Heard about
Uniq Advances Pty Ltd http://www.uniq.com.au | the new Unix
PO Box 70 Paddington NSW Australia 2021 | sports car?
tel:0409-458-580 tel:02-9380-6360 fax:02-9380-6416 | The rwx
More information about the dhcp-users