http://qs321.pair.com?node_id=760179


in reply to Perl script as daemon

service ... start

A bit vague but sounds like you're trying to run your daemon on windows. If so, check Turn a perl script into a Win32 Service and references therein.

Otherwise, please show some code and/or error messages.

Replies are listed 'Best First'.
Re^2: Perl script as daemon
by Bloodnok (Vicar) on Apr 26, 2009 at 20:37 UTC
    Hmmm, just voted up your post then saw This runs fine as an executable (linux),... in the OP ... so, no Windoze there then, so we're talking an OS - not a pretend one ;-D

    A user level that continues to overstate my experience :-))

      Yep, saw that too but I guessed that the OP transferred the script to windows when I read "service ... start"

      Of course, now that I think about it, some (all?) modern linux distributions use a GUI for services so you're probably right and I tried to answer the wrong question. Certainly wouldn't be the first time.

        Hi, thanks for the replies. Yes I think its that stdin/out are not available to the service. The command is basically an `snmpwalk` that should run and return the result which my script deals with. I've also tried using in/out pipes while getting another file to run the snmp, but the syswrite isnt sending anything. Arghhh sorry for the vagueness I haven't the code with me atm. Dave.
Re^2: Perl script as daemon
by afoken (Chancellor) on Apr 27, 2009 at 20:55 UTC

    Some Linux distros (RH?) have a "service" command, too. But it is not standard and non-portable.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)