06-19-2015, 11:38 AM | #31 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I thought all package managers handle uninstalling...
There is an official Arch guideline that users should make the choice to activate things or not, but I decided if one is installing my updater, one wants to use it. Arch guidelines also say calibre should ship with bunded and modified libs stripped out a la debian. Besides, I echoed a message -- good enough. |
06-21-2015, 05:37 AM | #32 | ||
Poker of bits and books
Posts: 70
Karma: 12662
Join Date: Sep 2013
Device: Kobo Glo HD, Tolino Vision 5
|
Quote:
Quote:
Last edited by Lofwyr23; 06-21-2015 at 05:40 AM. |
||
06-21-2015, 12:26 PM | #33 | ||
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
Quote:
Anyway good to hear it works. |
||
06-30-2015, 11:25 AM | #34 | |
Poker of bits and books
Posts: 70
Karma: 12662
Join Date: Sep 2013
Device: Kobo Glo HD, Tolino Vision 5
|
Quote:
It does, taking aside that one gremlin from the major version move. And it does what it is supposed to with a zeal that is missing from a lot of software nowadays. Last edited by Lofwyr23; 06-30-2015 at 11:29 AM. |
|
11-04-2016, 02:15 PM | #35 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2009
Location: Washington
Device: Kindle Voyage
|
I am thinking of implementing your script on my Linux Mint 18 home server. I have setup calibre-server to run at startup with a systemd script:
Code:
[Unit] Description=Calibre as a system service with webserver After=network.target AssertPathExists=/home/matt/mounts/ServerFolders/Books [Service] Type=forking PIDFile=/var/run/calibre-server.pid ExecStart=/usr/bin/calibre-server \ --daemonize \ --max-cover=1200x900 \ --max-opds-items=30 \ --max-opds-ungrouped-items=100 \ --url-prefix /cops \ --username=user \ --password=password \ --port=8080 \ --pidfile=/var/run/calibre-server.pid \ --with-library='/home/matt/mounts/ServerFolders/Books/Calibre Library Oden/' [Install] WantedBy=multi-user.target Code:
sudo systemctl [start|stop|restart|status] calibre@matt.service |
11-06-2016, 12:13 PM | #36 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well, it will kill the server, yes. `killall` as root is good at that.
And your calibre@matt.service does not specify restarting on failure (or any kind of restarting at all), so it won't restart before the upgrade completes, in fact, you will have to restart it yourself. Note that the only real reason to kill all calibre processes during an upgrade is to restart them with the new version of calibre, since Linux is perfectly capable of replacing the program files while it is still running. ... I would try using the "Conflicts=" directive in your calibre-server service, to get it to stop when the upgrade service is running. (I haven't thought about this situation before. I haven't tested it and I am not sure how to make sure it restarts as well. I don't know whether the "Restart=always" directive would restart it when the Conflicting service ends.) .. Aside: I use the following systemd template service to start the server. Code:
[eschwartz@arch ~/git/calibre-installer]$ 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 Note that calibre-server does not need to be `--daemonize`d. pidfile+daemonize was necessary for earlier init systems which unlike systemd didn't natively know how to track the lifetime of the executable. Also note my use of EnvironmentFile to easily template different servers. In ~/.config/calibre/servers/${server}.conf you can drop values for: Code:
port="" path="" restriction="" user="" pass="" |
07-24-2017, 01:13 PM | #37 |
Member
Posts: 15
Karma: 10
Join Date: Jul 2017
Device: iPad
|
Is this script still alive and working on a Raspberry Pi, too?
|
07-24-2017, 01:57 PM | #38 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well, sure the script still works. But all it does is install the official prebuilt binaries. And there have never been prebuilt binaries for the raspberry pi.
I suggest you use https://archlinuxarm.org instead, as they provide an up-to-date ARM build of calibre that should work okay. Well, at least Arch Linux makes it trivially easy to build your own if you would prefer something a little more recent than 3.0.0 (we're four minor versions ahead now), but even so that is much more recent than e.g. raspbian. Last edited by eschwartz; 07-24-2017 at 02:00 PM. |
08-01-2017, 12:01 AM | #39 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2016
Location: Sydney, Australia
Device: Kobo Glo HD
|
The script at https://github.com/eli-schwartz/calibre-installer relies on this page to do the update check:
http://code.calibre-ebook.com/latest But for the last week or so that page or site was sometimes down (404 error) and it still has an invalid certificate which causes exceptions. I've written a slightly altered script which uses Github's REST API to check the version, since github.com is less likely to go down than the above Code:
## Downloads and installs the latest version of Calibre from the Calibre website if not already installed # From https://www.mobileread.com/forums/sh...93#post2691093 and https://github.com/eli-schwartz/calibre-installer and modifications by me to support the fact that the original site that had the latest Calibre version info is now offline as of July 2017 LATESTCALIBREVERS=`curl --silent --max-time 10 https://api.github.com/repos/kovidgo...eleases/latest | jq --raw-output '.tag_name' | cut -c2-6 -` calibre-debug -c "from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < (tuple(map(int, '$LATESTCALIBREVERS'.split('.'))))))" UP_TO_DATE=$? if [ $UP_TO_DATE = 0 ]; then echo "Calibre is up-to-date" else killall --quiet calibre-server ORIGUMASK=`umask` umask 0022 # Calibre installer needs umask 0022 python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py').read()); main(install_dir='/opt')" umask $ORIGUMASK # restore original umask value fi |
08-03-2017, 12:21 AM | #40 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
As I mentioned on Github, I don't see those 404's (and I don't see how an HTTP domain that doesn't redirect to https:// can possibly result in an SSL certificate error), but regardless I've decided to use calibre's internal update notifier logic for that check anyway for separate reasons. It's a bit cleaner in terms of nested logic, and it is also future-proof as long as calibre maintains the same API which seems reasonable.
Note that calibre's internal update notifier logic embeds the private SSL certificate for that subdomain. Code:
from calibre.gui2.update import get_newest_version get_newest_version() # returns a tuple of the version from http://code.calibre-ebook.com/latest On a side note. I've started gpg-signing my commits and tags, as well as the release archive (deterministically regenerated locally). So in case you wanted to check the PGP signature of this script -- which, since it just uses linux-installer.py, downloads and installs calibre without checking the PGP signature of calibre that is in fact available for checking -- you can now do that. Regarding which, my PGP key fingerprint is: Code:
BD27 B07A 5EF4 5C2A DAF7 0E04 8481 8A68 19AF 4A9B |
08-09-2017, 03:42 AM | #41 |
Member
Posts: 15
Karma: 10
Join Date: Jul 2017
Device: iPad
|
While I agree that going with Arch for a Calibre-only server, just for those guys who are looking for a Raspbian workaround: https://www.raspberrypi.org/forums/v...9037&p=1086130
This is essentially changing the source list to "testing" and thus installing an newer (but potentially less stable) version than the 2.75 coming with Jessie. 3.4.0 seems in testing now. Last edited by maddhin; 08-09-2017 at 03:47 AM. |
09-10-2017, 01:09 AM | #42 |
Member
Posts: 15
Karma: 10
Join Date: Jul 2017
Device: iPad
|
Based on eschwartz recommendation, I actually installed Arch Linux on my Raspberry Pi now, ran the script but ended up with:
[root@syncpi bin]# calibre-upgrade.sh Calibre is not installed, installing... Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' 2017-09-10 11:31:57 URL:https://raw.githubusercontent.com/ko...x-installer.py [27407/27407] -> "-" [1] Installing to /opt/calibre Downloading tarball signature securely... Using previously downloaded calibre-3.7.0-i686.txz Extracting files to /opt/calibre ... Extracting application files... Traceback (most recent call last): File "<string>", line 1, in <module> File "<string>", line 726, in main File "<string>", line 687, in run_installer File "/usr/lib/python3.6/subprocess.py", line 267, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.6/subprocess.py", line 707, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1333, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 8] Exec format error I don't know much about Linux but it looks like it tries to install a i686 and not arm version. I'm a bit confused now: how to install Calibre on a RPI w/ arch linux? If I interpret the discussion here correctly, I CANNOT use the script but should install the "normal" AUR package (not the installer AUR package)? --- EDIT / follow up: When I try to install the AUR package I get: [alarm@syncpi calibre-git]$ makepkg -si ==> ERROR: calibre-git is not available for the 'armv7h' architecture. ==> ERROR: An unknown error has occurred. Exiting... Now what? Last edited by maddhin; 09-10-2017 at 01:28 AM. |
09-10-2017, 01:47 AM | #43 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You have two options:
|
02-08-2022, 07:59 PM | #44 |
Guru
Posts: 774
Karma: 340954
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
|
Eschwartz I know it's an old thread but I've tested the script and it works fine on an EndeavourOS distribution, but it gives me an error on linux mint 20.02
walter@walter-SVS15117FLB:~$ sudo calibre-upgrade.sh [sudo] contraseña para walter: Traceback (most recent call last): File "runpy.py", line 194, in _run_module_as_main File "runpy.py", line 87, in _run_code File "site.py", line 45, in <module> File "site.py", line 41, in main File "calibre/debug.py", line 272, in main File "<string>", line 1, in <module> AttributeError: module 'urllib' has no attribute 'urlopen' Calibre is out-of-date. Upgrading... QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-walter' No running calibre servers. /usr/bin/calibre-upgrade.sh: línea 40: python: orden no encontrada No se puede escribir a “-” (Conseguido). walter@walter-SVS15117FLB:~$ |
Tags |
autoupdate, calibre, linux, systemd |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fully automatic Calibre autoupate solution (Windows) | Tscherno | Related Tools | 20 | 12-25-2021 07:55 PM |
Solution: Calibre AutoUpdater [Auto-Updater] | megamaniac | Calibre | 6 | 08-02-2013 10:47 PM |
Linux installer question | opitzs | Calibre | 2 | 11-09-2011 08:20 AM |
Either a userbug or a problem with the generic Linux binary installer. | Ingrid | Calibre | 11 | 07-16-2008 04:26 AM |