This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Using Cygwin to build a system service under NT


Has anyone used cygwin to build a system service under NT? I am
having the following problem, after I built my system service:

: It installs fine and I can start the service from the Service Controller
: Once it is started, I cannot run ANY cygwin program. I get the foll.
  error:
  (unknown) shared_init: CreateFileMappingA
  cygwin: terminating

: I believe it is working fine - I just cannot launch another cygwin
  program while it is running.

: If I stop the service from the Service Controller and run the
  service program as a console app (debug mode), everything is fine.


I have the exact same problem if I launch a cygwin built console app
from a system service program built using MSVC. What am I doing wrong?

I've attached snippets of the system service functions and would be
happy to mail a simple test case (the Simple Service program that
comes with MSVC)  which demonstrates the problems, if
someone wants it. It's about 1k lines.

Thanks a lot,

Shankar
shankar@viman.com


---
    SERVICE_TABLE_ENTRY dispatchTable[] =
    {
        { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main },
        { NULL, NULL }
    };
---
        if (!StartServiceCtrlDispatcher(dispatchTable))
            AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
---
    sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);

---
        schService = CreateService(
            schSCManager,               // SCManager database
            TEXT(SZSERVICENAME),        // name of service
            TEXT(SZSERVICEDISPLAYNAME), // name to display
            SERVICE_ALL_ACCESS,         // desired access
            SERVICE_WIN32_OWN_PROCESS,  // service type
            SERVICE_DEMAND_START,       // start type
            SERVICE_ERROR_NORMAL,       // error control type
            szPath,                     // service's binary
            NULL,                       // no load ordering group
            NULL,                       // no tag identifier
            TEXT(SZDEPENDENCIES),       // dependencies
            NULL,                       // LocalSystem account
            NULL);                      // no password
---
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]