I have been trying to get dbiproxy to run as a service on one of our PC's so we can access Windows resources from Unix. I have had no problem getting it to run and work great, if I run it manually from a shell. I want to run it as a service so it will come up when we reboot and so it doesn't block the PC by consuming the login.

I have spent a lot of time getting it to run as a service. I eventually have been successful running it as a service using Windows srvany.exe (Windows doc) and some registry updates on Windows XP SP3. I am pretty sure it is actually running because I see my port listening when running netstat -a and the fact that it appears to be an error message from dbiproxy (see code section below).

For some reason, on the dbiproxy box, if I run dbiproxy from a shell and leave it running, it works great. But when run as a service I get this message (starred specifics in message).

DBI connect('hostname=*******;port=36502;dsn=dbi:ODBC:driver=Microsoft + Access Driver (*.mdb, *.accdb);dbq=*******','',...) failed: Cannot l +og in to DBI::ProxyServer: Refused by server: User is not permitted +to connect. at /*******/usr/local/lib/perl5/site_perl/5.10.0/RPC/PlCl +ient.pm line 82. at ./testDbiProxy.pl line 9

I can run both the service and the command line on two different ports at the same time. The one from the command line has no problems, but my service gives this error. I run the exact same client code with the exception of the port number.

One co-worker suggested that maybe my service was running as SYSTEM. I reconfigured the service to run as my userid (and separately as a application user id we use internally here), but I get the same error.

Is there something else in the "Windows service sandbox" that I don't understand and is causing this error?

Any ideas how to approach solving this problem?

Is there any better way to try doing what I am trying to do?

Here is the content of the *.bat file I created to start dbiproxy from the command line and from srvany (with varying ports for testing)

C:\cygwin\bin\perl C:\cygwin\usr\local\bin\dbiproxy --localport 36503 --logfile C:\cygwin\home\*******\dbiproxy.log --mode fork --debug

BTW, I did search google and monks for this same error. No solid leads from google. Found literally this exact problem asked here with no answers in 2005. Starting dbiproxy as a Win32 Service


In reply to Running dbiproxy as a service on Windows by RandomMonkey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.