-
QtSQL problem
Hi,
I have build a console application on Linux platform which connects to MySQL DB and fetches some data and displays it. I have successfully compiled and ran on Linux. Now I have created a shell script and calling this application in that script since this script will be deamon script which has start, stop, restart and status features. I have kept this script in /etc/init.d folder. Now when I run service myscript start command, this console application runs but gives following error
QOCIDriver: unable to create environment
The same script runs without service if called directly. Can somebody help me on this please.
Thanks
Manish
-
Re: QtSQL problem
When a script or program is run manually from an interactive shell, it usually run in a different environment then when running in a non-interactive shell, let alone in a non-user session.
You can start investigating the differences by dumping the environment variables in either case, e.g. doing something like this in your start script
Code:
env > /tmp/myprogram.env
Maybe your program or code used by it needs one of the variables set in the interactive shelll and not present in the daemon context.
Cheers,
_