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
But when running as a /etc/systemd/system/calibre-server.service, an error is returned when checking the service status:
Quote:
There is no calibre library at: /home/a_real_person/calibre-data/test_write
|
The systemd service is stock, directly from here with edits only for file paths:
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
If I move metadata.db to the library directory (test_write) the server runs successfully. Keeping the environment variable prepended to the command has no bearing on it running successfully once the db is in the same directory as the library.
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
I have come across docker forum threads elsewhere, that reported issues with the db outside of the default location. A couple updated saying they were able to get it working, though details on how to do so were limited.
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.