View Single Post
Old 12-07-2011, 12:47 PM   #16
ProNetGuru
Junior Member
ProNetGuru doesn't litterProNetGuru doesn't litter
 
Posts: 1
Karma: 110
Join Date: Dec 2011
Device: iPad, Moto Xoom
Windows Service Solved

As an IT guy, I couldn't believe that it was impossible to get Calibre running as a service on system start-up. And while the scheduled task or registry Run key hack were ok, I really preferred it to be running as a service on my home server. After a few weeks of research and lots of trial and error, I now have a working solution. It's been up and running on my home server for a few weeks now with no issues.

I'm running Windows Server 2008 R2 at home, so this solution should also work with Windows 7, although I haven't tested it on any other operating system so if you have success, please let everyone know.

While this has worked fine for me, there are no guarantees that it will work well for you and I accept no responsibility for anything that goes wrong.

Please read this entire post before trying to complete the steps below!

Here's how I made it run as a service:
  1. Ensure that you have Calibre installed and know both the path to calibre-server.exe and the path to your library.
    The path to the Calibre executable can be found by right-clicking the Calibre icon (on either the start menu or desktop) and selecting properties (the path is in the target box). You can find the path to your library by opening the Calibre application and clicking the Calibre button in the toolbar.
  2. Download WinServ from this location: http://www.sw4me.com/wiki/Winserv and extract all files in the archive onto your hard drive.
    WinServ is an open-source, command-line utility which enables you to run standard executables as services in a Windows OS.
  3. Open a command prompt (hold the Windows key and press R to open the run box, then type CMD and click OK)
  4. Change the current directory to the location where you extracted WinServ.
  5. Type the following command:
    Code:
    winserv.exe install CalibreServer -displayname "Calibre Server Service" -description "Calibre2 Web Server for hosting ebooks to tablets and other portable reading devices." -start auto <type full path to calibre-server.exe surrounded by double quotes> <enter any arguments here>
    As an example, the command I used to install the service looked like this:
    Code:
    winserv.exe install CalibreTest -displayname "Calibre Test" -description "Calibre2 Web Server for hosting ebooks to tablets and other portable reading devices." -start auto "C:\Program Files (x86)\Calibre2\calibre-server.exe" --port 8080 --username <omitted> --password <omitted> --with-library="E:\Shares\Calibre"
  6. Make sure that you include the --with-library argument unless you specify that the service should run/start under your user account. By default, the service will run using the Local System account, which will not know where your Calibre library is located.
  7. Start your new service by typing "net start CalibreServer" in the command prompt window and pressing return (omit the quotes).

You can find documentation on the calibre-server.exe arguments here: http://manual.calibre-ebook.com/cli/...erver--version

Hopefully this works for everyone else. If you run into issues, I'll try to help as best as I can as time allows.

Last edited by ProNetGuru; 12-07-2011 at 01:11 PM.
ProNetGuru is offline   Reply With Quote