Daemon - Automatically restarting
I have a C program which links an oracle DB to IBMs MQ series. This program should run all the time polling the database, taking data from the database tables, constructing a message from this data and putting this message onto the MQ queue.
My problem is that when the database is shutdown at night the program sometimes shutsdown as well because it can't log off of the database. I then have to manually restart it in the morning which can mean up to a 9 hour delay in messages being dealt with.
I would like the program to either run continuosly or to restart automatically?
Being a complete beginner at C programming (i.e. program was written by consultants and we have to support it) I have no idea how to resolve this.
Can anybody tell me the best solution to this problem?
Thanks in advance.