@@ -732,6 +732,357 @@ Server: Broken Pipe
732
732
of the <productname>Postgres</productname>
733
733
<acronym>ODBC</acronym> package.
734
734
735
+ <varlistentry>
736
+ <term>
737
+ setuid to 256: failed to launch gateway
738
+
739
+ <listitem>
740
+ <para>
741
+ The September release of ApplixWare v4.4.1 (the first release with official
742
+ <acronym>ODBC</acronym> support under Linux) shows problems when usernames
743
+ exceed eight (8) characters in length.
744
+ Problem description ontributed by
745
+ <ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink>.
746
+
747
+ </variablelist>
748
+
749
+ <para>
750
+ <note>
751
+ <title>Author</title>
752
+
753
+ <para>
754
+ Contributed by
755
+ <ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink> on
756
+ 1998-10-20.
757
+ </note>
758
+
759
+ The <application>axnet</application> program's security system
760
+ seems a little suspect. <application>axnet</application> does things
761
+ on behalf of the user and on a true
762
+ multiple user system it really should be run with root security
763
+ (so it can read/write in each user's directory).
764
+ I would hesitate to recommend this, however, since we have no idea what
765
+ security holes this creates.
766
+
767
+ <sect2>
768
+ <title>Debugging ApplixWare ODBC Connections</title>
769
+
770
+ <para>
771
+ One good tool for debugging connection problems uses the Unix system
772
+ utility <application>strace</application>.
773
+
774
+ <procedure>
775
+ <title>Debugging with strace</title>
776
+
777
+ <step performance="required">
778
+ <para>
779
+ Start applixware.
780
+
781
+ <step performance="required">
782
+ <para>
783
+ Start an <application>strace</application> on
784
+ the axnet process. For example, if
785
+
786
+ <programlisting>
787
+ ps -aucx | grep ax
788
+ </programlisting>
789
+
790
+ shows
791
+
792
+ <programlisting>
793
+ cary 10432 0.0 2.6 1740 392 ? S Oct 9 0:00 axnet
794
+ cary 27883 0.9 31.0 12692 4596 ? S 10:24 0:04 axmain
795
+ </programlisting>
796
+
797
+ <para>
798
+ Then run
799
+
800
+ <programlisting>
801
+ strace -f -s 1024 -p 10432
802
+ </programlisting>
803
+
804
+ <step performance="required">
805
+ <para>
806
+ Check the strace output.
807
+
808
+ <note>
809
+ <title>Note from Cary</title>
810
+
811
+ <para>
812
+ Many of the error messages from <productname>ApplixWare</productname>
813
+ go to <filename>stderr</filename>,
814
+ but I'm not sure where <filename>stderr</filename>
815
+ is sent, so <application>strace</application> is the way to find out.
816
+ </note>
817
+
818
+ </procedure>
819
+
820
+ <para>
821
+ For example, after getting
822
+ a <quote>Cannot launch gateway on server</quote>,
823
+ I ran strace on axnet and got
824
+
825
+ <programlisting>
826
+ [pid 27947] open("/usr/lib/libodbc.so", O_RDONLY) = -1 ENOENT
827
+ (No such file or directory)
828
+ [pid 27947] open("/lib/libodbc.so", O_RDONLY) = -1 ENOENT
829
+ (No such file or directory)
830
+ [pid 27947] write(2, "/usr2/applix/axdata/elfodbc:
831
+ can't load library 'libodbc.so'\n", 61) = -1 EIO (I/O error)
832
+ </programlisting>
833
+ So what is happening is that applix elfodbc is searching for libodbc.so, but it
834
+ can't find it. That is why axnet.cnf needed to be changed.
835
+
836
+ <sect2>
837
+ <title>Running the ApplixWare Demo</title>
838
+
839
+ <para>
840
+ In order to go through the
841
+ <citetitle>ApplixWare Data Tutorial</citetitle>, you need to create
842
+ the sample tables that the Tutorial refers to. The ELF Macro used to
843
+ create the tables tries to use a NULL condition
844
+ on many of the database columns,
845
+ and <productname>Postgres</productname> does not currently allow this option.
846
+
847
+ <para>
848
+ To get around this problem, you can do the following:
849
+
850
+ <procedure>
851
+ <title>Modifying the ApplixWare Demo</title>
852
+
853
+ <step performance="required">
854
+ <para>
855
+ Copy <filename>/opt/applix/axdata/eng/Demos/sqldemo.am</filename>
856
+ to a local directory.
857
+
858
+ <step performance="required">
859
+ <para>
860
+ Edit this local copy of <filename>sqldemo.am</filename>:
861
+
862
+ <substeps>
863
+
864
+ <step performance="required">
865
+ <para>
866
+ Search for 'null_clause = "NULL"
867
+
868
+ <step performance="required">
869
+ <para>
870
+ Change this to null_clause = ""
871
+
872
+ </substeps>
873
+
874
+ <step performance="required">
875
+ <para>
876
+ Start <application>Applix Macro Editor</application>.
877
+
878
+ <step performance="required">
879
+ <para>
880
+ Open the sqldemo.am file from the <application>Macro Editor</application>.
881
+
882
+ <step performance="required">
883
+ <para>
884
+ Select <command>File->Compile and Save</command>.
885
+
886
+ <step performance="required">
887
+ <para>
888
+ Exit <application>Macro Editor</application>.
889
+
890
+ <step performance="required">
891
+ <para>
892
+ Start <application>Applix Data</application>.
893
+
894
+ <step performance="required">
895
+ <para>
896
+ Select <command>*->Run Macro</command>
897
+
898
+ <step performance="required">
899
+ <para>
900
+ Enter the value <quote>sqldemo</quote>, then click <command>OK</command>.
901
+
902
+ <para>
903
+ You should see the progress in the status line of the data window
904
+ (in the lower left corner).
905
+
906
+ <step performance="required">
907
+ <para>
908
+ You should now be able to access the demo tables.
909
+
910
+ </procedure>
911
+
912
+ <sect2>
913
+ <title>Useful Macros</title>
914
+
915
+ <para>
916
+ You can add information about your
917
+ database login and password to the standard Applix startup
918
+ macro file. This is an example
919
+ <filename>~/axhome/macros/login.am</filename> file:
920
+
921
+ =======
922
+ <productname>ApplixWare</productname> must be configured correctly
923
+ in order for it to
924
+ be able to access the <productname>Postgres</productname>
925
+ <acronym>ODBC</acronym> software drivers.
926
+
927
+ <procedure>
928
+ <title>Enabling ApplixWare Database Access</title>
929
+
930
+ <para>
931
+ Note that
932
+ these instructions are for the 4.4.1 release of
933
+ <productname>ApplixWare</productname> on <productname>Linux</productname>.
934
+ Refer to the <citetitle>Linux Sys Admin</citetitle> on-line book
935
+ for more detailed information.
936
+
937
+ <step performance="required">
938
+ <para>
939
+ You must modify <filename>axnet.cnf</filename> so that
940
+ <filename>elfodbc</filename> can
941
+ find <filename>libodbc.so</filename>
942
+ (the <acronym>ODBC</acronym> driver manager) shared library.
943
+ This library is included with the ApplixWare distribution,
944
+ but <filename>axnet.cnf</filename> needs to be modified to point to the
945
+ correct location.
946
+
947
+ <para>
948
+ As root, edit the file
949
+ <filename><replaceable>applixroot</replaceable>/applix/axdata/axnet.cnf</filename>.
950
+
951
+ <substeps>
952
+
953
+ <step performance="required">
954
+ <para>
955
+ At the bottom of <filename>axnet.cnf</filename>,
956
+ find the line that starts with
957
+
958
+ <programlisting>
959
+ #libFor elfodbc /ax/<replaceable>...</replaceable>
960
+ </programlisting>
961
+
962
+ <step performance="required">
963
+ <para>
964
+ Change line to read
965
+
966
+ <programlisting>
967
+ libFor elfodbc <replaceable>applixroot</replaceable>/applix/axdata/axshlib/lib
968
+ </programlisting>
969
+
970
+ which will tell elfodbc to look in this directory
971
+ for the <acronym>ODBC</acronym> support library.
972
+ If you have installed applix somewhere else,
973
+ change the path accordingly.
974
+
975
+ </substeps>
976
+
977
+ <step performance="required">
978
+ <para>
979
+ Create <filename>.odbc.ini</filename> as
980
+ described above. You may also want to add the flag
981
+
982
+ <programlisting>
983
+ TextAsLongVarchar=0
984
+ </programlisting>
985
+
986
+ to the database-specific portion of <filename>.odbc.ini</filename>
987
+ so that text fields will not be shown as <literal>**BLOB**</literal>.
988
+
989
+ </procedure>
990
+
991
+ <procedure>
992
+ <title>Testing ApplixWare ODBC Connections</title>
993
+
994
+ <step performance="required">
995
+ <para>
996
+ Bring up <application>Applix Data</application>
997
+
998
+ <step performance="required">
999
+ <para>
1000
+ Select the <productname>Postgres</productname> database of interest.
1001
+
1002
+ <substeps>
1003
+
1004
+ <step performance="required">
1005
+ <para>
1006
+ Select <command>Query->Choose Server</command>.
1007
+
1008
+ <step performance="required">
1009
+ <para>
1010
+ Select <acronym>ODBC</acronym>, and click <command>Browse</command>.
1011
+ The database you configured in <filename>.odbc.ini</filename>
1012
+ should be shown. Make sure that the <option>Host: field</option>
1013
+ is empty (if it is not, axnet will try to contact axnet on another machine
1014
+ to look for the database).
1015
+
1016
+ <step performance="required">
1017
+ <para>
1018
+ Select the database in the box that was launched by <command>Browse</command>,
1019
+ then click <command>OK</command>.
1020
+
1021
+ <step performance="required">
1022
+ <para>
1023
+ Enter username and password in the login identification dialog,
1024
+ and click <command>OK</command>.
1025
+
1026
+ </substeps>
1027
+
1028
+ <para>
1029
+ You should see <quote>Starting elfodbc server</quote>
1030
+ in the lower left corner of the
1031
+ data window. If you get an error dialog box, see the debugging section
1032
+ below.
1033
+
1034
+ <step performance="required">
1035
+ <para>
1036
+ The 'Ready' message will appear in the lower left corner of the data
1037
+ window. This indicates that you can now enter queries.
1038
+
1039
+ <step performance="required">
1040
+ <para>
1041
+ Select a table from Query->Choose tables, and then select Query->Query
1042
+ to access the database. The first 50 or so rows from the table should
1043
+ appear.
1044
+
1045
+ </procedure>
1046
+
1047
+ <sect2>
1048
+ <title>Common Problems</title>
1049
+
1050
+ <para>
1051
+ The following messages can appear while trying to make an
1052
+ <acronym>ODBC</acronym> connection through
1053
+ <productname>Applix Data</productname>:
1054
+
1055
+ <variablelist>
1056
+ <varlistentry>
1057
+ <term>
1058
+ Cannot launch gateway on server
1059
+
1060
+ <listitem>
1061
+ <para>
1062
+ <literal>elfodbc</literal> can't find <filename>libodbc.so</filename>.
1063
+ Check your <filename>axnet.cnf</filename>.
1064
+
1065
+ <varlistentry>
1066
+ <term>
1067
+ Error from ODBC Gateway:
1068
+ IM003::[iODBC][Driver Manager]Specified driver could not be loaded
1069
+
1070
+ <listitem>
1071
+ <para>
1072
+ <filename>libodbc.so</filename> cannot find the driver listed in
1073
+ <filename>.odbc.ini</filename>. Verify the settings.
1074
+
1075
+ <varlistentry>
1076
+ <term>
1077
+ Server: Broken Pipe
1078
+
1079
+ <listitem>
1080
+ <para>
1081
+ The driver process has terminated due to some other
1082
+ problem. You might not have an up-to-date version
1083
+ of the <productname>Postgres</productname>
1084
+ <acronym>ODBC</acronym> package.
1085
+
735
1086
</variablelist>
736
1087
737
1088
<sect2>
0 commit comments