Re: Service App Problem

From: Anchorman (JesseN0SPAM_at_davinci-mims.com)
Date: 01/13/04


Date: Tue, 13 Jan 2004 11:00:24 -0500

The application has a timer on it and every 3 minutes, it checks for an
e-mail at a certain e-mail address. If it finds one, it will download it,
log the information from it, generate a username and password, log that
information in a SQL database, and delete the e-mail. Really, the
application isn't that long. It uses Indy components for the e-mail stuff.

Here is my OnStart event:

procedure TCCCheckMail.ServiceStart(Sender: TService;
  var Started: Boolean);
Var
   oINI : TINIFile;
begin
   Log2File('Service Started'); {This simply logs messages in a log file }
   try
      // get the timer and EMail File settings
      oINI := TINIFile.Create('cc.ini');
      { Set it initially for 3 minutes }
      Timer1.Interval :=
oINI.ReadInteger('Settings','TimerIntervals',180000);
      EMFileLoc := oINI.ReadString('Settings','EMailFileLocation','D:\');
      oINI.Free;
   except
      Log2File('Unable to open .INI File, defaults are in place.');
   end;
end;

I've got a simple OnStop that simply puts "Service Stopped" into the log
file, and that's it, other than the standard OnExecute.

Jesse

"Guenther Wimpassinger" <gw_spam@pickem.at> wrote in message
news:40040da3$1@newsgroups.borland.com...
>
> "Anchorman" <JesseN0SPAM@davinci-mims.com> schrieb
>
> > I've got a service application that I wrote on a Win 2K Pro machine
using
> > Dephi 5. I can install the service, start it, and it runs just fine on
my
> > development machine. However, when I install it and try to start it on
> > either our Win 2K Server, or Win 2003 Server, I get the error, "Error
1053:
> > The service did not respond to the start or control request in a timely
> > fashion."
>
> Hm. What should your service-app do? Maybe you have an exception on the
> startup of the service and so the service is closed/terminated
automatically.
>
> Create a log-file where you store DebugInfo during the startup.
>
> HTH
> Guenther
>
>
>
>



Relevant Pages

  • RE: STARTUP.LOG?
    ... > And if you try the 20000 flag and still dont get enough information, ... >>> Is there a way to get the startup sequence before ... During the hanging, no ... same batch job could then move the log file off the system disk if need ...
    (comp.os.vms)
  • Re: Startup animation, how to initiate?
    ... However, as I understand it, the basic principle is to depend on the usage of a timer (which I also found to be the ... The timer was used solely to kill time, simulating the real load time of the application. ... This assumes that the startup tasks are small enough to show load progression, if you make a call to ...
    (microsoft.public.vb.winapi.graphics)
  • Re: More details on the disaster
    ... the IF line with the conditions causing the issue or any of those lines. ... Then be sure to reset the interval of the timer upon returning. ... Consider adding things to a log file before the IF statement including ... thisform.citxmitww && CIT Send ...
    (microsoft.public.fox.programmer.exchange)
  • Re: debug slow startup?
    ... to update third party drivers. ... This point occurred to me after reading ... and allowing the startup to go on. ... Would anything be written to a log file somewhere? ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: debug slow startup?
    ... to update third party drivers. ... and allowing the startup to go on. ... Would anything be written to a log file somewhere? ...
    (microsoft.public.windowsxp.perform_maintain)