Hi, I just implemented systemd socket activation support in bacula-fd. Quote from the commit message:
This commit implements socket activation support. Instead of starting the
filed
and having it waiting for connections, you can let systemd listen on port
9102
and start bacula-fd when it’s actually necessary (as soon as the first
client
connects). This further speeds up system boot and lowers resource
consumption for
sessions in which bacula-fd is not actually used.
There is one little problem in the code, though (flagged as XXX):
in src/lib/bnet_server.c, when creating a new bsock object for a connection,
the port to which the client connected is stored. When using systemd socket
activation, we don’t have this information (maybe we can get it from the
listening socket, though).
As I did not find any uses of the ->port() property in the filed code, I
decided to just hard-code it to 9102 for now. Can anyone who is more familiar
with the networking code in bacula please explain if and why setting the port
property is necessary?
Best regards,
Michael
BTW: The systemd socket and service files I have tested this with look like
this:
/lib/systemd/system/bacula-fd.socket:
[Socket]
ListenStream=9102
/lib/systemd/system/bacula-fd.service:
[Unit]
Description=bacula-fd
Requires=network.target
After=network.target
[Service]
ExecStart=/usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf -f
IOSchedulingClass=idle
StandardOutput=syslog
Restart=always
[Install]
WantedBy=multi-user.target
0001-Implement-systemd-socket-activation-support-for-file.patch
Description: Binary data
------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
