Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2017, 09:15 PM   #1
GreyFreeman
Junior Member
GreyFreeman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2017
Device: NVidia Shield Tablet K1
Running Calibre 3.6 as a Service

I've been running Calibre as a service on my Windows server. I've been using NSSM to wrap the command and register the service and it's been working great.

This week, I upgraded to 3.6 and those services were no longer functional. I checked out the documentation, and it quickly became obvious that the calibre-server interface had changed. So I rebuilt my service using the new parameter and I thought I'd be good. Unfortunately, I keep failing with an error that it can't find my library.

I can start the service manually with this command:

calibre-server --port 9999 --enable-auth "D:\Full"

... but when I use those same parameters in NSSM, and try to start the resulting service, the error shows:

There is no calibre library at: D:\Full.

I've tried about a dozen ways to say "D:\Full" but none of them work. Does anyone have an idea why this isn't working? Is there a similar service wrapper that works better? What I'm trying to accomplish is an automatic service start that doesn't require me logging onto the server.

Thanks!
GreyFreeman is offline   Reply With Quote
Old 08-21-2017, 10:02 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have no experience with nssm but couple of things to try:

1) D:/Full

2) Check that whatever user NSSM runs the server as has permission to access D:\Full
kovidgoyal is offline   Reply With Quote
Old 08-22-2017, 01:15 AM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by GreyFreeman View Post
Is there a similar service wrapper that works better?
I've seen a couple of posts that mention AlwaysUp,

So, I searched for 'calibre alwaysup' and found this ==>> How to Run Calibre Server as a Windows Service | AlwaysUp

AlwaysUp ain't free.

BR
BetterRed is online now   Reply With Quote
Old 08-22-2017, 08:11 PM   #4
GreyFreeman
Junior Member
GreyFreeman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2017
Device: NVidia Shield Tablet K1
FWIW, I was not able to make this work with NSSM and any version of the folder name or permissions changes. I even tried to get it running in other folders to make it simpler, but no dice. I'm theorizing that NSSM simply doesn't like that some of the parameters are now simply flags and not name/value pairs.

For now, I'm just using the built in auto-start server that comes with the UI, and I simply placed Calibre in the start-up group. I guess it won't kill me to log in, but I might try AlwaysUp if it becomes a problem.
GreyFreeman is offline   Reply With Quote
Old 08-22-2017, 08:55 PM   #5
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,166
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Since nssm documentation mentions it supports a script, why not make a batch or cmd file to launch Calibre server?

Sent from my Nexus 7 using Tapatalk
PeterT is offline   Reply With Quote
Old 08-23-2017, 10:36 AM   #6
aCIDsLAM
Enthusiast
aCIDsLAM began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2016
Device: Xiaomi MI Pad 1, LineageOS14.1
Quote:
Originally Posted by GreyFreeman View Post
FWIW, I was not able to make this work with NSSM and any version of the folder name or permissions changes. I even tried to get it running in other folders to make it simpler, but no dice. I'm theorizing that NSSM simply doesn't like that some of the parameters are now simply flags and not name/value pairs.

For now, I'm just using the built in auto-start server that comes with the UI, and I simply placed Calibre in the start-up group. I guess it won't kill me to log in, but I might try AlwaysUp if it becomes a problem.

Maybe my config line will help you.
This is how i run calibre thorugh nssm:

nssm install CalibreServer "C:\Program Files\Calibre2\calibre-server.exe" --enable-auth B:\Calibre-Bibliothek --ssl-certfile B:\Calibre-Bibliothek\calibre-crt.pem --ssl-keyfile B:\Calibre-Bibliothek\calibre.key.pem --disable-use-bonjour --max-jobs 64 --worker-count 64 --max-job-time 600 --timeout 600

The user u specify in running the service will be used for the configuration pfad:
AppData\Roaming\calibre So using the default system user, will fail to read the settings.

You should use a dedicated service user, in which you set your calibre settings and give it full access to your Library Folder on Harddisk.

I used a user called service_calibre and all the configs are stored here:
C:\Users\service_calibre\AppData\Roaming\calibre

Gave it full rights to harddisk folder and there you go and start the service as that user

Last edited by aCIDsLAM; 08-23-2017 at 10:40 AM.
aCIDsLAM is offline   Reply With Quote
Old 08-25-2017, 09:30 PM   #7
GreyFreeman
Junior Member
GreyFreeman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2017
Device: NVidia Shield Tablet K1
Solved

Okay, I got this running. I'm pretty sure it was a permissions issues like Kovid suggested. Maybe several. I have a few lessons learned:

1. If you specify an account to run the service, you have to include the full machine name (e.g. SERVER01\user01).
2. If there is an "&" in your password, it will probably break the command string. If the UI is just constructing and running a command string, it'll probably have the same issues.
3. Each user profile on the machine has its own Calibre user database. I used the nifty UI tool to build my user database and their restrictions, logged in as an Admin account. I then tried to run the service with a service account. Those users no longer existed for that account.

That last one really threw me for a loop. I'm not sure I understand why that's the chosen architecture but, obviously, once you know it, you can work with it.

Thanks for all the suggestions.

EDIT: I should note that aCIDsLAM attempted to explain some of that to me. Apparently, I had to figure it out myself for it to stick. :-)
GreyFreeman is offline   Reply With Quote
Old 07-12-2023, 09:44 PM   #8
arcegabriel
Member
arcegabriel began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jun 2017
Device: Android
Anybody has some instructions on how to do this. I tried the commands from aCIDsLAM but I am getting an error on starting the service. NSSM commands complete successfully, no issue
I am not using a "service account" (I don't have one). I simply didn't enter one and assume it will use the current user. Works well for node-red.
The error I get
"Windows Could not start the calibreserver service on local computer. The server did not return an error.
Do I also need nssm ... AppDirectory or AppParameters lines
Appreciate assistance, thanks

Update. Got it working
1. Run manually calibre server to ensure all your parameters are good and any other issues. I had a typo and also a Firewall permission request to accept
2. Remember to quit calibre GUI
3. I did enter login information for the service for it to work
4. No need to enter AppDirectory or AppParameters

Last edited by arcegabriel; 07-13-2023 at 08:24 AM.
arcegabriel is offline   Reply With Quote
Reply

Tags
nssm, service


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Calibre 3 running on Raspberry Pi 3 running Raspbian Jessie? fivestones Calibre 6 01-25-2018 09:41 PM
Using Cloud Service with Calibre Companion vs a Local Calibre Server varaonaid Calibre Companion 26 04-10-2016 01:55 AM
Running Calibre content server as a service mathia Related Tools 31 07-04-2011 09:34 AM
Anyone running calibre on Centos 5.3? merzy Calibre 7 06-06-2009 02:01 AM
Running Calibre (0.4.77) dsb66 Calibre 9 07-18-2008 04:42 AM


All times are GMT -4. The time now is 05:58 PM.


MobileRead.com is a privately owned, operated and funded community.