in reply to Re^3: Perl script as windows service
in thread Perl script as windows service

can someone explain the purpose of the following and how is it being utilized in the code:
parameters => ( sprintf '"e:/dia/temp/service.pl" --run', $scriptPath, $script ),
start_type => SERVICE_AUTO_START,

Replies are listed 'Best First'.
Re^5: Perl script as windows service
by m-rau (Scribe) on Mar 09, 2005 at 13:17 UTC
    Installing a service tells win32 where to find the executable. The executable is actualle Perl. Therefore this $^X. The script that actually implements the service is a parameter to Perl. The code implements service.pl as the service controller: it is capable of installing, removing, starting etc. the script. Furthermore, service.pl is the service itself if it is invoked with the --run parmater. The code
    parameters => ( sprintf '"e:/dia/temp/service.pl" --run', $scriptPath, + $script ),
    is actually misleading, because the path and script are hard-coded. Hence, you can write it as
    parameters => '"e:/dia/temp/service.pl" --run'
    The start_type tells the win32 service manager to automatically start-up the script. This means, no user must be logged in. This latter thing is actually one of the main reasons to use services on win32.