Calibre-Web, Part Two
So this combination of using Calibre Server as the backend and Calibre-Web as the front end is really nice. Let's work on making this a more permanent solution.
Enable Calibre-Web as a Service
Steps performed on CALIBRE-01
The example service file in their wiki is as follows:
[Unit]
Description=Calibre-Web
[Service]
Type=simple
User={username}
ExecStart={path to starterfile}
[Install]
WantedBy=multi-user.target
Ok, so that would make mine look like:
[Unit]
Description=Calibre-Web
[Service]
Type=simple
User=david
ExecStart=/srv/calibre-web/cps
[Install]
WantedBy=multi-user.target
sudo nano /etc/systemd/system/cps.service
sudo systemctl enable cps.service
sudo systemctl status calibre-server
Calibre Content Server is running
sudo systemctl status cps
Calibre-Web is not running
sudo systemctl enable cps
sudo systemctl start cps
sudo systemctl status cps
Active: failed (Result: exit-code) since Thu 2023-02-23 20:45:04 UTC; 5s ago
Feb 23 20:45:04 calibre-01 systemd[1155]: cps.service: Failed at step EXEC spawning /srv/calibre>
Feb 23 20:45:04 calibre-01 systemd[1]: cps.service: Main process exited, code=exited, status=203>
After playing around with this for a while I had to use the instructions at the bottom of the page for a manual install instead of the pip
installation listed above which I had used. For posterity I ended up with:
sudo nano /etc/systemd/system/cps.service
[Unit]
Description=Calibre-Web
After=network.target
[Service]
Type=simple
User=david
Group=david
ExecStart=/usr/bin/python3 /srv/calibre-web/cps.py
WorkingDirectory=/srv/calibre-web/
[Install]
WantedBy=multi-user.target
I reboot again to test everything. It is loading after the reboot so we've got that done. But it does seem like it lost the users and database location from my manual running of the program. So will my settings be saved now with a persistent service? Another reboot to test. Victory everything is working as expected!