我正在尝试使口径服务器在启动时自动启动。我使用过这教程。然后我使用了这个脚本:
[Unit]
Description=Calibre Service
After=network.target
[Service]
User=calibre
Group=calibre
ExecStart=/usr/bin/calibre-server \
--daemonize \
--max-cover=600x800 \
--max-opds-items=30 \
--max-opds-ungrouped-items=100 \
--username=calibre \
--port=9000 \
--pidfile=/var/run/calibre-server.pid \
--with-library=/jan/home/calibre-library/
[Install]
WantedBy=multi-user.target 若要在systemd中创建自动启动,请执行以下操作。如果我手动启动了: systemctl启动calibre.service,那么它似乎就会执行。如果我给出命令: systemctl status calibre.service,我将得到以下结果:
● calibre.service - Calibre Service
Loaded: loaded (/lib/systemd/system/calibre.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2017-05-25 21:55:51 CEST; 45s ago
Process: 1887 ExecStart=/usr/bin/calibre-server --daemonize --max-cover=600x800 --max-opds-items=30 --max-opds-ungrouped-items=100 --username=calibre --port=
Main PID: 1887 (code=exited, status=0/SUCCESS)
May 25 21:55:50 FileServer systemd[1]: Started Calibre Service.
May 25 21:55:50 FileServer calibre-server[1887]: No write acces to 使用临时dir代替/home/杯/..config/杯
但是当我查看我的浏览器时,http://192.168.0.100:9000上没有口径主页,这是我的主服务器。有人有线索吗?
发布于 2017-08-30 18:17:46
您使用的是--pidfile=/var/run/calibre-server.pid,它告诉calibre将pid文件写入/var/run。最有可能的情况是,运行流程User=calibre的用户无权在那里写入。我建议您删除--pidfile,因为您没有使用它。
如果您确实想使用它,请由calibre用户将路径更改为可写目录,并在ExecStart行之前添加PIDFile=/dir/with/pidfile/calibre-server.pid,并且如上所述还添加了Type=forking。
发布于 2018-11-22 07:09:50
我在18.04上成功地运行了一个口径服务器,所以希望这些建议也适用于您的发行版。
我会将Type更改为"oneshot“,并删除"--daemonize”标记,因为它不需要存在,因为您是从systemd运行它的。如果您正在运行当前版本的量程,那么您需要删除“-”标记,并将最后一行保留为“/path/ to /杯/库”。
此外,您还可以指定用户名,但不指定密码。不确定这是否会导致问题,但最好创建一个用户数据库,然后将选项“--启用-auth”传递给您的服务器命令,以激活您的用户(请参阅口径用户手册)以及“-userdb/path/ to /users.sqlitt”。如果你需要更多关于如何做到这一点的信息,我可以展开。
最后,由于它还没有被提及,请确保您正在使用的端口是允许通过您的防火墙,并由您的路由器正确转发。
https://askubuntu.com/questions/918920
复制相似问题