Package: tinc
Version: 1.0.19-2
Severity: wishlist
Tags: patch


A simple patch is attached. This way it should be possible to use both --mlock and --user with an unprivileged user and more than few tinc nodes without incurring in the problem reported in [0]_ (namely, "Error while processing METAKEY from ...").

As a side note, I think creating a `tinc' system user in the postinst and defaulting to use `--user=tinc' would also be nice.

Thanks,
Gian Piero.

.. [0] http://www.tinc-vpn.org/pipermail/tinc/2012-September/003056.html

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tinc depends on:
ii  dpkg          1.16.8
ii  install-info  4.13a.dfsg.1-10
ii  libc6         2.13-35
ii  liblzo2-2     2.06-1
ii  libssl1.0.0   1.0.1c-4
ii  zlib1g        1:1.2.7.dfsg-13

tinc recommends no packages.

tinc suggests no packages.

-- Configuration Files:
/etc/default/tinc changed [not included]
/etc/init.d/tinc changed [not included]

-- no debconf information
Tue Oct 16 14:39:21 CEST 2012  "Gian Piero Carrubba" <gpi...@rm-rf.it>
  * Set process limits on start
diff -rN -u old-tinc-1.0.19/debian/tinc.default new-tinc-1.0.19/debian/tinc.default
--- old-tinc-1.0.19/debian/tinc.default	2012-10-16 15:29:27.966757678 +0200
+++ new-tinc-1.0.19/debian/tinc.default	2012-10-16 15:29:27.970757719 +0200
@@ -1,2 +1,7 @@
 # Extra options to be passed to tincd.
 # EXTRA="-d"
+
+# Limits to be configured for the tincd process. Please read your shell
+# (pointed by /bin/sh) documentation for ulimit. You probably want to raise the
+# max locked memory value if using both --mlock and --user flags.
+# LIMITS="-l 128"
diff -rN -u old-tinc-1.0.19/debian/tinc.init new-tinc-1.0.19/debian/tinc.init
--- old-tinc-1.0.19/debian/tinc.init	2012-10-16 15:29:27.966757678 +0200
+++ new-tinc-1.0.19/debian/tinc.init	2012-10-16 15:29:27.970757719 +0200
@@ -54,6 +54,18 @@
   done
 }
 
+setlimits() {
+  while [ $# -gt 0 ]; do
+    parm=$1 ; shift
+    if [ -n "$1" -a "${1#-}" = "$1" ]; then
+      value=$1 ; shift
+      ulimit $parm $value
+    else
+      ulimit $parm
+    fi
+  done
+}
+
 start() {
   $DAEMON $EXTRA -n "$@"
 }
@@ -84,6 +96,7 @@
 
 case "$1" in
   start)
+    test -n "$LIMITS" && setlimits $LIMITS
     foreach_net "Starting $DESC:" start
   ;;
   stop)

Reply via email to