Okay, to date I have setup 4 Sharepoint 2007 servers. And every god darned time I do this, I run into the very same problem over and over again. Not only that, I forget to do the right thing - every god darned time I set up a server.
So I'm gonna put this on my blog to save you from ripping your hair out in frustration and anger.
When you setup a Sharepoint 2007 server, MOSS or WSS, you probably will need to setup shared services, before which you will need to setup indexing/crawling/searching.
Yep - so you go to SCAW (Central Admin), and then you go to "services on the server" and then you attempt to start the service.
And then sharepoint may tell you "Something bad happened". with the word "OSearch" written there.
So I turn on diagnostic logging (which was off by default), on the same page, and here is the rather uninformative error I found deep inside sharepoint logs.
The call to SearchServiceInstance.Provision (server 'YourServerName') failed. Setting back to previous status 'Disabled'. System.ComponentModel.Win32Exception: OSearch ('YourSearchAcct') at Microsoft.SharePoint.Win32.SPAdvApi32.ChangeServiceConfiguration(String strServiceName, String strAccountName, SecureString sstrPassword, IdentityType identityType, Boolean bDontRestartService) at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionProcessIdentity(String strUserName, SecureString secStrPassword, IdentityType identityType, Boolean isAdminProcess, Boolean isWindowsService, String strServiceName, Boolean dontRestartService) at Microsoft.SharePoint.Administration.SPProcessIdentity.ProvisionInternal(SecureString sstrPassword, Boolean isRunningInTimer) at Microsoft....
I swear - what the hell is the above error message useful for? Not much if you'd ask me. And no I didn't truncate the above error message - Thats about all that got logged. :-/
So what is the solution?
Make sure that you enter the account name for crawling and searching as "Domain\accnt name" EVEN IF they are local accounts. Then you won't get the above error.
.. yet another small tip to save the day, courtesy Malik services. :-)
Now only if I could remember the above when I setup my next Sharepoint 2007 server. LOL.