get_iplayer as a service on Windows

dinkypumpkin dinkypumpkin at gmail.com
Sat Jun 9 16:37:09 EDT 2012


On 09/06/2012 14:47, Red Sam wrote:
> Hi,
>
> Has anyone successfully set up get_iplayer Web PVR Manager on Windows as a
> Service?
>
> I've tried the following command to create a service:
> sc create "iPlayer Web PVR Manager" binPath= "C:\Program
> Files\get_iplayer\get_iplayer.cgi.cmd"
>
> On hitting Start in Services I get the following error:
> Error 1053 - The service did not respond to the start or control request in
> a timely fashion

I should first point out that the web pvr batch script limits 
connections to the local machine, so I'm not sure I see the advantage in 
running as a windows service.  You'll have to be logged in to that 
machine in order to use the web pvr, so you're not even saving a click 
on your Start menu.  Hardly seems worth the headaches.  If you're trying 
to share the web pvr across a LAN, I think you might be better advised 
to install it as a CGI application with Apache.

That said, on to the issue you raised.  I've never tried this, but here 
are some general observations:

get_iplayer.cgi.cmd is just a batch script, so it doesn't implement the 
functions necessary to interact with the windows service control 
manager.  That's why you see that error.  However, the batch script 
should still be launched (but probably not successfully - see below), so 
check it with your browser regardless of what the service control 
manager reports.  Although the web pvr may start, you won't be able to 
stop the web pvr via the service control manager.  You'll need to kill 
the perl.exe process in Task Manager to stop it.

An alternative is to employ a wrapper application that acts as windows 
service and handles starting/stopping the batch script.  Google for 
"SrvAny".  It was part of the Windows 2003 resource kit, but other 
versions are floating around the internet.  There are probably other 
similar applications as well.  No idea if it will work in this case.

I also don't think you can use the web pvr batch script as-is.  If you 
look inside it, you'll see that it assumes it is being invoked with the 
current working directory already set to the get_iplayer installation 
directory (usually "C:\Program Files\get_iplayer"), which won't be the 
case for a system service.  I think you'll need to adjust the batch 
script by adding 'CD "C:\Program Files\get_iplayer"' before the call to 
perl.exe.

The default location for get_iplayer downloads will be a folder in the 
desktop of the user who installed it, so you would need to run the 
service with your user credentials rather than LocalSystem in order to 
access that folder.  I might be better to have a special user for the 
service and a dedicated downloaded location with the necessary 
permissions.  Basically, you just need to make sure the service 
credentials allow it to write to wherever downloaded programmes should 
go. You can override the download folder in the Recording settings of 
the web pvr if you want to use a different location for the service.



More information about the get_iplayer mailing list