05-29-2010, 10:17 PM | #1 |
Enthusiast
Posts: 27
Karma: 30
Join Date: Mar 2006
Device: Kindle, iPod Touch,
|
[Old Thread] Daemonizing the calibre-server in Ubuntu
I've created /etc/init.d/calibre (attahced)
It seems to work but no /var/run/calibre.pid file is being generated. So the command to start the content server "/etc/init.d/calibre start" hangs. Even though the script hangs, the server does start. Killing the terminal doesn't kill the server, and "/etc/init.d/calibre stop" fails to stop the server as well. Is creating the .pid file the responsibility of calibre-server or the init script? Or do I need to rewrite the script to do starts and stops without a .pid file? --Glenn Last edited by gkbeer; 06-04-2010 at 10:04 PM. Reason: removed obsolete file, see later post for current copy. |
05-29-2010, 10:23 PM | #2 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
you need to use the --pidfile argument to calibre-server
|
Advert | |
|
05-30-2010, 02:37 AM | #3 |
Enthusiast
Posts: 27
Karma: 30
Join Date: Mar 2006
Device: Kindle, iPod Touch,
|
OK, --pidfile was what I needed.
I also found that the order in which the options were listed was important too. --with-library=MYLIBRARY --pidfile=/var/run/calibre-server.pid --daemonize Starting the daemon works but the process started is not calibre-server but /opt/calibre/loader. Is that right? It seems to work when I load http://localhost:8080. "/etc/init.d/calibre stop" isn't working now. The line "start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME" is messed up because the command to start the content server is calibre-server while the actual process left running is /opt/calibre/loader. Changing that line to read "loader" in place of $NAME, seems to work. The attached file is my copy of /etc/init.d/calibre for Ubuntu 9.10. Not pretty but it works. Last edited by gkbeer; 06-04-2010 at 10:03 PM. Reason: removed obsolete file, see later post for current copy. |
05-30-2010, 03:12 AM | #4 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You dont need to use --name uf you're using --pidfile when calling start-stop-daemon
|
06-04-2010, 09:49 PM | #5 |
Enthusiast
Posts: 27
Karma: 30
Join Date: Mar 2006
Device: Kindle, iPod Touch,
|
That did it.
/etc/init.d/skeleton in Ubuntu 9.04 had more options in it that I needed. Here is my final copy for others to reference. You will need to edit it to change... CONTENT=/home/glenn/Library to point to your library. It goes in /etc/init.d and should be named calibre without the .txt. In a terminal the following commands need to be run: cd /etc/init.d sudo chown root calibre sudo chgrp root calibre sudo chmod 755 calibre sudo insserv calibre Start/stop the calibre content server with: sudo /etc/init.d/calibre start sudo /etc/init.d/calibre stop Note: don't forget to turn off starting the content server in Calibre's preferences. Last edited by gkbeer; 06-04-2010 at 09:55 PM. Reason: added note about CONTENT |
Advert | |
|
07-12-2010, 03:03 PM | #6 |
Guru
Posts: 962
Karma: 568242
Join Date: Dec 2007
Device: Kindle Oasis 3, Kindle Paperwhite 1, iPad, iPhone
|
Thanks for posting this. I modified mine to include the port, username, password, and the --develop flag to updates to the library trigger a restart.
Thanks! |
01-18-2013, 11:52 AM | #7 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2013
Device: kindle
|
Quote:
I am having trouble using this method with an unbuntu 12.04 server. When I issue the sudo insserv calibre command I get: sudo: inserv: command not found I have searched but I cant seen to find an answer on why this fails. I am using the script that was attached to the thread. Thanks for any help you can provide. |
|
01-18-2013, 05:19 PM | #8 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Good Luck. |
|
01-19-2013, 08:38 AM | #9 | ||
Wizard
Posts: 1,265
Karma: 10203040
Join Date: Dec 2011
Device: a variety (mostly kindles and kobos)
|
For some reason insserv is no longer on the path in 12.04. Anyway in Glenn's instructions replace the line:
Quote:
Quote:
Attached is an updated "calibre" file based on the 12.04 /etc/init.d/skeleton. Disclaimer: I tested this on Linux Mint 14 rather than Ubuntu 12.04 itself though I don't believe there are any differences in this regard. |
||
01-20-2013, 12:10 PM | #10 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2013
Device: kindle
|
Quote:
|
|
01-20-2013, 12:24 PM | #11 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2013
Device: kindle
|
Quote:
Thanks for the help. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ubuntu Calibre server acting wonky | weidbrewer | Library Management | 18 | 08-02-2011 12:07 AM |
Calibre-Server - Ubuntu 10.10 - Running but not serving | dcmarquardt | Calibre | 10 | 04-05-2011 07:33 PM |
Calibre on ubuntu server | tdw197 | Calibre | 24 | 01-19-2011 07:48 AM |
Calibre crashes X server (Ubuntu 10.10) | mfabry | Calibre | 9 | 10-15-2010 04:12 PM |
Calibre RuntimeError on Ubuntu 8.04 Server | alexbt | Calibre | 3 | 10-13-2009 04:26 AM |