Random script error with rndc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Random script error with rndc
# 8  
Old 04-17-2015
It would seem that:
Code:
tail -1 log | grep up

could be discarding diagnostics indicating why rndc failed. Is there some reason why something like:
Code:
rndc -k ${RNDC_KEY} -s ${DNS_SERVER} status > $some_temp_file 2>&1 || cat $some_temp_file

wouldn't give you a better indication of what might have gone wrong? Or, if you don't want to see normal output, but want to see diagnostic output, have you considered something simpler, like:
Code:
rndc -k ${RNDC_KEY} -s ${DNS_SERVER} status > /dev/null

(which is not redirecting standard error at all).
This User Gave Thanks to Don Cragun For This Post:
# 9  
Old 04-17-2015
Problem is that its a parent script that launches this one so we don't get to see standard output or standard error on the term. That way the temp file would really help. Each time i try to run it myself it is always succefull.

I even tried this to see if it was not a rndc overload problem

Code:
for (( x=1; x<=500; x++ )); do rndc -k <key> -s <serverip> status| grep up; echo $?; done

And not a single fault.

Maybe i could put my check in a loop saying well if it fails the first time maybe try again in like 2-3 seconds? I'm the first one to scream at people using sleep in their script but maybe it's time i revise my position Smilie
# 10  
Old 04-17-2015
Quote:
Originally Posted by maverick72
Oh my .... need more coffee.... Thanks Don.

Is it standard to redirect outputs into a file and then looking into that file to pull out the information you wanted? In my case it looks like alot of i/o's and external commands JUST to get the return of one command.
Eh, it's like log files. If you don't know what you're looking for, you don't know what's safe to throw away. At least this is temporary...
This User Gave Thanks to Corona688 For This Post:
# 11  
Old 04-17-2015
I get it.... i've modified the rndc to keep the important stuff. Of course it makes sense.

Will let you guys know what i can find out. Thanks again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script that will random choose an IP address

Hi, I need to write a bash script that will random choose and login into these below ip addresses. 192.168.116.130 192.168.116.131 192.168.116.132 192.168.116.133 I'm new into scripting and I need to enhance my logic. Below is what i did ... (4 Replies)
Discussion started by: Milon
4 Replies

2. Shell Programming and Scripting

Random number generating script?

Having a hard time with this. Very new to scripting and linux. Spent all sunday trying to do this. Appreciate some help and maybe help breaking down what the syntax does. Create a Bash program. It should have the following properties • Creates a secret number between 1 and 100 i. The... (3 Replies)
Discussion started by: LINUXnoob15
3 Replies

3. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

4. Shell Programming and Scripting

Generate random numbers in script

i want to generate a random number through a script, and even if anyone reads the script, they wont be able to figure out what the random number is. only the person who setup the script would know it. something like this could work: random the full thread is here: ... (13 Replies)
Discussion started by: SkySmart
13 Replies

5. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

6. Shell Programming and Scripting

$RANDOM does not work inside a shell script

Hi folks I'm coding on Ubuntu 9.04 standard shell. I'm writing a script that needs to generate a random number at some point of its execution. When I do echo $RANDOMas a command inside shell, I clearly get some randomly generated number However when I do i=`$RANDOM` echo $ior even... (14 Replies)
Discussion started by: ksk
14 Replies

7. Programming

Random Access Iterator Error

I am unable to resolve the below code compilation issue: class A { public: int x; }; void sort_A(TArray<A> &_Atype) { std::stable_sort (_Atype.begin(), _Atype.end()); } bool operator< (const A & _a1, const A & _a2) { return _a1.x < _a2.x; } When we compile using gcc 4.1.2... (4 Replies)
Discussion started by: uunniixx
4 Replies

8. Shell Programming and Scripting

random script termination

I'm writing a script to archive data. First, the files are all rsync'd to the archive directory via NFS mounts(I know not the most efficient, but the only choice in this situation), then I use md5sum to validate the transfers. During execution of the script, it will exit for no apparent reason. It... (6 Replies)
Discussion started by: mph
6 Replies

9. Shell Programming and Scripting

random function script

hi, I need a command which picks the records randomly from the file. For example. i am having some 10000 entries in a file and need to extract the lines randomly without repeating the numbers. Do anybody have any idea on how to get this out. (4 Replies)
Discussion started by: prash_b
4 Replies

10. UNIX for Dummies Questions & Answers

rndc

Ok, each time i type rndc reload I get rndc: decode base 64 secret: bad64 encoding. I used dnssec-keygen to encode the actual key what am i doing wrong? Thanks in advance below are my files i do use a key not just KEY KEY KEY ---AN INCLUDE FILE FOR ----NAMED.CONF key "rndckey" {... (1 Reply)
Discussion started by: macdonto
1 Replies
Login or Register to Ask a Question