Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 09-07-2016, 09:52 AM   #1
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
ubuntu calibre server on xenial 16.04

Ubuntu 16.04 uses a system called systemd instead of upstart. You need to follow these directions to make it work.


===============old post====================
I'm getting some errors when running my calibre server after upgrading from ubuntu 14.04 to 16.04

I think it has something to do with my failed attempt at installing via calibre apt-get vs using the method described on both the calibre page, and that nice digital ocean howto.

Anyhow, I can get the calibre server running great with the direct command
Code:
sudo calibre-server --port 8081 --with-library /media/Backup/calibre
but get errors when using
Code:
sudo start calibre-server
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
It's because I already have a service running on port 8080, and need to change that port, as well as point the server at the correct library location.

I did create the conf file in /etc/init/calibre-server.conf, but I don't think the sudo start calibre-server looks at that conf file.

I did notice that as soon as I ran the sudo start calibre-server, it created a bunch of files in
~/.config/calibre
global.py
plugins
server_error_log.txt
metadata_sources
server_access_log.txt
tweaks.py

But global.py doesn't have PORT settings in it. It's got some other stuff, but I feel that I'm going down the wrong rabbit hole here.

any help would be great!

Last edited by mrdrew; 09-07-2016 at 06:19 PM.
mrdrew is offline   Reply With Quote
Old 09-07-2016, 10:01 AM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
So, what is the contents of your upstart unit file?

Also, is it calibre_server or calibre-server? You are probably starting a different service than the one you think you are. (Maybe something installed by a distro package?)
eschwartz is offline   Reply With Quote
Advert
Old 09-07-2016, 10:28 AM   #3
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
The upstart file in /etc/init/calibre-server.conf
http://pastebin.com/qKHdhTp1

I'm sure it's calibre-server, not the underscore version.

which calibre_server returns nothing, whereas calibre-server returns the correct location.

good ideas! thanks for the quick response.
mrdrew is offline   Reply With Quote
Old 09-07-2016, 12:53 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Okay, so that must have been a typo in your OP.

It looks fine to me -- maybe a Ubuntu user who groks Upstart can tell what is wrong, but I am out of ideas.
(Arch Linux uses systemd.)


P.S. The `which` command doesn't find initsystem units, it finds executables in your $PATH.
eschwartz is offline   Reply With Quote
Old 09-07-2016, 05:51 PM   #5
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
Quote:
Originally Posted by eschwartz View Post
Okay, so that must have been a typo in your OP.
Whoops, yes it was. Corrected.
mrdrew is offline   Reply With Quote
Advert
Old 09-07-2016, 06:01 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Wait a minute. Didn't Ubuntu 16.04 switch from Upstart to systemd? (If so, an Upstart tutorial will absolutely not work. )

Although I am not sure why it would be installed if it is not used for init... maybe dist-upgrade just isn't smart enough to properly clean up?
eschwartz is offline   Reply With Quote
Old 09-07-2016, 06:03 PM   #7
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
yes, and I think the answer is in here somewhere...

Boom. This did the trick!

updated original post

Last edited by mrdrew; 09-07-2016 at 06:18 PM.
mrdrew is offline   Reply With Quote
Old 09-08-2016, 11:59 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Happy to help.

FWIW, I use the following systemd service unit:
Code:
[eschwartz@arch ~]$ cat ~/.config/systemd/user/calibre-server@.service
[Unit]
Description=Main calibre server
After=network.target

[Service]
EnvironmentFile=/%h/.config/calibre/servers/%i.conf
ExecStart=/usr/bin/calibre-server \
    --port="${port}" \
    --with-library "${path}" \
    --restriction "${restriction}" \
    --user "${user}" \
    --pass "${pass}"

[Install]
WantedBy=default.target
It is enabled as a user unit, so it runs using your systemd user session at login -- although you could easily modify it to run as root and declare the right "User=".

It also makes use of systemd variables (see `man systemd.unit` under SPECIFIERS), and is written as a template in order to make use of server configuration files to run multiple instances using the same unit file.

PIDFile is NOT needed, except for services that MUST run as a "forking"-type service -- the PIDFile lets it track the lifetime of the program, but calibre does not require running as a forking service... this (avoiding a PIDFile in some cases) is one of the improvements of systemd. --daemonize and --pidfile exist for other init systems that need to fork.
But if you were to use a PIDFile, you would of course want to use the systemd specifier that lets you choose the right runtime directory instead of struggling with inane permissions issues like that guide described.

The server config file looks like this:
Code:
[eschwartz@vostro ~]$ cat ~/.config/calibre/servers/servername.conf
port="8080"
path="/path/to/Calibre Library"
restriction="some restriction"
user="server username"
pass="server password"
eschwartz is offline   Reply With Quote
Reply

Tags
16.04, server, ubuntu, xenial


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't start calibre-server on Linux (ubuntu) Awfki Calibre 5 08-19-2015 10:54 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 Content Server error in Ubuntu 10.10 Bodman456 Calibre 1 07-07-2010 03:26 PM
Calibre RuntimeError on Ubuntu 8.04 Server alexbt Calibre 3 10-13-2009 04:26 AM


All times are GMT -4. The time now is 04:52 PM.


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