On Saturday 30 April 2011 21:00:02 Michael Stapelberg wrote: > 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?
The bsock class method ->port() is used in error messages to help the user know exactly what connection failed. It is not a critical element so it is probably reasonable to set it to 9102 (or better yet to the configured value). We will take a look at that. Thanks for bringing it up and flagging it. Best regards, Kern > > 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 ------------------------------------------------------------------------------ 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 Bacula-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-devel