Besides [v4.1.0-ls27] does not start the x server for me, I only want the calibre content server running not calibre itself.
If someone has a similiar wish, this is my solution
#!/bin/bash
# custom-cont-init.d/delete_services
set -u; set -e
if [ -e "/var/run/s6/etc/services.d/*" ]; then
echo [calibre server only] service.d cleaned
rm -r "/var/run/s6/etc/services.d/*"
else
echo [calibre server only] service.d was empty
fi
#!/bin/bash
# custom-services.d/calibre-server
set -u; set -e
export LogDat=/config/calibre-server.log
echo [calibre server only] calibre-server started
export CALIBRE_OVERRIDE_LANG=de
export PIDDat=/config/calibre-server.pid
Datei=/ebooks/eBooks/metadata.db # DB-File to watch for changes
while true; do
Zeit=$(stat -c%Y $Datei) # file change date
echo "[calibre server only] Watching $Datei $Zeit"
rm -f $PIDDat
# see https://manual.calibre-ebook.com/generated/en/calibre-server.html
/usr/bin/calibre-server --pidfile $PIDDat --port 8081 --disable-log-not-found --log $LogDat --max-log-size 2 /ebooks/eBooks &
until [[ -e $PIDDat ]]; do # wait
sleep 5s
done
echo "[calibre server only] Started, PID $(cat $PIDDat)"
until [[ $Zeit -ne $(stat -c%Y $Datei) ]]; do # Wait for change
sleep 60s
done
echo "[calibre server only] Change detected, stopping process"
pkill -15 -F $PIDDat
sleep 5s
until [[ $(pkill -c -F $PIDDat) -eq 0 ]]; do
echo "[calibre server only] Waiting for process to end"
sleep 5s
done
done