View Single Post
Old 01-23-2015, 03:47 AM   #2
tigran
Zealot
tigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
Ah, I think I have figured it out! The PHP temporary file has the form /tmp/phpblahblah whereas calibre assumes that the filename has the structure name.format so I guess I have to rename this temporary file to have .mobi extension for ebook-meta to work. I have reproduced the "everything=Unknown" problem by running ebook-meta on a file without .mobi extension, so I am pretty sure this is the cause of the problem. I'll try it in the real PHP scenario now...

UPDATE: Yes, it works now!

UPDATE: No, on some books it still breaks with this error:

No protocol specified
: cannot connect to X server :0

This is the case when it outputs (when executed as a normal user) the message "loaded the Generic plugin". So, this "Generic plugin" seems to be an X application and wants to connect to X server. Very strange... Any ideas? (I'll try setting DISPLAY but really this is wrong --- standalone text-based utilities are NOT supposed to require X to run).

UPDATE: the solution is to unset DISPLAY before executing ebook-meta.

All these tricks should really be documented somewhere...

Last edited by tigran; 01-23-2015 at 06:53 AM.
tigran is offline   Reply With Quote