|
|
#1 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jan 2020
Device: none
|
Calibre-server systemd socket unit example
The calibre documentation mentions that it supports socket activation. Does anyone have a working socket unit and service unit pair that will start the server on first connection then stop the server after some timeout? Thanks in advance.
David |
|
|
|
|
|
#2 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jan 2020
Device: none
|
[SOLUTION] socket unit example
Answering my own question for future readers.
I created the following systemd unit files: calibre-server@.socket: Code:
[Unit] Description=Calibre Server socket [Socket] ListenStream=33154 [Install] WantedBy=sockets.target Code:
[Unit] Description=Calibre content server After=network.target [Service] Type=simple User=%i Group=%i ExecStart=/usr/bin/calibre-server --enable-allow-socket-preallocation "/home/%i/Media/Books/Calibre Library" RuntimeMaxSec=300 Restart=no [Install] WantedBy=multi-user.target Code:
systemctl start calibre-server@user1.socket I can also add another socket unit named calibre-server@user2.socket with a different ListenStream to serve user2's library on a different port. Last edited by davidreads; 01-10-2020 at 05:40 PM. |
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calibre3 systemd | jrp13149 | Devices | 2 | 11-01-2017 01:36 PM |
| --Manage-users and systemd | dom134 | Calibre | 6 | 06-30-2017 05:37 PM |
| Calibre Companion connecting unit / computer | jayp2013mobile | Calibre Companion | 23 | 03-03-2016 03:07 PM |
| Calibre has no choice on font size unit in css? | naisren | ePub | 6 | 09-30-2012 10:41 AM |
| 500 Internal Server Error accessing content server Calibre 0.8.8 | DaddyO57 | Calibre | 1 | 07-20-2012 07:08 PM |