~cadence/bibliogram-issues#57: 
Re: Socket activation

Ok, socket activation with non-cooperative programs of course works in systemd without extra programs. The systemd-included proxy is /lib/systemd/systemd-socket-proxyd.

This set of config files in ~/.config/systemd/user makes socket activation at localhost:10406 work with systemd session bus (i.e. systemctl --user). Bibliogram needs to configured to bind to 127.0.0.1:10407. Maybe this could be added to bibliogram documentation?

proxy-to-bibliogram.socket:

[Unit]
Description=proxy bibliogram server for socket activation

[Socket]
ListenStream=127.0.0.1:10406

[Install]
WantedBy=default.target

proxy-to-bibliogram.service:

[Unit]
Description=Socket-activate bibliogram
Requires=bibliogram.service
After=bibliogram.service
Requires=proxy-to-bibliogram.socket
After=proxy-to-bibliogram.socket


[Service]
# Wait until server is fully started
ExecStartPre=/bin/sleep 5
ExecStart=/lib/systemd/systemd-socket-proxyd --exit-idle-time=10m 127.0.0.1:10407
PrivateTmp=yes

bibliogram.service:

[Unit]
Description=Bibliogram server
BindsTo=proxy-to-bibliogram.service

[Service]
Type=simple
ExecStart=%h/bin/bibliogram

Also needed is ~/bin/bibliogram. Here's one for running bibliogram from a git checkout:

~/bin/bibliogram:

#!/bin/sh

cd $HOME/tmp/bibliogram/git-bibliogram
npm start
Status
REPORTED
Submitter
tpikonen@mailbox.org
Assigned to
No-one
Submitted
6 months ago
Updated
6 months ago
Labels
No labels applied.