Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem running service on win2k8

Problem running service on win2k8

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminhelpquestionlearning
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mahesh Kulkarni
    wrote on last edited by
    #1

    Hi All, I have a service application which runs well on win2k3 with Local System Account. When I tried to use the same service on Win2k8 server if failed with Local System Account. It says "The service did not respond to the start or control request in a timely fashion." This service works under domain administrator account. Now I want to run the service as Local System account on win2k8 server.What and where i need to do changes? Service is developed in C++ unmanaged code. Please let me know if anymore information required. Regards, Mahesh R. Kulkarni

    The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

    Richard Andrew x64R 1 Reply Last reply
    0
    • M Mahesh Kulkarni

      Hi All, I have a service application which runs well on win2k3 with Local System Account. When I tried to use the same service on Win2k8 server if failed with Local System Account. It says "The service did not respond to the start or control request in a timely fashion." This service works under domain administrator account. Now I want to run the service as Local System account on win2k8 server.What and where i need to do changes? Service is developed in C++ unmanaged code. Please let me know if anymore information required. Regards, Mahesh R. Kulkarni

      The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      The problem could be anything involved with the startup of the service. Do you have access to the source code? You could add logging statements to the startup code to see where it's hanging up.

      M 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        The problem could be anything involved with the startup of the service. Do you have access to the source code? You could add logging statements to the startup code to see where it's hanging up.

        M Offline
        M Offline
        Mahesh Kulkarni
        wrote on last edited by
        #3

        Hi Richard, Thanks for the reply. I observed that it doesn't reach to service's main function also.I checked this with OutputdebugString logs. Surprisingly it works fine Domain Administrator account which can be configured by 'This Account' from service properties. And one more thing, same piece of code works on Windows 2003 Server. I suspect that there is something which changed in Windows Server 2008. But I am really stuck here. I googled a lot but can't find the pointer for this. Please let me know if you require any other information on this. Thanks in advance.

        The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

        Richard Andrew x64R 1 Reply Last reply
        0
        • M Mahesh Kulkarni

          Hi Richard, Thanks for the reply. I observed that it doesn't reach to service's main function also.I checked this with OutputdebugString logs. Surprisingly it works fine Domain Administrator account which can be configured by 'This Account' from service properties. And one more thing, same piece of code works on Windows 2003 Server. I suspect that there is something which changed in Windows Server 2008. But I am really stuck here. I googled a lot but can't find the pointer for this. Please let me know if you require any other information on this. Thanks in advance.

          The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #4

          Can you post the code that it runs at startup, if it's not too much? There must be some resource that it's trying to access that it's not being granted permission for.

          M 1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            Can you post the code that it runs at startup, if it's not too much? There must be some resource that it's trying to access that it's not being granted permission for.

            M Offline
            M Offline
            Mahesh Kulkarni
            wrote on last edited by
            #5

            Sure I will update pseudo code tomorrow. Is it ok if I mail it to you. Regards, Mahesh

            The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

            Richard Andrew x64R 1 Reply Last reply
            0
            • M Mahesh Kulkarni

              Sure I will update pseudo code tomorrow. Is it ok if I mail it to you. Regards, Mahesh

              The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

              Richard Andrew x64R Offline
              Richard Andrew x64R Offline
              Richard Andrew x64
              wrote on last edited by
              #6

              No, it would be better if you posted it here so that everyone has a chance to help you.

              M 1 Reply Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                No, it would be better if you posted it here so that everyone has a chance to help you.

                M Offline
                M Offline
                Mahesh Kulkarni
                wrote on last edited by
                #7

                void main(void)
                {
                OutputDebugString("Entering : void main(void)");
                SERVICE_TABLE_ENTRY Service_Table_Entry[] = {
                { (LPTSTR) SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION) ServiceMain },
                { 0, 0 },
                };
                hThread = NULL; // Thread for the actual work
                hServiceEventDone = NULL; // Event used to keep ServiceMain from completing
                hThreadServiceDone = NULL; // Event set by ServiceThread indicates exited

                StartServiceCtrlDispatcher(Service\_Table\_Entry)
                OutputDebugString("Exiting : void main(void)");
                

                }

                This is the entrypoint of the service. If I run this service by Domain\administrator account debugview shows "Entering : void main(void)" entry. But, When I try to run this service as Local System Account it not even reaches to "Entering : void main(void)" statement. Thanks in advance. Mahesh R. Kulkarni

                The secret of life is not enjoyment but education through experience. - Swami Vivekananda.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups