Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-07-2010, 11:29 AM   #1
jawadams
Junior Member
jawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura about
 
Posts: 5
Karma: 4348
Join Date: Dec 2010
Device: Kindle 3
Issue with Calibre Server - Windows

I would like my calibre server to run in the background, but, no matter what options I choose in the command line (including --daemonize) the command prompt window just stays open.

Is there a way on Windows to make it so the command prompt window won't stay up?

thanks!
jawadams is offline   Reply With Quote
Old 12-07-2010, 11:32 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
--daemonize only works on unix. You dont have to run the server ina command prompt, you can run it by typing in the command line int he run box directly.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-07-2010, 11:34 AM   #3
jawadams
Junior Member
jawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura about
 
Posts: 5
Karma: 4348
Join Date: Dec 2010
Device: Kindle 3
Thanks for the reply!

I tried just running it directly (no switches) and it still does the same thing.

I have Windows Xp x64 edition if that makes any difference.

By the way I really love the program!
jawadams is offline   Reply With Quote
Old 12-07-2010, 11:36 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm not windows expert, but I'm sure someone who is will be along to help you in a bit.
kovidgoyal is offline   Reply With Quote
Old 12-07-2010, 11:59 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
On win7 (and possibly older versions)
start /b calibre-server (options follow)
will start the server with no cmd window at all. Other options can start it in a minimized cmd window

Edit: XP 64 has the start command, and it supports the /B switch

Last edited by chaley; 12-07-2010 at 12:14 PM.
chaley is offline   Reply With Quote
Advert
Old 12-07-2010, 12:02 PM   #6
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Have it start as a planned task after system startup. Alternatively, create the calibre-server as a service.
Manichean is offline   Reply With Quote
Old 12-07-2010, 12:06 PM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by jawadams View Post
Is there a way on Windows to make it so the command prompt window won't stay up?
There are programs to hide open windows of running programs. I use HideIt. It can be configured to recognize window titles and autohide them.

There are programs that allow other programs to be run as a service. I haven't used them.

If you're willing to just minimize on start, there are tricks to do that, too.
Starson17 is offline   Reply With Quote
Old 12-07-2010, 12:38 PM   #8
jawadams
Junior Member
jawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura about
 
Posts: 5
Karma: 4348
Join Date: Dec 2010
Device: Kindle 3
Quote:
Originally Posted by chaley View Post
On win7 (and possibly older versions)
start /b calibre-server (options follow)
will start the server with no cmd window at all. Other options can start it in a minimized cmd window

Edit: XP 64 has the start command, and it supports the /B switch
Hmm I tried this and it seemingly works (no errors) but the server doesn't start.

Quote:
Originally Posted by Starson17 View Post
There are programs to hide open windows of running programs. I use HideIt. It can be configured to recognize window titles and autohide them.

There are programs that allow other programs to be run as a service. I haven't used them.

If you're willing to just minimize on start, there are tricks to do that, too.
Yeah I know how to have it minimize it but I really just want it in the background.

Quote:
Originally Posted by Manichean View Post
Have it start as a planned task after system startup. Alternatively, create the calibre-server as a service.
I am trying to create the service, this is what I type at the command prompt:

sc create CalibreServer binPath="C:\Program Files (x86)\Calibre2\calibre-server.exe"

Doesn't seem to work. It just shows me a list of options because I assume my syntax is incorrect. Any ideas?


EDIT: Managed to create the service using this syntax:
sc create CalibreServ binPath= "C:\Program Files (x86)\Calibre2\calibre-server.exe"

The only thing I was missing was a space.

But when I try to start the service it says "Error 1053: The Service did not respond to the start or control request in a timely manner"

Last edited by jawadams; 12-07-2010 at 12:46 PM.
jawadams is offline   Reply With Quote
Old 12-07-2010, 12:45 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
why dont you just use

calibre --minimize-to-tray

and in the the calibre preferences set the content server to start at calibre startup and enable the system tray icon
kovidgoyal is offline   Reply With Quote
Old 12-07-2010, 12:52 PM   #10
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jawadams View Post
Hmm I tried this and it seemingly works (no errors) but the server doesn't start.
Works fine for me.

Try running it from a new command box without the /B so another window opens and you can see what the errors are. My guess is that you have a port conflict, which happens if another instance of the server is running.
chaley is offline   Reply With Quote
Old 12-07-2010, 01:02 PM   #11
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by jawadams View Post
EDIT: Managed to create the service using this syntax:
sc create CalibreServ binPath= "C:\Program Files (x86)\Calibre2\calibre-server.exe"

The only thing I was missing was a space.

But when I try to start the service it says "Error 1053: The Service did not respond to the start or control request in a timely manner"
I haven't actually tried it, that link is just the result of a quick googling. Note that Python programs take some time to start up (at least, they do for me), maybe Windows believes there's a timeout. I don't, off the bat, know how to fix that, if it is the cause.
Manichean is offline   Reply With Quote
Old 12-07-2010, 01:33 PM   #12
jawadams
Junior Member
jawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura aboutjawadams has a spectacular aura about
 
Posts: 5
Karma: 4348
Join Date: Dec 2010
Device: Kindle 3
Quote:
Originally Posted by kovidgoyal View Post
why dont you just use

calibre --minimize-to-tray

and in the the calibre preferences set the content server to start at calibre startup and enable the system tray icon
This put me on the right track. It wouldn't work for me so I did this:

In Calibre I went to Look and Feel and enabled the tray.

Enabled automatic startup of Server.

Made shortcut to calibre.exe --start-in-tray in my startup folder.

It does a quick splash then is in the tray. That works for me!

Thanks!
jawadams is offline   Reply With Quote
Old 12-07-2010, 02:02 PM   #13
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
The splash screen can be disabled as well in the preferences, if you prefer a "silent" start.
Manichean is offline   Reply With Quote
Old 01-13-2011, 06:51 AM   #14
zzmijarevic
Member
zzmijarevic began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Apr 2010
Device: HTC HD2
Quote:
Originally Posted by jawadams View Post

I am trying to create the service, this is what I type at the command prompt:

sc create CalibreServ binPath= "C:\Program Files (x86)\Calibre2\calibre-server.exe"
...

But when I try to start the service it says "Error 1053: The Service did not respond to the start or control request in a timely manner"

I have started a new thread related to this post:
www.mobileread.com/forums/showthread.php?t=116256
zzmijarevic is offline   Reply With Quote
Old 07-17-2015, 08:25 AM   #15
ShawnInCarlsbad
Junior Member
ShawnInCarlsbad began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2015
Location: Carlsbad
Device: ipad
I have written a very simple .NET program for windows that starts up 2 calibre-server.exe processes for a couple of libraries and hides the command windows for the processes. Nothing to it if you can compile c# code. The path to the application is stored in processPath and the port number and library path is passed to the method StartProcess. Just edit to your application path, library path and port number you want to start with.

Code:
--- c# code ---
using System.Diagnostics;

namespace StartBookServer
{
    class Program
    {
        static string processPath = "C:\\Program Files\\Calibre2\\calibre-server.exe";

        static void Main(string[] args)
        {
            StartProcess(processPath, "-p 8080 --with-library \"D:\\Fiction\"");
            StartProcess(processPath, "-p 8081 --with-library \"D:\\Non-Fiction\"");
        }

        // run the process and hide the command window shutting down this app's command window (the '/c' added before the arguments apparently)
        private static void StartProcess(string processPath, string processArguments)
        {
            ProcessStartInfo si = new ProcessStartInfo(processPath);
            si.RedirectStandardInput = true;
            si.RedirectStandardOutput = true;
            si.UseShellExecute = false;
            si.Arguments = string.Format("/c {0}", processArguments);
            si.WindowStyle = ProcessWindowStyle.Hidden;
            si.CreateNoWindow = true;
            Process p = Process.Start(si);
        }
    }
}

Last edited by PeterT; 07-17-2015 at 09:24 AM. Reason: Wrapping code in a [code] block to preserve indentation
ShawnInCarlsbad is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre OPDS server with windows apps? nickdma Related Tools 10 03-03-2024 02:53 PM
A Howto: Running Calibre Content server on Windows Startup sherman Calibre 26 02-17-2019 10:37 PM
Calibre server zzmijarevic Calibre 10 08-21-2010 06:40 AM
Windows Develpment Environment issue itimpi Calibre 20 01-17-2009 07:15 PM


All times are GMT -4. The time now is 07:16 PM.


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