You can do what I said I do in post #5 of that thread:
- use "monit" to monitor the timestamp of metadata.db. It restarts calibre if the timestamp changes
- use monit to ensure that the server is actually running
- have the calibre start/stop script copy the database to /tmp
- set the environment variable CALIBRE_OVERRIDE_DATABASE_PATH to tell calibre where the db is located
I don't use a start/stop script in /etc/init.d. I let monit take care of it.
I run debian wheezy. The relevant monit sections are
Code:
check process calibre-server with pidfile /var/run/calibre-server.pid
start program = "/root/mon/calibre-server.sh start"
stop program = "/root/mon/calibre-server.sh stop"
alert YOUR_EMAIL_ADDRESS_HERE only on { timeout, nonexist }
check file metadata.db with path /home/dropbox/Dropbox/Charles/Library/metadata.db
if changed timestamp
then exec "/root/mon/calibre-server.sh restart"
The start/stop script that monit uses (/root/mon/calibre-server.sh) follows. I blatantly stole it from an init.d script.
The rest is up to you.