Well, there are obvious things like not having a D: drive... But anything that would cause that open to fail would give that symptom, for example, perhaps the credentials of the service don't have access to append to that file (for example, if D: is a remote file system, then the service probably won't have any access to it no matter what permissions you set on the file).

Or perhaps you were looking at the file using a tool that opened the file w/o specifying shared access so that the daemon couldn't open it.

I'd first check that the script manages to write to the daemon.err file when run not as a service as well as when run as a service with the "user Blarfle;" line commented out. That should narrow things down quite a bit.

You could also use try other methods for getting the "invisible error" to not be invisible such as:

open(...) or system( "net send %computername% " . qq("Can't open d:/daemon.err: $!; $^E") );
(though I don't think that will work from a service either) or using something to pop up a message box (this should work if you configure the service to have access to the interactive desktop).

It is sad that the WinNT Service Manager is so stupid when it comes to noticing and reporting that the service that it started has died. But then, if you look very far into the design of the service manager (called "the SCuM"), you quickly realize that it isn't a very good design in a lot of ways (just ask the guys who had to hack it to pieces to make it even usable for "clustering" -- "dogfood" indeed). /:

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: Win32::Daemon by tye
in thread Win32::Daemon by Macphisto

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.