Results 1 to 2 of 2

Thread: QtSQL problem

  1. #1
    Join Date
    Jun 2010
    Posts
    97
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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

    Qt Code:
    1. env > /tmp/myprogram.env
    To copy to clipboard, switch view to plain text mode 

    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,
    _

Similar Threads

  1. QtService & QtSql
    By acedanans in forum Qt Programming
    Replies: 11
    Last Post: 3rd October 2014, 12:30
  2. Building QtSql only
    By lk in forum Qt Programming
    Replies: 9
    Last Post: 18th February 2013, 14:03
  3. QTSQL on ARM board
    By chaithrakr7 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 26th March 2011, 04:45
  4. QtSql or QtSql/ ?
    By szisziszilvi in forum Newbie
    Replies: 3
    Last Post: 8th March 2011, 15:44
  5. problem of QtSql
    By cresthong in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2008, 17:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.