Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477800 - net-dialup/xl2tpd - add systemd unit file
Summary: net-dialup/xl2tpd - add systemd unit file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-07-22 19:58 UTC by nE0sIghT
Modified: 2013-07-29 00:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xl2tpd.service (xl2tpd.service,365 bytes, text/plain)
2013-07-22 19:58 UTC, nE0sIghT
Details
patch against xl2tpd-1.3.1-r2.ebuild (xl2tpd-1.3.1-r3.patch,774 bytes, patch)
2013-07-22 20:00 UTC, nE0sIghT
Details | Diff
patch against xl2tpd-1.3.1-r2.ebuild (xl2tpd-1.3.1-r3.patch,660 bytes, patch)
2013-07-22 20:01 UTC, nE0sIghT
Details | Diff
tmpfiles.d config (xl2tpd.conf,31 bytes, text/plain)
2013-07-24 15:26 UTC, nE0sIghT
Details
systemd unit file (xl2tpd.service,305 bytes, text/plain)
2013-07-24 15:28 UTC, nE0sIghT
Details
patch against xl2tpd-1.3.1-r2.ebuild (xl2tpd-1.3.1-r3.patch,708 bytes, patch)
2013-07-24 15:30 UTC, nE0sIghT
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nE0sIghT 2013-07-22 19:58:26 UTC
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 -))
Comment 1 nE0sIghT 2013-07-22 20:00:40 UTC
Created attachment 353930 [details, diff]
patch against xl2tpd-1.3.1-r2.ebuild

Here is a patch against xl2tpd-1.3.1-r2.ebuild
Comment 2 nE0sIghT 2013-07-22 20:01:53 UTC
Created attachment 353932 [details, diff]
patch against xl2tpd-1.3.1-r2.ebuild
Comment 3 Mike Gilbert gentoo-dev 2013-07-24 01:10:00 UTC
(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.
Comment 4 nE0sIghT 2013-07-24 15:26:34 UTC
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
Comment 5 nE0sIghT 2013-07-24 15:28:26 UTC
Created attachment 354108 [details]
systemd unit file

1. removed mkdir /var/run/xl2tpd
2. changed /var/run to /run
Comment 6 nE0sIghT 2013-07-24 15:30:38 UTC
Created attachment 354110 [details, diff]
patch against xl2tpd-1.3.1-r2.ebuild
Comment 7 Mike Gilbert gentoo-dev 2013-07-29 00:02:52 UTC
+*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.