Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 12-29-2019, 01:05 PM   #1
genoasalami
Connoisseur
genoasalami began at the beginning.
 
Posts: 53
Karma: 20
Join Date: Apr 2017
Device: KK3G, PW, Voyage, Oasis, Aura One, Forma
calibre-server demon won't load plugins

I'm running calibre-server 4.6 on FreeBSD, built from ports. The port comes with a startup script to run the server as a demon*. When the server is started this way, I cannot get custom plugins to load. However, when I manually simply run calibre-server from the command-line, everything is fine, and all the plugins load readily. This makes me think I'm missing something relatively simple, but I can't figure it out. I'd appreciate any help.

Here's the startup script:

rc.conf
Code:
#calibre settings
calibre_enable="YES"
calibre_flags="--disable-use-bonjour --auth-mode=basic --userdb=/usr/local/share/calibre/users.sqlite --enable-auth --log=/usr/local/share/calibre/logs/error.log --access-log=/usr/local/share/calibre/logs/access.log"
calibre_home="/usr/local/share/calibre/"
calibre_library="/mnt/library/"
calibre_user="root"
calibre_group="wheel"
startup script itself
Code:
#!/bin/sh
#
# $FreeBSD: head/deskutils/calibre/files/calibre.in 445400 2017-07-09 10:13:49Z madpilot $
#
# PROVIDE: calibre
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable calibre_server:
#
# calibre_enable (bool):        Set it to "YES" to enable calibre
#                               Default is "NO".
# calibre_port (int):		port that calibre_server listens on
#				Default is 8080
# calibre_user (string):	user that calibre_server runs as
#				Default is calibre
# calibre_home (string):	home directory for calibre_server
#				Default is the home directory of calibre_user
# calibre_url_prefix (string):  prefix to append to all URLs
#				default is unset
# calibre_logfile (string):	log file location
#				Default /var/log/calibre-server/calibre-server.log
# calibre_logsize (int):	size of log file before being rotated in MBs
#				Default 10 MB
# calibre_flags (string):	Any further flags to customize configuration
#				Default empty
# calibre_library (string):	path to library folder to serve content from
#
#
##########################################################

. /etc/rc.subr

name=calibre
rcvar=calibre_enable

load_rc_config $name

: ${calibre_enable:=NO}
: ${calibre_user:=calibre}
: ${calibre_library:=/nonexistent}
: ${calibre_logfile:=/var/log/calibre-server/calibre-server.log}
: ${calibre_logsize:=10}

pidfile=/var/run/${name}/${name}.pid
command=/usr/local/bin/calibre-server
command_interpreter=/usr/local/bin/python2.7
required_dirs=${calibre_library}

start_precmd=calibre_prestart

calibre_home=${calibre_home:-$(getent passwd ${calibre_user} | awk -F: '{print $6}')}
calibre_env="${calibre_env} HOME=${calibre_home:-/nonexistent}"

if [ ! -z "${calibre_port}" ]; then
	command_args="${command_args} --port=${calibre_port}"
fi
if [ ! -z "${calibre_url_prefix}" ]; then
	command_args="${command_args} --url-prefix=${calibre_url_prefix}"
fi

command_args="${command_args} --log ${calibre_logfile} --pidfile ${pidfile} --max-log-size ${calibre_logsize} --daemonize ${calibre_library}"

calibre_prestart()
{
	install -d -o ${calibre_user} -m 755 /var/run/${name}
	install -d -o ${calibre_user} -m 755 `dirname ${calibre_logfile}`
}

run_rc_command "$1"











* I recognize that this might be unsupported based on the fact the help options indicate that --daemonize is only support on Linux.

Last edited by genoasalami; 12-29-2019 at 01:07 PM.
genoasalami is offline   Reply With Quote
Old 12-29-2019, 09:52 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Do not run as root. And plugins are loaded from the calibre config directory, which defults to ~/.config/calibre and can be set via an environment variable see https://manual.calibre-ebook.com/cus...ment-variables
kovidgoyal is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre server won't load chinax Related Tools 1 07-19-2017 11:53 PM
Calibre won't load. FennecTheFox Calibre 2 01-26-2015 08:12 PM
Calibre won't load jcrawfordx Calibre 12 03-24-2013 01:47 PM
Calibre won't load trumphodge Devices 7 07-13-2012 07:05 AM
Calibre Won't Load calibrepf Calibre 6 12-10-2009 04:22 PM


All times are GMT -4. The time now is 03:38 PM.


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