View Single Post
Old 05-29-2016, 05:19 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Weird. This is my unit file (it is templated with a per-server configuration file) and it works fine:

Code:
[eschwartz@arch ~]$ cat ~/.config/systemd/user/calibre-server@.service
[Unit]
Description=Main calibre server
After=network.target

[Service]
EnvironmentFile=/%h/.config/calibre/servers/%i.conf
ExecStart=/usr/bin/calibre-server \
    --port="${port}" \
    --with-library "${path}" \
    --restriction "${restriction}" \
    --user "${user}" \
    --pass "${pass}"

[Install]
WantedBy=default.target
But the problem did appear to be in the initial calibre server if localhost:8080 didn't work, and making it fork caused it to work???
I cannot think why a forked and daemonized /usr/bin/calibre-server would be any more likely to start than one which represents the main process of the service.

EDIT: Maybe you forgot to remove PIDFile= when you switched to Type=simple and systemd nuked the process out of confusion?

...

Really, it doesn't make a difference whether your daemonize and fork it, or not. It works either way, but Type=simple doesn't make systemctl wait while the server forks before returning. Since systemd natively knows how to track it. Or something.

Last edited by eschwartz; 05-29-2016 at 05:28 PM.
eschwartz is offline   Reply With Quote