been running into an strange behavior into one of my script and i'm wondering if my code wouldn't be responsible.
Bash on rhel 5.7
This is a basic check to see if bind is up and running on server.
The function that does the actual checking
This code works BUT sometimes it gives me an error. Can't pinpoint an actual cause. But this is what i can say:
1- Never fails if i launch the script manually
2- Autosys launches a script that launches the Restart Script (sometimes good/sometimes bad)
3- Same thing sometimes happends when another script calls the Restart Script
4- Bind is always up and running never restarted/fail/overcapacity
If anybody has an idea or see's an error in my code that could create the error i'm all ears. Thanks.
Sometimes gives you what error? Knowing that'd be helpful.
Double-check that the contents of ${DNS_MASTER_SERVERS[@]} are always what you want. There could be something wonky ending up in there like a blank line or something.
I think the return $? is redundant, it'd be doing that anyway.
It gives me 1 meaning the rndc command didn't return 0 and the script exits.
But like i said the command always works manually so meaning (i think) that the problem lies with my script and not with the rndc command.
Yeah your right about the return.... that's a residu from another fonction so i'll remove it.
I'll check the array.... i think you may be right.... great trail but it bafles me that it always work when i do it manually and that sometimes (not always) it fails when a script call my script.
If rndc is completely unable to give you any information except the return code, you may need to start printing statements into a file for you to read later.
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.
I hate random errors.... at least when it's broken you know it doesn't work... now it works but sometimes it fails.... grrrrr.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)