This patch aims at getting a PID file /var/run/rp-
l2tpd.pid) written by the daemonize code.
I needed it to get rp-l2tp monitored by "monit".
The PIDFILE code is arranged from the l2tpd package
maintained for DEBIAN.
- constant PIDFILE holds the PID file name (main.c)
- code to check existence of the pidfile at startup time
- code to write a new PID file at startup time
- code to add a cleanup handler "pidfile_cleanup (will be
called by l2tp_cleanup) to unlink the PIDFILE
- code to catch SIGTERM&SIGINT signal and run
l2tp_cleanup (???? IS THIS OK ????)
This is not a fully tested patch (I am not a developper),
but I post it in case it can prove to be useful to