View Single Post
Old 03-16-2011, 09:04 AM   #15
mathia began at the beginning.
Posts: 12
Karma: 10
Join Date: Mar 2011
Device: Nook Color
The srvany method seems to work well, however, I was not able to get it to work. Looking back at that experience, I think I see where I went wrong. Mostly being an IT guy for a long time, I think I probably outsmarted myself. ANYWAY...having failed to get that working, I kept looking for another solution. I found that solution in a program called ServiceEx.

It claims to be better than/different from the srvany method in that it can restart a service that has failed. I can't speak on that as I never actually got the srvany method to work. I would assume that the srvany methode gives you those options in the services console, but I don't know for sure.
The steps
1. download ServiceEx to a folder of your own choosing. There is no install, just the executable
2. download the ini file from the ServiceEx website to the same directory as the executable and modify to your needs. It doesn't have very many options and most are self explanatory. The ini file should be the name you have chosen to call your service. I, for example, chose the name cailbre-english and named my ini calibre-english.ini I am including a copy of mine at the end of this as an example. The instructions for getting it working are comments in the ini file.
3. Once you have all the options set to your liking, go to a command prompt, change to the directory where ServiceEx resides, and run the command. Mine looked like this:
serviceex.exe install calibre-english
This will set up the service with the name you chose and the options that were set in the ini file. If you didn't set the option in the file to start up the service at install, you will have to start it manually. This can be done via the command line (net start service-name) or via the services console.
One final note. The included documentation says that if you make changes to the ini file, you will have to uninstall and reinstall the service. For the more tech savvy among you, the parameters of the service can be modified directly within the registry (HKEY_Local_Machine\System\CurrentControlSet\Servi ces and look for the name of your service), then the service will need to be stopped and restarted for the changes to take effect.
To have the service restart after a failure, just go to the service console, choose the recovery tab, and set your recovery options.
If anyone decides to choose this method, I would be more than happy to assist as much as I can.
My ini file (settings only):
ServiceExeFullPath = "C:\Program Files\calibre2\calibre-server.exe"

; program arguments to be sent to executable
options =-p 8081 --with-library "c:\calibre library"

; can program interact with desktop [true | false] (default: true)
desktop = false

; start type (valid values: Auto Manual Disabled) (default: auto)

; start the service upon installation [true | false] (default: no)
mathia is offline   Reply With Quote