Daemonize Calibre Server

Discussion in 'Mac Programming' started by avingochea, May 17, 2011.

  1. macrumors member

    Joined:
    Aug 8, 2008
    Messages:
    76
    Location:
    Right next door to hell Yuma, Arizona
    #1
    Can somebody please help me with this? I found this page online to run the Calibre server as a daemon using applescript; I can't seem to save the file, however. When I try to compile the applescript i get error "Syntax Error - Expected end of line, etc. but found unknown token." with that period on the second line highlited ". /etc/rc.common"

    Any help would be appreciated

    http://oldbugs.calibre-ebook.com/wiki/OSXDaemon
     
  2. macrumors 6502a

    Joined:
    Apr 1, 2007
    Messages:
    899
    #2
    That's a shell script not Apple script.
     
  3. macrumors member

    Joined:
    Aug 8, 2008
    Messages:
    76
    Location:
    Right next door to hell Yuma, Arizona
    #3
    Damn... sorry bout that, I'll try again; Thanks alot :p
     
  4. macrumors member

    Joined:
    Aug 8, 2008
    Messages:
    76
    Location:
    Right next door to hell Yuma, Arizona
    #4
    Just tried it, and still don't get it... Would somebody be willing to stupify these instructions? I saved the two files it said to, changed the permissions to 755 and 644 for Shell Script & Plist files respectively, nothing happened though when I restarted the computer...
     
  5. macrumors 6502a

    Joined:
    Apr 1, 2007
    Messages:
    899
    #5
    Did you try connecting to localhost:8080?
     
  6. macrumors member

    Joined:
    Aug 8, 2008
    Messages:
    76
    Location:
    Right next door to hell Yuma, Arizona
    #6
    Yes sir, it doesn't come up on the Stanza iPhone app. I also can't find it in the activity monitor :confused:
     
  7. killer54291, Nov 5, 2011
    Last edited: Nov 5, 2011

    macrumors newbie

    Joined:
    Mar 18, 2010
    Messages:
    7
    #7
    How about this. Type this in Terminal (/Applications/Utilities/Terminal.app) and reply with the output. You have to replace the stuff.
    Code:
    su librarian -c "/Applications/calibre.app/Contents/MacOS/calibre-serve\                                                                                                        
            --username=<some name> \                                                                                                                                                        
            --password=<something> \                                                                                                                                                        
            --port=9903 \                                                                                                                                                                   
            --max-opds-items=100 \                                                                                                                                                          
            --with-library=/Calibre \                                                                                                                                                       
            --pidfile=/Calibre/calibre-server.pid
    By the way, I hope you know the URL is http://localhost:9903/ as set in the options. It's not http://localhost:8080

    Edit: Plus, in that command and in the script it's running "calibre-serve" while, at least in version 0.8.24, the executable is "calibre-server". Nonetheless, try the above.

    Should say command not found. In which case, run this:
    Code:
    su librarian -c "/Applications/calibre.app/Contents/MacOS/calibre-server\                                                                                                        
            --username=<some name> \                                                                                                                                                        
            --password=<something> \                                                                                                                                                        
            --port=9903 \                                                                                                                                                                   
            --max-opds-items=100 \                                                                                                                                                          
            --with-library=/Calibre \                                                                                                                                                       
            --pidfile=/Calibre/calibre-server.pid
    Now it should show some output. If it says "command not found" again, move calibre.app to /Applications. Then try. And make sure your calibre library location is set to /Calibre.
     

Share This Page