Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 01-16-2015, 06:43 PM   #1
Caleb666
Connoisseur
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 97
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
Content Server in read-only mode?

Hi,

I would like to run the calibre content server on a separate computer and _only_ use it to serve content. Is this possible?

Currently, when I try to launch it with a library that is mounted as read-only I get:
Quote:
Traceback (most recent call last):
File "site.py", line 51, in main
File "site-packages/calibre/library/server/main.py", line 124, in main
File "site-packages/calibre/db/legacy.py", line 70, in __init__
File "site-packages/calibre/db/legacy.py", line 44, in create_backend
File "site-packages/calibre/db/backend.py", line 349, in __init__
File "site-packages/calibre/utils/filenames.py", line 115, in is_case_sensitive
IOError: [Errno 30] Read-only file system: u'/nfs/Calibre_Library/calibre_test_case_sensitivity.txt'
Thanks.
Caleb666 is offline   Reply With Quote
Old 01-16-2015, 10:08 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: 26,649
Karma: 5456157
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, the content server needs write access to the db file.
kovidgoyal is offline   Reply With Quote
 
Advertisement
Old 01-17-2015, 09:21 AM   #3
Caleb666
Connoisseur
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 97
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
I see. I managed to get a hacky "solution" by using aufs.

Basically, I mount the calibre library as read-only and on top of it I stack a read-write temporary folder (say /var/tmp/calibre-server-scratch), so if the calibre server wants to write to a file, aufs will use COW to copy the file and write the changes in the temporary location.
This probably means that I should kill the content server, clear the temp folder and then start it again every once in a while (cron script?) so that it will pick up any changes to the database.

I think that one caveat is to pay attention to the case-sensitivity of the filesystem of the calibre library and the one of the temp folder, in my case they're both on ext4 so I'm probably not going to be seeing any weird problems.
Caleb666 is offline   Reply With Quote
Old 01-17-2015, 09:38 AM   #4
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,122
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Although the content server mounts the database with read-write permissions, I have a feeling that it never actually writes to the database and the requirement for write access is an artefact of the database interfacing library in use. Maybe you will be able to see for certain with the approach you are using?
itimpi is offline   Reply With Quote
Old 01-17-2015, 09:47 AM   #5
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: 26,649
Karma: 5456157
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The calibre server currently only ever writes to the db if the db schema needs to be upgraded. In the future, that will change, as I plan on making the content server read/write.
kovidgoyal is offline   Reply With Quote
Old 01-17-2015, 09:57 AM   #6
Caleb666
Connoisseur
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 97
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
Quote:
Originally Posted by itimpi View Post
Although the content server mounts the database with read-write permissions, I have a feeling that it never actually writes to the database and the requirement for write access is an artefact of the database interfacing library in use. Maybe you will be able to see for certain with the approach you are using?
You are correct, I don't see a copy of the database file in the temp folder. So I guess that deleting the temp folder might not be strictly necessary, but I still prefer to do it.

I'm working on a script that will wrap all this functionality into a service so I could simply do "sudo service calibre-ro-server start/stop/restart" and have it do all the necessary work. Then I might simply add a cronjob to restart the service (which will clear the temp folder) at 3am or something.

I will post it here once I'm done, if anyone's interested.
Caleb666 is offline   Reply With Quote
Old 01-17-2015, 12:53 PM   #7
chaley
"chaley", not "charley"
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: 6,001
Karma: 1674108
Join Date: Jan 2010
Location: France
Device: Many android devices
Instead of all the filesystem hackery, why not just copy the db to a RW filesystem (/tmp?) and set the CALIBRE_OVERRIDE_DATABASE_PATH environment variable appropriately?
chaley is offline   Reply With Quote
Old 01-17-2015, 01:11 PM   #8
Caleb666
Connoisseur
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 97
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
Quote:
Originally Posted by chaley View Post
Instead of all the filesystem hackery, why not just copy the db to a RW filesystem (/tmp?) and set the CALIBRE_OVERRIDE_DATABASE_PATH environment variable appropriately?
Because I'm mounting the library as read-only, and I don't want any writes to it whatsoever. The error I posted above makes me think that calibre will still attempt to write the the location of the library itself to check for case sensitivity even if the database itself is copied elsewhere.
Caleb666 is offline   Reply With Quote
Old 01-20-2015, 03:38 AM   #9
WaldoPepper
Junior Member
WaldoPepper began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2010
Device: Xoom, Galaxy Tab 4, iPad 2, Nexus 7, Fire HD, SurfTab Wintron 10.1
Quote:
Originally Posted by kovidgoyal View Post
...In the future, that will change, as I plan on making the content server read/write.
Would this create difficulties for the environment I am running Calibre in, as described in this thread?

I would like Calibre to keep some level of "concurrency" in the database access, since I think this would be in line with all the tendencies to locate data in "clouds" or on NAS'es.

A content-server running on a low power "headless" server to serve the content to multiple mobile reader apps (like the CC) and the full-featured Calibre frontend on one or more desktop machines to do all the import/maintenance, all of them accessing one central Calibre db: that, for me, is the perfect setup...
WaldoPepper is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Content Server and Windows Home Server 2011 HughMcC Calibre 8 10-01-2014 08:26 AM
is there a tool to open (read) books from the calibre's content server? tsolignani Related Tools 2 04-16-2013 08:14 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 07:08 PM
Content server not serving all content. False_Chicken Calibre 0 10-19-2011 06:56 PM
Wiki server move - read-only mode Alexander Turcic Announcements 1 04-24-2007 03:59 PM


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


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