|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
Issues with environment variable CALIBRE_OVERRIDE_DATABASE_PATH on headless Ubuntu
Using a Ubuntu 19.10 install. New to the forum, so please let me know if formatting needs adjusting.
I am able to add books to the library with the below and have verified the db is where I need it, outside of the library directory: Code:
CALIBRE_OVERRIDE_DATABASE_PATH=/home/a_real_person/calibre-library/db/metadata.db calibredb add /home/a_real_person/calibre-data/test_read/* --library-path /home/a_real_person/calibre-data/test_write Quote:
https://manual.calibre-ebook.com/ser...n-linux-system The same error is returned when running as a command: Code:
CALIBRE_OVERRIDE_DATABASE_PATH=/home/a_real_person/calibre-library/db/metadata.db /opt/calibre/calibre-server /home/a_real_person/calibre-data/test_write I've tried setting the environment variable in two places: /etc/environment and ~/.profile Running printenv returns what I'd expect: CALIBRE_OVERRIDE_DATABASE_PATH=/home/a_real_person/calibre-library/db/metadata.db Also tried using this to set the environment variable, but calibre-server doesn't seem to like that: systemctl edit calibre-server.service Using the portable version proved to be a bit too complicated for me to use at this point. An official calibre github entry posted a while ago detailed that the portable version locks the files for exclusive app access. This seemed to be the case for me. One may respond saying that you simply need to edit the variable needed and leave the rest 'as is', though the portable version seems to introduce more than my linux skills understand at this point. I'm open to using it again, though I'd prefer to see a simple service work with a custom db directory. /opt/calibre/resources/calibre-portable.sh I've also tried setting a custom shell script where the environment variable is defined there, detailed in the below forum thread. I do see forum threads complaining of the same problem in the Ubuntu/linux OS, though haven't come across one where the OP reports it to start working. Please refer me to one (headless Ubuntu/Debian) if it is known. I've tried the approach offered here, with no success: https://www.mobileread.com/forums/sh...d.php?t=273420 I don't see the logic in this suggested line: Code:
cp $CONTENT/metadata.db $CALIBRE_OVERRIDE_DATABASE_PATH A VPS is used for this, so it has been pretty quick to wipe the OS and rebuild it to test in-between a few of these attempts. Help on this would be appreciated. |
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The server is not going to work with that, it serves up multiple libraries. CALIBRE_OVERRIDE_DATABASE_PATH basically limits calibre to using a single library. It *might* work if you specify that single library as a server command line argument but this is not really tested/supported.
What portable version are you talking about. There is no official portable version for linux. Why do you want the db outside the library folders. The original intent for this hack is for when libraries are on slow external media. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
My use case is 1 library only. In this way, am I correct in assuming it should work?
I had specified portable version above (/opt/calibre/resources/calibre-portable.sh). I was testing running calibre-portable.sh in a systemd service, though I may have not been using it as intended. The script is introduced by saying it supports Linux - this is a copy/paste from that file: Code:
# Calibre-Portable.sh # ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ # # Shell script File to start a Calibre configuration on Linux # giving explicit control of the location of: # - Calibre Program Files # - Calibre Library Files # - Calibre Config Files # - Calibre Metadata database ... https://manual.calibre-ebook.com/cus...ment-variables Quote:
|
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
but why do you want the db in a different location than the library??
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
To benefit from assistance, is it necessary to justify the design decisions I make with my system?
My questions are based on using the app according to the documentation. I wouldn't be asking for help if the app was being used in a way that is known to break it. Knowing why I'm venturing to do it this way seems irrelevant to the questions presented. If one were to reply saying calibre-server isn't designed to handle this approach, I could decide to stop trying. It seems that there is an opportunity to provide some technical guidance with this approach or to update documentation to reflect these limitations. A positive note, to the former opportunity, would be to have a known thread where this is resolved successfully. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#7 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
Like this?
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
My takeaway from this back-and-forth is that not everything in calibre documentation *should* work. Out of the box, I've had a solid experience. My assumption, for any software, is that things in documentation are supported/tested (or at least acknowledged to be unreliable when that's the case).
I chose this software because of what was in documentation - that a db can live outside of the library. The tens of hours spent testing and then reading forums of people having the same problem as myself leaves me knowing that time could have instead been spent implementing something that actually fits the design I'm needing. If I continue to use calibre, it will only be with the default install. |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2021
Device: Kindle Oasis
|
I just ran into the same thing.
I'm running calibre-server on a headless linux server in docker. Ideally I'd have the metadata.db on the SSD and only the books on the HDD. |
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2020
Device: none
|
Using the below compliments calibre very well. I edit all content only in calibre, then copy it off to another system, using the docker container calibre-web, which is purpose-built to be web-facing and light:
https://docs.linuxserver.io/images/docker-calibre-web |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting environment variable | dator | Server | 2 | 09-08-2018 08:57 AM |
Environment variable for libraries? | Stevex | Calibre | 21 | 03-14-2017 12:05 PM |
headless ebook-convert running on Ubuntu for Windows | wooverine | Devices | 2 | 05-02-2016 10:25 PM |
Ubuntu Headless, Windows 8.1 and database malformation (Cygwin?) | Kouwezakkie | Devices | 2 | 03-01-2015 01:56 PM |
CALIBRE_CONFIG_DIRECTORY Environment variable | huotg01 | Calibre | 15 | 11-14-2013 12:09 PM |