On Thu, Sep 15, 2016 at 11:37:24 -0700, Yuxuan Wang wrote:
> The currect packed ocserv uses socket-activated systemd config[1] from
> upstream.
> 
> These config hardcoded the port number (443), ignoring the port number
> configured in /etc/ocserv/ocserv.conf, and will be overwritten every
> time the package upgrades. So if the user manually changed the port
> number, and have another service occupied port 443, upgrade will fail.
> 
> Upstream also provided another systemd config, standalone[2], which
> doesn't have this problem and will honor the port defined in
> /etc/ocserv/ocserv.conf
> 
> I think this package should use the standalone version of systemd config
> instead.

On the contarary, customizing the port number used in the
socket-activated configuration is much easier and less error-prone.

Instead of editing the file /etc/ocserv/ocserv.conf, just create a file
/etc/systemd/system/ocserv.socket.d/port.conf with the contents

  [Socket]
  ListenStream=12345
  ListenDatagram=12345

This file will not be overwritten or replaced, and the custom port
number will be preserved across upgrades.

This technique is common to any socket-activated service, but may not be
explicitly docummented in the ocserv package itself.

-- 
mike

Reply via email to