Bug 991018 - Document environment variables available in unixODBC
Document environment variables available in unixODBC
Product: Fedora
Classification: Fedora
Component: unixODBC (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jan Staněk
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-08-01 08:10 EDT by David Woodhouse
Modified: 2013-11-11 10:29 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-11 10:29:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
manpage describing environmental variables (1.64 KB, application/x-troff-man)
2013-10-22 07:21 EDT, Jan Staněk
no flags Details

  None (edit)
Description David Woodhouse 2013-08-01 08:10:05 EDT
If I set ODBCINSTINI=`pwd`/odbcinst.ini, we actually try to open /etc/`pwd`/odbcinst.ini... which fails. I need to prepend "../" to the path I put in the environment variable. That can't be right, surely?

ODBCINSTINI=`pwd`/odbcinst.ini strace -e open ./intel-add-printer.py

open("/etc//home/dwmw2/git/intel-add-printer/odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)

pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'FreeTDS' : file not found (0) (SQLDriverConnect)")

This version works:
ODBCINSTINI=..`pwd`/odbcinst.ini  ./intel-add-printer.py

I am assuming that $ODBCINSTINI is how I'm supposed to point to an app-specific file; we're not supposed to actually force the user to overwrite their ~/.odbcinst.ini? Or is there a better way?
Comment 1 Honza Horak 2013-08-12 07:53:53 EDT
Hi David,

I had to look into code to get an answer and these should be all environment variables unixODBC reads:

ODBCSYSINI -- overloads path to unixODBC config files; by default /etc

ODBCINSTINI -- overloads file name of unixODBC drivers configuration file; name is relative to ODBCSYSINI; by default odbcinst.ini

ODBCINSTUI -- overloads library name for UI; evaluates as lib+value; by default odbcinstQ4 so the resulted library is libodbcinstQ4

ODBCSEARCH -- overloads configuration mode; one of ODBC_SYSTEM_DSN, ODBC_USER_DSN or ODBC_BOTH_DSN, 

ODBCINI -- overloads path to user's odbc.ini file; by default ~/.odbc.ini

So I believe what you were seeking was $ODBCSYSINI variable, which could solve your problem.

Anyway, we should document these variables in the man pages somehow, so keeping this bug opened + changing the Summary.
Comment 2 Fedora Admin XMLRPC Client 2013-09-11 10:22:06 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Jan Staněk 2013-10-22 07:21:01 EDT
Created attachment 814940 [details]
manpage describing environmental variables

I created new man page (section 7) describing the environmental variables and the project as a whole. I did it this way because the variables affect the whole unixODBC (libraries as well as the binaries) and no common man page exists so far.

I sent this page to the upstream and I'm waiting for comments.
Comment 4 Jan Staněk 2013-10-24 06:31:41 EDT
After approval from upstream I added the man page to the package.
Comment 5 Fedora Update System 2013-10-24 07:03:51 EDT
unixODBC-2.3.2-2.fc20 has been submitted as an update for Fedora 20.
Comment 6 Fedora Update System 2013-11-10 03:13:57 EST
unixODBC-2.3.2-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.