04-05-2024, 04:07 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Problem establishing calibre in systemctl
I'm a happy long-time Calibre user (thanks!). I'm running calibre on a up to date Lubuntu system. I recently decided to try to set calibre to auto-start on reboot. I created a file cps.service in /etc/systemd/system/ with the contents:
[Unit] I enabled cps.service, started it, then checked status. The process failed to start, and I see:Description=Calibre-Web [Service] Type=simple User=**** ExecStart=/opt/calibre/calibre [Install] WantedBy=multi-user.target qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. ... Searching for advice on the web, I saw recommendations to: sudo apt install libxcb-cursor0 But when I ran that, the system said it was already installed and, libxcb-cursor0 is already the newest version (0.1.4-1). I'm at a dead end, based on what advice I can see online. Like I say, the program runs fine when run from the GUI or as a simple "calibre" command in QTerminal, it's only while I am attempting to start it in systemd that I am getting an error. Can anyone offer a suggestion? Thanks in advance! |
04-05-2024, 09:11 PM | #2 |
Bibliophagist
Posts: 40,617
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Looking at your post, you are attempting to run the calibre GUI from a command line. Is there some reason for doing this? AFAIR, calibre-web will use the existing database and library without needing the calibre GUI to be running.
|
Advert | |
|
04-06-2024, 12:15 AM | #3 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Sorry, my headline was misleading. I want to run Calibre, the program, not calibre-web. My bad.
I mentioned that could run Calibre from the command line just to highlight that the program is there, working and can be run in Qterminal -- it's just getting it launched as a systemd process that is defeating me. I don't normally do so, but click on it in the GUI. Any suggestions/insights about my systemd problem would be appreciated, thanks! |
04-06-2024, 07:21 AM | #4 |
the rook, bossing Never.
Posts: 12,386
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
How would Calibre know what user to use before login?
The settings and library are per user. |
04-06-2024, 09:35 AM | #5 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Through the "User=****" term in the [Service] block (with **** replaced by my user name.
Does anyone have any suggestions for how to get Calibre running through systemd? Thanks!! |
Advert | |
|
04-06-2024, 10:43 AM | #6 | |
the rook, bossing Never.
Posts: 12,386
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
Also out of curiosity, are you using a Wayland desktop or X? If in User startup, does Calibre work if you leave it open and have "restart open" after log out selected? Something I've not used on Linux or Windows for over 20 years due to risk of it locking out user at boot if the program crashes (esp. on Windows with BSOD). I presume this is to avoid the bother of logging in. Last edited by Quoth; 04-06-2024 at 10:45 AM. |
|
04-06-2024, 11:52 AM | #7 | |
Guru
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Quote:
In a terminal under you user: crontab -e Add at the bottom of the file: @reboot /bin/sleep 60 && /usr/bin/calibre Close the file <CTRL>X Y <ENTER> And reboot |
|
04-06-2024, 02:23 PM | #8 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Quote:
Re: "does Calibre work if you leave it open and have "restart open" after log out selected?" - I have no idea! Like I said I'm relatively inexperienced with Linux and I'm not sure what operation you are referring to. Anyway, my main question relates to the xcb error and how to fix it. Thanks. |
|
04-06-2024, 02:26 PM | #9 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Re the Crontab suggestion.
I tried that to start with, but it didn't work. I thin k the result was probably similar to what happens if I start Calibre in a terminal window, then close the window - the program shuts down at that point. I perceive Crontab can start the program, but doesn't yield a process that persists. Does anyone have a suggestion about my original question, about the xcb error in trying to use systemd? Thanks everyone for your engagement. |
04-06-2024, 03:58 PM | #10 |
Grand Sorcerer
Posts: 12,043
Karma: 7548549
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Read the calibre command line documentation, in particular the --detach argument.
Also post #6 in this thread and post #9 in this thread. |
04-06-2024, 04:05 PM | #11 | |
the rook, bossing Never.
Posts: 12,386
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
Tick the box and log out with only Calibre running. Then reboot and log in. If calibre doesn't correctly automatically load then it certainly won't from systemd. If it does work, and it should, then the problem is something else. However, what is the purpose of launching Calibre without logging in? |
|
04-06-2024, 04:14 PM | #12 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
Quote:
It starts automatically with me as the user, no PW, so no explicit "logging in". Thanks for your engagement - I'll try --detach and see if that makes the cronjob possible. |
|
04-06-2024, 05:05 PM | #13 |
null operator (he/him)
Posts: 21,008
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Moderator Notice
Moved from Related tools, because there is no involvement of a related tool, and because it's misleading I also removed calibre-web from title. BR |
04-06-2024, 05:31 PM | #14 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
|
|
04-06-2024, 07:46 PM | #15 |
Guru
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@Timan46
In crontab -e: @reboot /bin/sleep 60 && /usr/bin/calibre & It detaches calibre from the terminal. crontab does not open a visible terminal, maybe it works, don't know. |
Tags |
systemd, xcb |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
can't seem to start server with systemctl | naphelge | Server | 3 | 12-29-2021 10:31 PM |
Problem with Calibre editor in Calibre v4.9 | Capricorn | Calibre | 13 | 01-24-2020 06:20 AM |
Problem with calibre-parallel.exe - Calibre or Avast??? | Baz Praz | Library Management | 16 | 02-25-2017 02:27 PM |
Calibre or Calibre Companion problem...? | NSILMike | Calibre Companion | 8 | 01-04-2014 06:02 AM |
Kindle and Calibre user with problem importing large library into Calibre | pleabargain | Calibre | 1 | 12-07-2010 11:19 AM |