Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-24-2016, 11:38 AM   #1
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
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?
johnelle is offline   Reply With Quote
Old 04-24-2016, 12:18 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by johnelle View Post
I can't get this to work. Its as if the server command ignores the database override.

Does anybody have this working?
Yes, on Debian.

Don't forget that you must export the environment variable. I use
Code:
export CALIBRE_OVERRIDE_DATABASE_PATH=blablabla
chaley is offline   Reply With Quote
Advert
Old 04-24-2016, 12:19 PM   #3
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: 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.
kovidgoyal is offline   Reply With Quote
Old 04-25-2016, 06:13 AM   #4
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
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.
johnelle is offline   Reply With Quote
Old 04-25-2016, 08:16 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by johnelle View Post
Is somebody actually using both the OVERRIDE_PATH and the --with-library successfully on Linux?
Yes, as I noted above, on Debian.

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
My library comes from a Windows calibre installation. Occasionally I have problems with letter case, but I fix them on the Windows side.
chaley is offline   Reply With Quote
Advert
Old 04-25-2016, 09:23 AM   #6
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
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
The database override is defined in /etc/environment
Code:
CALIBRE_OVERRIDE_DATABASE_PATH="/media/cdb/metadata.db"
which is Win10 shared folder on a desktop shared with at least one laptop and working.

I don't understand why you would copy the .db file every time you boot(?)
johnelle is offline   Reply With Quote
Old 04-25-2016, 09:35 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by johnelle View Post
I don't understand why you would copy the .db file every time you boot(?)
My library is synced by dropbox, so it can change at any time. I use monit to deal with restarting calibre whenever necessary, including at boot.

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.
chaley is offline   Reply With Quote
Old 04-25-2016, 11:02 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 04-26-2016, 02:35 PM   #9
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 2137668
Join Date: Mar 2015
Location: Groton, MA
Device: Kindle app on Samsung Tab
Quote:
Originally Posted by eschwartz View Post
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.
Well I already tried putting it the Upstart script and than didn't work either.
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
johnelle is offline   Reply With Quote
Old 04-26-2016, 03:10 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 04-26-2016, 03:51 PM   #11
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
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
johnelle is offline   Reply With Quote
Old 04-26-2016, 03:55 PM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.)
eschwartz is offline   Reply With Quote
Old 04-26-2016, 04:05 PM   #13
johnelle
Zealot
johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.johnelle ought to be getting tired of karma fortunes by now.
 
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.
johnelle is offline   Reply With Quote
Old 04-26-2016, 04:09 PM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,775
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by johnelle View Post
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
As far as I can tell from the man pages, that exports nothing. The "env" command seems to set the environment in a subshell. Try deleting all occurences of "env", for example leaving
Code:
LIBRARY_PATH='/mnt/synnas/Books/Calibre'
instead of
Code:
env LIBRARY_PATH='/mnt/synnas/Books/Calibre'
Then do the export.

Alternatively do
Code:
export CALIBRE_OVERRIDE_DATABASE_PATH=/media/cdb/metadata.db
chaley is offline   Reply With Quote
Old 04-26-2016, 06:28 PM   #15
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

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


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


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