Hello,

I suspect that it is not a question of bconsole.exe or bacula-fd.exe doing 
anything, but rather any time a Windows console application is started, the 
OS wants to run the tray application for that console. If it is not a local 
graphical screen, but some tty console for doing maintenance, the tray 
monitor is not going to be able to display itself or to interact with the 
user, so it gets upset.

Who knows.  Anyway, if someone can supply a patch that does not break it on a 
regular screen console, great -- otherwise, at the moment, it is not one of 
my priorities.


On Friday 13 May 2005 18:33, Russell Howe wrote:
> Kern Sibbald wrote:
> >>I meant that it seemed a little odd that this message was being logged
> >>multiple times when I certainly wasn't restarting the fd on the Windows
> >>machine. I know the service manager does have the facility to restart
> >>services, but as far as I am aware, it's not been doing that to the fd.
> >
> > I suspect that the Service controller is checking from time to time, or
> > some other Microsoft wonder, and Bacula doesn't understand what is going
> > on.
>
> Hm, what I think is going on is that the StartServiceCtrlDispatcher()
> call is being made by bacula-fd.exe both when it is started as a service
> by the service controller *and* when started to provide a tray icon.
>
> Since the StartServiceCtrlDispatcher is specified as failing when called
> from a console application (and presumably when called from anything
> that hasn't been spawned by the service controller?), when called by the
> tray icon process, it fails and logs the error.
>
> The call to StartServiceCtrlDispatcher is on line 324 of
> bacula/src/filed/win32/winservice.cpp (current CVS) in
> bacService::BaculaServiceMain()
>
> bacService::BaculaServiceMain() is called from winmain.cpp, line 171, in
> the WinMain() function:
>
> if (strncmp(&szCmdLine[i], BaculaRunService, strlen(BaculaRunService))
> == 0) {
>       /* Run Bacula as a service */
>       return bacService::BaculaServiceMain();
> }
>
> Which looks fine - BaculaServiceMain (and thence
> StartServiceCtrlDispatcher) should presumably only be called when being
> run as a service, and this check would seem to restrict it to this case.
>
> Now, the question is what commandline is bacula-fd.exe being run with
> when starting at logon to provide the systray icon?
>
> HKLM\Software\Microsoft\Windows\CurrentVersion\Run has this:
>
> Name: Bacula
> Value: "c:\bacula\bin\bacula-fd.exe" /servicehelper
>
> The problem (as far as I can see - I haven't got the setup to build
> Windows programs here) is that strncmp(&szCmdLine[i], BaculaRunService,
> strlen(BaculaRunService)) is being called like this:
>
> strncmp("/servicehelper", "/service", 8) and is only matching on the 1st
> 8 characters of "/servicehelper".
>
> "/service" is then seen as equal to "/servicehelper"
>
> Should it not be strcmp(&szCmdLine[i], BaculaRunService)? Is
> szCmdLine[i] trusted?

-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to