in reply to Re: Win32::Daemon service doesn't reach RUNNING state
in thread Win32::Daemon service doesn't reach RUNNING state

Ok.

As I said, I just wanted to create a simple daemon, with a few lines of code as possible. But it seems that few under Windows is quite much ;)

Kind regards

--
zejames
  • Comment on Re^2: Win32::Daemon service doesn't reach RUNNING state

Replies are listed 'Best First'.
Re^3: Win32::Daemon service doesn't reach RUNNING state
by BrowserUk (Patriarch) on Sep 14, 2004 at 11:35 UTC

    Explain what you mean by "a daemon"?

    If you just mean a background task, that's a lot easier than creating a service--which has the daemon-like properties of running detached but is an aweful lot more besides.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      Yeah, I just meant "a background task"...

      I had a look at Proc::Daemon, but it does not seem to run under Windows. However, I would be very grateful if such a module existed for Windows.

      Kind regards


      --
      zejames

        Depending what it is that your actually trying to achieve, it could be as simple as:

        P:\test>start /b perl -le"open LOG, '>', 'my.log'; select LOG; $|=1; print ~~localtime while sleep 10" 1>nul 2>&1 <nul P:\test>u:tail -f my.log Tue Sep 14 12:11:10 2004 Tue Sep 14 12:11:20 2004 ^C

        The "one-liner" (here split across multiple lines to avoid wrapping) could be just about any perl script you like. It runs in the background, has it's STDIN, STOUT and STDERR redirected to the nul device and will continue to run until terminated through the task manager or other mechanism.

        Proc::Daemon does a couple of other things--changing the umask (whatever that is) etc.-- but nothing that you cannot easily do yourself.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon