04-24-2016, 11:38 AM | #1 |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
DATABASE_PATH not working for Calibre Server?
I have been using CALIBRE_OVERRIDE_DATABASE_PATH for a while now to speed up my NAS based library. Have at least two Win 10 machines using it (not at the same of course) on a regular basis.
However my Ubuntu based server is busted. I have tried from the command line and from the existing upstart to define both --with-library=<point to NAS directory> and CALIBRE_OVERRIDE_DATABASE_PATH=<points to metadata.db> Both directories are locally mounted via fstab. I can't get this to work. Its as if the server command ignores the database override. Does anybody have this working? |
04-24-2016, 12:18 PM | #2 |
Grand Sorcerer
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
Advert | |
|
04-24-2016, 12:19 PM | #3 |
creator of calibre
Posts: 44,001
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That environment variable is used in the database backend layer which is common to all calibre executables, if it is being ignored then you likely have not actually set it in your server';s environment.
|
04-25-2016, 06:13 AM | #4 |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
Well I am defining the OVERRIDE_PATH in /etc/environment and its valid and so is the library path but it is definitely not working.
No errors in the log(s) far as I can see. One theory would be that the .db keeps a path to the directories for the books (?) which in my case is a Windows path which would be invalid on the Ubuntu machine. Is somebody actually using both the OVERRIDE_PATH and the --with-library successfully on Linux? Last edited by johnelle; 04-25-2016 at 06:37 AM. |
04-25-2016, 08:16 AM | #5 | |
Grand Sorcerer
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Removing all the cruft that comes with init.d scripts, what runs is approximately Code:
export CALIBRE_OVERRIDE_DATABASE_PATH=/tmp/metadata.db CONTENT=path-to-library cp $CONTENT/metadata.db $CALIBRE_OVERRIDE_DATABASE_PATH calibre-server --with-library path-to-library -p 9192 --max-opds-ungrouped-items=200 --url-prefix /library |
|
Advert | |
|
04-25-2016, 09:23 AM | #6 |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
Well I am kinda-debian / Ubuntu
I am using upstart instead which worked fine before I moved the .db s Code:
start on runlevel [2345] stop on runlevel [^2345] respawn env USER='<user>' env PASSWORD='<pass>' env LIBRARY_PATH='/mnt/synnas/Books/Calibre' env PORT='<myport>' script exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \ --port $PORT --username $USER --password $PASWORD Code:
CALIBRE_OVERRIDE_DATABASE_PATH="/media/cdb/metadata.db" I don't understand why you would copy the .db file every time you boot(?) |
04-25-2016, 09:35 AM | #7 | |
Grand Sorcerer
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The reasons are both historical and from paranoia. The historical reason: calibre-server before V2 didn't see changes in the metadata.db file, so calibre *had* to be restarted to see changes. This isn't true now. The paranoia reason: I don't want to get into situations where the server has a detached file. If dropbox uses "unlink and recreate" instead of "overwrite" then the server won't ever see changes. In addition, I don't want to deal will permission hassles or locking. |
|
04-25-2016, 11:02 AM | #8 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I don't think upstart reads environment variables from /etc/environment
Why are you putting it there anyway -- it makes much more sense to declare it in the one place you are actually using it. |
04-26-2016, 02:35 PM | #9 | |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
Quote:
Code:
env USER='<user>' env PASSWORD='<pass>' env LIBRARY_PATH='/mnt/synnas/Books/Calibre' env CALIBRE_OVERRIDE_DATABASE_PATH='/media/cdb/metadata.db' env PORT='888' script exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \ --port $PORT --username $USER --password $PASSWORD end script |
|
04-26-2016, 03:10 PM | #10 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You still didn't export it.
Last edited by eschwartz; 04-26-2016 at 03:19 PM. |
04-26-2016, 03:51 PM | #11 |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
Ok so now it's exported. Makes no difference. Still doesn't work
Code:
respawn env USER='<user>' env PASSWORD='<pass>' env LIBRARY_PATH='/mnt/synnas/Books/Calibre' env CALIBRE_OVERRIDE_DATABASE_PATH='/media/cdb/metadata.db' env PORT='888' script export CALIBRE_OVERRIDE_DATABASE_PATH exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \ --port $PORT --username $USER --password $PAS$ end script |
04-26-2016, 03:55 PM | #12 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well then I don't know. It works without upstart, and I don't know enough about upstart to figure out the problem.
(The /etc/environment tip came from google.) |
04-26-2016, 04:05 PM | #13 |
Zealot
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
|
Not from the command line either
I have also tried it directly from the command line and am getting "database is locked" after a minute.
|
04-26-2016, 04:09 PM | #14 | |
Grand Sorcerer
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
LIBRARY_PATH='/mnt/synnas/Books/Calibre' Code:
env LIBRARY_PATH='/mnt/synnas/Books/Calibre' Alternatively do Code:
export CALIBRE_OVERRIDE_DATABASE_PATH=/media/cdb/metadata.db |
|
04-26-2016, 06:28 PM | #15 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
chaley, I originally made a very snarky reply along the same line. Then I did more googling and realized upstart uses a syntax which looks like bash but most certainly isn't.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Working!-Running full Calibre GUI and server on Synology | bthoven | Related Tools | 63 | 08-23-2020 10:52 PM |
Calibre Server and Avahi on Ubuntu not quite working as planned | kharntiitar | Devices | 12 | 01-03-2017 07:04 PM |
Bug? Since calibre 2.0 Content Server (full) not working on ereader | alphane | Calibre | 0 | 09-21-2014 09:17 PM |
calibre-server OPDS catalog - manual move to web server | HaakonME | Related Tools | 5 | 09-21-2012 03:11 AM |
500 Internal Server Error accessing content server Calibre 0.8.8 | DaddyO57 | Calibre | 1 | 07-20-2012 06:08 PM |