Bug#752094: pptpd: Restarting daemon breaks existing connections

2016-12-25 Thread James Cameron
On Sat, Dec 24, 2016 at 11:17:18PM +0100, Christoph Biedl wrote:
> Unfortunately this has an unpleaseant side effect: Since the new
> pptpd instance has no knowlegde of the old one's children, it will
> happily allocate connection slots (by IP address) that are already
> in use. So the second client will not see any traffic.

Yes, but only when IP address allocation is controlled by pptpd.

Other IP address allocation methods are radius, chap-secrets (pppd),
and remote (ipcp-accept-remote).  For this pptpd takes --delegate
option.

> The only way to solve this AFAICS was the old instance persists all
> the childrens' information so the new one will not allocate them
> while they are running. There might be some race conditions to
> consider as well. James (upstream) is reading this, if you can solve
> this by Jan 20th I'll be happy to include it for stretch. Afterwards
> it might be too late.

I've no plans to fix this by that date, but I'm interested in patches
to do so.

My preference is a /var/run/pptpd/ip directory containing a file for
each active connection, name equal to IP address, content is PID.

pptpmanager.c slot_* functions would maintain these files as a mirror
of struct slot *slots.

Here's a quick pseudo-code plan;

void slot_set_pid(int i, pid_t pid)
{
  struct slot *slot = [i];
  // if pid is zero, {
  //   delete file,
  // } else {
  //   create and write pid to file
  // }
  slot->pid = pid; 
}

int slot_find_by_pid(pid_t pid)
{
  int i;
  for(i=0; ipid == pid)
  // if file exists, {
  //   read pid from file,
  //   if pid exists (kill with sig zero), {
  // continue (skip slot),
  //   } else {
  // unlink file,
  // }
  return i;
  }
  return -1;
}

-- 
James Cameron
http://quozl.netrek.org/



Bug#752094: pptpd: Restarting daemon breaks existing connections

2016-12-25 Thread Christoph Biedl
unarchive 752094
reopen 752094
tags 752094 upstream
retitle pptpd: Does not persist sessions across restart
thanks

Vladimir Kudrya wrote...

> Dear Maintainer, after transition to systemd restarting pptpd daemon results 
> in it's
> children being killed, so existing connections are dropped. This is 
> inconsistent with
> previous behavior.
> 
> This can be fixed by adding "KillMode=process" option to pptpd.service unit.

Unfortunately this has an unpleaseant side effect: Since the new pptpd
instance has no knowlegde of the old one's children, it will happily
allocate connection slots (by IP address) that are already in use. So
the second client will not see any traffic.

The only way to solve this AFAICS was the old instance persists all
the childrens' information so the new one will not allocate them while
they are running. There might be some race conditions to consider as
well. James (upstream) is reading this, if you can solve this by Jan
20th I'll be happy to include it for stretch. Afterwards it might be
too late.

For the time being I have no choice but reverting that change, thus
killing all connections upon pptpd restart.

Christoph


signature.asc
Description: Digital signature


Bug#752094: pptpd: Restarting daemon breaks existing connections

2014-07-15 Thread Christoph Biedl
tags 752094 pending
thanks

Vladimir Kudrya wrote...

 Dear Maintainer, after transition to systemd restarting pptpd daemon results 
 in it's
 children being killed, so existing connections are dropped. This is 
 inconsistent with
 previous behavior.
 
 This can be fixed by adding KillMode=process option to pptpd.service unit.

Thanks catching this. it dates back to the times I had some enthusiasm
in systemd but its documentation was rather scarce.

Christoph


signature.asc
Description: Digital signature


Bug#752094: pptpd: Restarting daemon breaks existing connections

2014-06-19 Thread Vladimir Kudrya
Package: pptpd
Version: 1.4.0-2
Severity: normal

Dear Maintainer, after transition to systemd restarting pptpd daemon results in 
it's
children being killed, so existing connections are dropped. This is 
inconsistent with
previous behavior.

This can be fixed by adding KillMode=process option to pptpd.service unit.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (900, 'testing'), (400, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.14-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8@ISO, LC_CTYPE=en_US.UTF-8@ISO (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pptpd depends on:
ii  bcrelay   1.4.0-2
ii  libc6 2.19-1
ii  libwrap0  7.6.q-25
ii  netbase   5.2
ii  ppp   2.4.6-2

pptpd recommends no packages.

pptpd suggests no packages.

-- Configuration Files:
/etc/ppp/pptpd-options changed [not included]
/etc/pptpd.conf changed [not included]

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org