Bug 991018 - Document environment variables available in unixODBC
Summary: Document environment variables available in unixODBC
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: unixODBC
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Staněk
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-01 12:10 UTC by David Woodhouse
Modified: 2013-11-11 15:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-11 15:29:16 UTC
Type: Bug
Embargoed:


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

Description David Woodhouse 2013-08-01 12:10:05 UTC
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 11:53:53 UTC
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 14:22:06 UTC
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 11:21:01 UTC
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 10:31:41 UTC
After approval from upstream I added the man page to the package.

Comment 5 Fedora Update System 2013-10-24 11:03:51 UTC
unixODBC-2.3.2-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/unixODBC-2.3.2-2.fc20

Comment 6 Fedora Update System 2013-11-10 08:13:57 UTC
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.