Created attachment 353928 [details] xl2tpd.service This unit file is based on file from Fedora (http://pkgs.org/fedora-17/fedora-updates-i386/xl2tpd-1.3.1-9.fc17.i686.rpm.html) with some modifications: 1. Removed insertion of l2tp_ppp mod in kernel. In Gentoo we have a choice not to do this 2. Added creation of /var/run/xl2tpd directory 3. Used default xl2tpd fork mode 4. Restart service on any failure (it's dialup after all -))
Created attachment 353930 [details, diff] patch against xl2tpd-1.3.1-r2.ebuild Here is a patch against xl2tpd-1.3.1-r2.ebuild
Created attachment 353932 [details, diff] patch against xl2tpd-1.3.1-r2.ebuild
(In reply to nE0sIghT from comment #0) > 2. Added creation of /var/run/xl2tpd directory This belongs in a tmpfiles.d entry. > 3. Used default xl2tpd fork mode Why? > 4. Restart service on any failure (it's dialup after all -)) If xl2tpd crashes, we really should not restart it. If one of the connections dies, the daemon does not die.
Created attachment 354102 [details] tmpfiles.d config > This belongs in a tmpfiles.d entry. tmpfiles.d configuration attached > Why? Because it's xl2tpd default behavior and it used in openrc init script. There is no special reason for this > If xl2tpd crashes, we really should not restart it. If one of the connections > dies, the daemon does not die. From systemd.service manual: "If set to on-failure the service will be restarted when the process exits with an nonzero exit code, is terminated by a signal (including on core dump), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered." For a time that i use xl2tpd there are was some cases when xl2tpd just exits not trying to reconnect. Nevertheless, i do not insist that "on-failure" behavior would be default as users can simply override this in custom units (or configuration) and add "RestartSec" for example. But imho it is good feature
Created attachment 354108 [details] systemd unit file 1. removed mkdir /var/run/xl2tpd 2. changed /var/run to /run
Created attachment 354110 [details, diff] patch against xl2tpd-1.3.1-r2.ebuild
+*xl2tpd-1.3.1-r3 (29 Jul 2013) + + 29 Jul 2013; Mike Gilbert <floppym@gentoo.org> +files/xl2tpd.conf, + +files/xl2tpd.service, +xl2tpd-1.3.1-r3.ebuild: + Install systemd unit, bug 477800 by nE0sIghT.