Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jun 2010
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 4 Times in 3 Posts
    I've written a VB prog and set it up to run as a service on XP using srvany. I've set its startup type to automatic, and I have it depending upon the spooler service (as I understand this is usually one of the last services to load).

    On boot, the service shows as started, but the program doesn't appear do anything (it's supposed to catch session locks and terminations and kick of an ftp sync when it sees one).

    If I restart the service, then it behaves as expected - i.e. it triggers the ftp sync when it notices a session lock or termination.

    As a workaround, I've written a quick batch file to restart the service at logon - but it's bugging me why this should be necessary - when it's set to automatic anyway.. and does appear to start.

    Any and all suggestions greatly appreciated!


    Cheers
    Darren

  2. #2
    5 Star Lounger chowur's Avatar
    Join Date
    Mar 2010
    Location
    Indiana
    Posts
    804
    Thanks
    0
    Thanked 54 Times in 51 Posts
    Open control panel then click on Administrative Tools then Component Services.Check to see if your program is set on manual or automatic.
    Problems cannot be solved by the same level of thinking that created them. -Albert Einsten

  3. #3
    New Lounger
    Join Date
    Jun 2010
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Hi Ron.. and thanks for your reply.

    Yep..it's set to automatic.. and it does actually start (you can see the process in task manager). It's just that, following a reboot, it doesn't actually do what it's supposed to do - until I restart the service. Im struggling to see why bouncing the service is necessary when the service is being started automatically anyway at boot time.

    The only thing I can think of that might be an issue is the timing. As I said previously, I've made the service dependent upon the spooler service.. as I seem to remember reading that the spooler is one of the last services to load. Maybe there are services that start after the spooler and I need to specify one of those as a dependency .. but I don't know how to check the service startup sequence...

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    Can you build a start up delay into your VB code? That should identify whether it's SRVANY or your code.

    cheers, Paul

  5. #5
    New Lounger
    Join Date
    Jun 2010
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Hi Paul. and thanks for your reply. If what I'm trying at the moment doesn't work, I'll give your suggestion a try and let you know how I get on.

    As things stand, I've found a registry entry which shows in what order the service groups are started, but nothing yet for the individual services within those groups. Interestingly, there are 9 groups later in the list than the SpoolerGroup. I'm currently trawling the registry to see if there are any services I run which belong to one of these later groups - which I can then use as a dependency and see if that makes any difference.


    Cheers
    Darren

  6. #6
    New Lounger
    Join Date
    Jun 2010
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Ok.. I didn't get anywhere trying to find a later service on which mine could depend. So, Paul, I took your advice and changed my code. There's now a small delay before my code starts looking for session notifications.. and it appears to be working!

    Thanks again all..

    Darren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •