[Unbound-users] option to make unbound-control quiet
Mariano Absatz - gmail
el.baby at gmail.com
Sat Sep 22 20:08:37 UTC 2012
Hi,
I use unbound-control locally to reopen the log file after I rotate the
logs using logrotate. The problem is that when unbound-control does contact
the server and gets it to do what it wants, it prints "ok" on stdout.
This is annoying if you invoke it from within logrotate or a cron file. I
know, I can add ">/dev/null" (this is what I did), but it is usually nice
to have an option to tell any program to not output anything unless there
is an error.
Using the attached patch, you use the "-q" (quiet) option so that
unbound-control doesn't print anything if everything went OK.
Since it's been decades since the last time I seriously wrote C code, my
patch is ugly (I don't like it that it is a really inner function the one
that prints the output and I don't completely understand the argc/argv
management within go() and go_cmd(), so I ended adding one more parameter
in the functions.
Maybe someone who can actually code is able to do it right :)
--
Mariano Absatz - El Baby
www.clueless.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20120922/1796f6d2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unbound-control-q.patch
Type: application/octet-stream
Size: 2199 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20120922/1796f6d2/attachment.obj>
More information about the Unbound-users
mailing list