Friday, July 17, 2009

Cygwin sshd Service Fails to Start Most of the Time

Recently I've noticed that I can't access my wife's laptop with ssh. The reason was simple - the Cygwin sshd service was not running, even though it was set to start automatically.

I went through the event log and found a relevant error event saying "Error 1067 Application quit unexpectedly". I restarted the service via the control panel and it came up with no error. The file /var/log/sshd.log was empty, so I let it go.

And after a while it happened again, with the same symptoms and resolution. I searched the Net for similar problems, but only found complaints about sshd not starting at all.

After some futzing around I managed to configure the sshd service to repeatedly attempt to start in 5 minute intervals, as long as it fails to start.

With this workaround sshd would start, usually after many (>10) attempts.

I had no idea how to further investigate the situation. So I tried out a few shots in the dark: disable the anti-virus, turn off the firewall, futz with the sshd configuration files, etc. But to no avail. I seriously considered reinstalling Cygwin from scratch, but decided to try my luck with Google, again.

Turns out that I've hit a long standing conflict between Google Desktop Search and any Cygwin service (see this thread on the Cygwin mailing list, and this thread on the Google Desktop Help discussion group).

There are two reported ways to workaround this problem: either remove/downgrade GDS or edit the registry as follows:
  1. launch regedit
  2. navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows
  3. either remove the key AppInit_DLLs, or edit its value (a string) and remove from it the GDS specific DLL (look for something like GOEC62~1.DLL). In my case it was the only DLL on the list, so I just cleared the string.

This hack fixes the sshd problem, but I guess that it may cause problems with GDS.

GDS seems to work for now, but if I find that it's broken I suppose I'll have to switch to Widnows Search as the search engine on my wife's laptop.

No comments:

Post a Comment