|
|
#1 |
|
Enthusiast
![]() Posts: 27
Karma: 30
Join Date: Mar 2006
Device: Kindle, iPod Touch,
|
[Old Thread] Daemonizing the calibre-server in Ubuntu
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. |
|
|
|
|
|
#2 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,477
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
you need to use the --pidfile argument to calibre-server
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
Enthusiast
|
|
|
|
#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. |
|
|
|
|
|
#4 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,477
Karma: 2944574
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
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#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 |
|
|
|
|
|
#6 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 923
Karma: 567366
Join Date: Dec 2007
Device: Sony PRS-505, iPad, iPhone 4, Kindle Fire
|
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! |
|
|
|
|
|
#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. |
|
|
|
|
|
|
#8 | |
|
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,307
Karma: 11288999
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7, Sony PRS-950, Sony PRS-505, PRS-300
|
Quote:
Good Luck.
__________________
-- Good Reading, Walt -- 20GB of free CLOUD STORAGE: Use this link to sign up for a free 15GB Copy.com cloud storage account and we both get an extra 5GB of free space. |
|
|
|
|
|
|
#9 | ||
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 261
Karma: 1501734
Join Date: Dec 2011
Device: Kindle 3, Kobo Touch, Kindle Touch, Kobo Mini, Kobo Aura HD, Nexus 7
|
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.
__________________
My blog - Only Mostly Dead - reviews and stuff |
||
|
|
|
|
|
#10 | |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jan 2013
Device: kindle
|
Quote:
|
|
|
|
|
|
|
#11 | |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jan 2013
Device: kindle
|
Quote:
I didnt have root listed for the RUN_AS user. Cmdline launching of calibre-server with --daemonize required sudo also. NOOB.. Thanks for the help. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
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 |