Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2010, 11:50 PM   #1
offby1
Junior Member
offby1 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2010
Device: iPhone w/ Stanza
Does anyone have a launchd script for calibre-server?

I want to run calibre-server headless on my media centre Mac mini, using launchd. Does anyone already have an ideal launchd configuration for it, or should I go about prepping one?
offby1 is offline   Reply With Quote
Old 08-29-2010, 09:52 AM   #2
abigagli
Junior Member
abigagli began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2010
Device: iPad
Hi, hope this doesn't come too late, but I was looking for the same thing and couldn't find an answer, so I figured it out looking at Apple documentation here: http://developer.apple.com/mac/libra...ndDaemons.html.
Applying what the docs says, I came out with something like the following property list which I saved (as root and with root:wheel owner) in /Library/LaunchDaemons/calibre_server.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>calibre_server</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/calibre-server</string>
<string>--port=[Choose your port]</string>
<string>--timeout=[Choose your timeout]</string>
<string>--password=[Choose your password]</string>
<string>--username=[Choose your username]</string>
<string>--with-library=[Choose your path to Calibre Library]</string>
</array>
<key>WorkingDirectory</key>
<string>[Suggest to put here /Users/Your_username]</string>
</dict>
</plist>

And now I have launchd automatically start calibre-server whenever I try to connect to it.
Hope this helps,
Andrea.
abigagli is offline   Reply With Quote
Advert
Old 05-31-2014, 01:31 PM   #3
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Aug 2013
Device: iPad
The property list offered by abigagli didn't work for me. I modified the plist file by replacing "OnDemand" with "KeepAlive" and that worked.
paul55391 is offline   Reply With Quote
Old 06-01-2014, 10:27 PM   #4
ssholloway
Connoisseur
ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.
 
ssholloway's Avatar
 
Posts: 99
Karma: 280
Join Date: Nov 2010
Device: iPhone6, iPadMiniRetina, KindlePW3, KoboGloHD
paul55391: I tried using this daemon plist with KeepAlive as you suggested but it's not working. When I try to connect to 192.158.x.x:8080, which is where I have calibre set up, Safari returns a "can't open page" error. The calibre server is on a MacMini running Mavericks and I'm trying to connect on a MacAir, also running Mavericks. Both Chrome and Firefox return the same error. I also checked the list of daemons running on the Mini using launchctl and the calibre server does not show up. Did you have to make any other non-obvious changes to get this to work on your system?
ssholloway is offline   Reply With Quote
Old 06-02-2014, 12:55 PM   #5
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Aug 2013
Device: iPad
@ssholloway: I have two calibre libraries on an external drive that is attached to my Mac mini running Server. I'm trying to get calibre-server (the calibre content server) automatically started when the Mac mini boots. I have been unsuccessful, but the following plist file starts up calibre-server. (You will need to edit it to agree with whatever parameters you set up in calibre.) (It's similar to the one posted on this thread by abigagli, but which wouldn't work for me. Of course, I changed abigagli's file with appropriate values instead of the square-bracketed stuff.) (Note: The original plist file indents but I'm not sure how to preserve the indenting; I think there's a way to do that but I don't remember how.)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>local.calibre_server_8080</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/calibre.app/Contents/MacOS/calibre-server</string>
<string>--port=8080</string>
<string>--timeout=10</string>
<string>--username=calibre</string>
<string>--password=egbdfa!</string>
<string>--with-library=/Volumes/WD3TB/Calibre Library</string>
</array>
</dict>
</plist>

Last edited by paul55391; 06-02-2014 at 01:00 PM.
paul55391 is offline   Reply With Quote
Advert
Old 06-03-2014, 08:14 PM   #6
ssholloway
Connoisseur
ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.
 
ssholloway's Avatar
 
Posts: 99
Karma: 280
Join Date: Nov 2010
Device: iPhone6, iPadMiniRetina, KindlePW3, KoboGloHD
@paul55391: Thanks. I'll give your plist a try this weekend. One thing I noticed you did that I didn't was to input the full path for the calibre-server executable.
ssholloway is offline   Reply With Quote
Old 06-05-2014, 08:33 PM   #7
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Aug 2013
Device: iPad
I posted on another thread too. Sorry, I shouldn't have. I should add that the list file(s) need to be set or it won't be processed.

Of course, you also need to set up "port forwarding" (alias, "port mapping") in your router. If you have an Apple Extreme router, I can provide the simple details if you can't figure it out.

I think you do need the full path name.

Last edited by paul55391; 06-05-2014 at 08:36 PM. Reason: Added comment about path name.
paul55391 is offline   Reply With Quote
Old 06-05-2014, 08:43 PM   #8
ssholloway
Connoisseur
ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.
 
ssholloway's Avatar
 
Posts: 99
Karma: 280
Join Date: Nov 2010
Device: iPhone6, iPadMiniRetina, KindlePW3, KoboGloHD
Quote:
Originally Posted by paul55391 View Post
. . . I should add that the list file(s) need to be set or it won't be processed.
Thanks. I didn't understand this sentence about list file(s) but the rest of the post was clear.

At the moment, I'm just experimenting on my LAN. I use Back-to-My-Mac for VPN to my Mini (server), which has worked in the past to give me WAN access for calibre-server so I'm not sure I need to set up my Extreme any differently than it is now.
ssholloway is offline   Reply With Quote
Old 06-06-2014, 08:04 AM   #9
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Aug 2013
Device: iPad
The sentence should read: "I should add that the ownership for the plist file(s) needs to be set or it won't be processed." Sorry.

I used:
sudo chown root:wheel local.calibre_server_8080.plist
sudo chown root:wheel local.calibre_server_8081.plist
paul55391 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Content Server statiiq Calibre 18 11-04-2016 03:12 PM
Calibre Content Server TonytheBookworm Calibre 2 09-07-2010 09:47 PM
Calibre server zzmijarevic Calibre 10 08-21-2010 06:40 AM
content server in calibre bruceOz Calibre 1 04-16-2010 04:23 AM
Calibre Server Mismatch da_jane Calibre 10 10-28-2009 01:09 AM


All times are GMT -4. The time now is 12:12 AM.


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