Technical Journal

Programming, software technologies, operating systems, IT

Ubuntu .ICEAuthority problem

Recently I’ve rebooted my VMWare Ubuntu machine and after the login sequence I’ve received an error whose log I give bellow.

/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
/etc/gdm/PreSession/Default: running: /usr/bin/X11/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x “/var/lib/gdm/:20.Xservers” -h “” -l “:20″ “wes”
/etc/gdm/Xsession: Beginning session setup…
_IceTransTransNoListen: unable to find transport: tcp
_IceTransmkdir: ERROR: euid != 0,directory /dev/X will not be created.
_IceTransmkdir: ERROR: Cannot create /dev/X
_IceTransPTSOpenServer: mkdir(/dev/X) failed, errno = 13
_IceTransOpen: transport open failed for pts/ubuntu:
_IceTransMakeAllCOTSServerListeners: failed to open listener for pts
_IceTransISCOpenServer: Protocol is not supported by a ISC connection
_IceTransOpen: transport open failed for isc/ubuntu:
_IceTransMakeAllCOTSServerListeners: failed to open listener for isc
_IceTransSCOOpenServer: Protocol is not supported by a SCO connection
_IceTransOpen: transport open failed for sco/ubuntu:
_IceTransMakeAllCOTSServerListeners: failed to open listener for sco

** (gnome-session:23826): WARNING **: Unable to lock ICE authority file:

The solution I’ve found on a forum( http://www.linuxquestions.org/questions/showthread.php?s=ef11204ac2b7cacdd6cfc0b651512838&t=403160&page=3 ).  To save you the trouble of digging for it in the posts, I’ll just mention what I did to make Gnome start :

Open the failsafe terminal and edit the file /etc/gdm/Xsession. Add the following lines right under the PROGNAME = Xsession line :

ICEAUTHORITY=”tmp/ICEauthority-${root}”
export ICEAUTHORITY

This worked fine for me since Gnome is now normally started.

June 5, 2007 Posted by andocs | Linux | | No Comments Yet

Set PATH environment variable

This post may look shorter than it’s title. In order to set the PATH environment variable to include your custom path you should type the following on the command line :

> PATH=$PATH:/your_dir

That should do the trick.

June 2, 2007 Posted by andocs | Linux | | No Comments Yet

Create an ODBC connection from VS2005 setup

I am developing an application in the medical field with an Sql Server database ( let’s name it “MyDB” ) . Recently some of our clients have been asking for a way to easily export the data from our database in order to be used into some other analysis oriented tool.

That would have been easily achieved through an ODBC connection in the created into the Control Panel. I looked up for an easy way to create the ODBC connection through the Visual Studio 2005 Setup project. It turned out to be as easy as that. All you have to do is create registry entries for your ODBC connection. In my case, I’ve created a new System DSN and afterwards just copied the registry entries into my own setup project, I erased the DSN I’ve manually created and then I’ve executed the setup kit to test whether it works or not. Everything went just fine …

Let me give an example for a connection that requires an SqlServer driver.

In the Setup Project, open the registry view and browse to the key HKEY_LOCAL_MACHINE\Software. Under this key you will have to create the ODBC.INI key. Then, under this key, you will create a key with your database name, in our case that would be MyDB. Here is how an export from the registry editor would look like, for the database name key :

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI]

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\MyDB]
“Description”=”My database”
“Default”=”"
“StatsLog_On”=”Yes”
“Driver”=”C:\\Windows\\system32\\SQLSRV32.dll”
“Trusted_Connection”=”Yes”
“Server”=”(local)”
“LastUser”=”"
“Database”=”MyDB”.

You can easily copy these entries into your setup project under the database name ( “MyDB” ) key I’ve mentioned before.

Now, you must get back to the upper level ODBC.INI key and under it, create the key :”ODBC Data Sources”. You will then set the key : “MyDB” with the string value “SqlServer”. Here’s how the export looks like :

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
“MyDB”=”SQL Server”

So, now you have created, into your setup project, the registry entries you need in order to automatically create an ODBC connection upon application setup. If you want to test this, erase ODBC entry from your ODBC administrator tool in Control Panel, build up your kit, and when the setup finishes, check the registry editor again and view the entries right where they were before. Now, check the ODBC administrator tool and notice the ODBC entry.

On the other hand, when you need to uninstall the application, there is no need for you to do anything special as the uninstall process will remove the registry entries for you.

Please note that the example I’ve given works with an Sql Server database. For other types, you have to repeat the same procedure, because the registry keys will not be the same as in this case, for, let’s say, a Microsoft Access database.

May 12, 2007 Posted by andocs | Programming, Windows | | 1 Comment