Windows Perl Scripting Forums » General

Win32::Daemon?

(7 posts)
  • Started 3 years ago by vyoufinder
  • Latest reply from zhu zhu hamster

  1. vyoufinder
    Member

    I admit I am new to all this but I am willing to learn patiently. I need the daemon for installing Webmin on my Windows 2000 based server and the link at http://www.roth.net/perl/Daemon/ is listed as being:

    ftp://ftp.roth.net/pub/ntperl/Daemon/20020606 but it is not working - is there a new link or place I can download it?

    Second question is that I don't know how to install it. Am I supposed to place it in a specific folder and then tell Windows to run it as a service? Little help please?
    Posted 3 years ago #
  2. Dave
    Perl guy

    The easiest way to install it is to use Perl's Package Manager (PPM). Chane into the Perl bin directory (usually c:\perl\bin) and run:

    ppm install http://www.roth.net/perl/packages/win32-daemon.ppd



    That should auto-install the win32::daemon extension and you are ready to go!

    Alternatively you can do the manual work and download it from the URL you cited. However you may need to tell your FTP client to use passive mode. If you are still blocked from getting that use your web browser:
    http://www.roth.net/ftp/pub/ntperl/Daemon/20020606/

    dave
    Posted 3 years ago #
  3. vyoufinder
    Member

    I think those directions are the same as on your site?! I went to the directory where I have perl installed. Where would I type that line of code?

    I have also downloaded the files and unzipped but there doesn't appear to be an install program. The files I get when I unzip are:

    daemon.pm
    Win32-daemon.ppm
    bin\daemon.pl
    test\autostart.pl
    test\daemon.pl
    test\Create.pl
    test\Daemon_Template.pl

    What do I do with those files to have it installed?

    Thanks for the prompt reply and help thus far!
    Posted 3 years ago #
  4. vyoufinder
    Member

    I don't know where to type in that line of code - am I supposed to open a program or something like that? It's really not any clearer than before. Can you offer any help anyone?
    Posted 3 years ago #
  5. Dave
    Perl guy

    You want to run the PPM command (see above) from a command line prompt. With your mouse press the "Start" button (lower left of your screen) then select the "Run" option. In the resulting dialog window type in

    cmd.exe

    then hit enter.
    This will open a "command box" where you can type in commands (this is sometimes called a DOS box). Once you have done that type in:

    c:

    then hit the enter key
    Next type in

    cd \perl\bin

    then hit the enter key
    Finally type in

    ppm install http://www.roth.net/perl/packages/win32-daemon.ppd

    and it should auto-download and auto-install the Win32::Daemon extension.
    Posted 3 years ago #
  6. vyoufinder
    Member

    That worked! Wow! Thank you very much for your patience with me! I really appreciate it and thank you thank you thank you! Chuc Mung Nam moi!
    Posted 3 years ago #
  7. Assuming that Perl.exe is in c:\perl\bin and the service script is c:\perl\scripts\service.pl then this script will install the script as a service. Since no user is specified it defaults to the LocalSystem.

    use Win32::Daemon;
    %Hash = (
    name => 'PerlTest',
    display => 'Oh my GOD, Perl is a service!',
    path => 'c:\perl\bin\perl.exe',
    user => '',
    pwd => '',
    parameters =>'c:\perl\scripts\service.pl',
    );
    if( Win32::Daemon::CreateService( \%Hash ) )
    {
    print "Successfully added.\n";
    }
    else
    {
    print "Failed to add service: " . Win32::FormatMessage( Win32::Daemon::GetLastError() ) . "\n";
    }

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.