Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-05-2024, 04:07 PM   #1
Tlman46
Junior Member
Tlman46 began at the beginning.
 
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]
Description=Calibre-Web

[Service]
Type=simple
User=****
ExecStart=/opt/calibre/calibre

[Install]
WantedBy=multi-user.target
I enabled cps.service, started it, then checked status. The process failed to start, and I see:
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!
Tlman46 is offline   Reply With Quote
Old 04-05-2024, 09:11 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
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.
DNSB is offline   Reply With Quote
Advert
Old 04-06-2024, 12:15 AM   #3
Tlman46
Junior Member
Tlman46 began at the beginning.
 
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!
Tlman46 is offline   Reply With Quote
Old 04-06-2024, 07:21 AM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
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.
Quoth is offline   Reply With Quote
Old 04-06-2024, 09:35 AM   #5
Tlman46
Junior Member
Tlman46 began at the beginning.
 
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!!
Tlman46 is offline   Reply With Quote
Advert
Old 04-06-2024, 10:43 AM   #6
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,386
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Tlman46 View Post
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!!
Does that feature actually work, esp with a GUI program (i.e. with LO Writer)?
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.
Quoth is offline   Reply With Quote
Old 04-06-2024, 11:52 AM   #7
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Quote:
Originally Posted by Tlman46 View Post
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!!
Maybe use crontab? (Haven't tried it myself.)

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
mariosipad is offline   Reply With Quote
Old 04-06-2024, 02:23 PM   #8
Tlman46
Junior Member
Tlman46 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
Quote:
Originally Posted by Quoth View Post
Does that feature actually work, esp with a GUI program (i.e. with LO Writer)?
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.
I'm running LXQt 1.3.0, so X
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.
Tlman46 is offline   Reply With Quote
Old 04-06-2024, 02:26 PM   #9
Tlman46
Junior Member
Tlman46 began at the beginning.
 
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.
Tlman46 is offline   Reply With Quote
Old 04-06-2024, 03:58 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: 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.
chaley is offline   Reply With Quote
Old 04-06-2024, 04:05 PM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,386
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Tlman46 View Post
I'm running LXQt 1.3.0, so X
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.
On Mint and many other distros there is Startup Applications Preferences under Personal in Control Center
Click image for larger version

Name:	Screenshot at 2024-04-06 19-59-40.png
Views:	717
Size:	19.6 KB
ID:	207391

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?
Quoth is offline   Reply With Quote
Old 04-06-2024, 04:14 PM   #12
Tlman46
Junior Member
Tlman46 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
Quote:
Originally Posted by Quoth View Post
On Mint and many other distros there is Startup Applications Preferences under Personal in Control Center
Attachment 207391

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?
All I was seeking to do was have Calibre auto-start on reboot.
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.
Tlman46 is offline   Reply With Quote
Old 04-06-2024, 05:05 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Old 04-06-2024, 05:31 PM   #14
Tlman46
Junior Member
Tlman46 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2024
Device: Kobo
Quote:
Originally Posted by BetterRed View Post

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
Thank you!
Tlman46 is offline   Reply With Quote
Old 04-06-2024, 07:46 PM   #15
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
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.
mariosipad is offline   Reply With Quote
Reply

Tags
systemd, xcb


Forum Jump

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


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


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