[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Problem with plugin openvpn-down-root.so and SIGUSR1 restarts


  • Subject: Re: [Openvpn-users] Problem with plugin openvpn-down-root.so and SIGUSR1 restarts
  • From: James Yonan <jim@xxxxxxxxx>
  • Date: Fri, 21 Jan 2005 02:22:32 -0700 (MST)

Claas,

Try this patch -- in my testing, it causes two SIGUSR1 signals spaced only
a few milliseconds apart to be processed as a single SIGUSR1 rather than
having the second SIGUSR1 elevate to a SIGHUP (the SIGHUP is bad in this
context because it tries to do a full restart which is incompatible with
user/group/chroot).

James

--- openvpn-2.0_rc8/init.c	2005-01-09 20:27:52.000000000 -0600
+++ ./init.c	2005-01-21 02:47:05.165772552 -0600
@@ -2200,15 +2200,12 @@
 	link_socket_mode = LS_MODE_TCP_ACCEPT_FROM;
     }
 
-  /* signals caught here will abort */
+  /* before full initialization, ignore certain signals */
+  pre_init_signal_catch ();
   c->sig->signal_received = 0;
   c->sig->signal_text = NULL;
   c->sig->hard = false;
 
-  /* before full initialization, received signals will trigger exit */
-  if (c->first_time)
-    pre_init_signal_catch ();
-
   /* should we disable paging? */
   if (c->first_time && options->mlock)
     do_mlockall (true);
@@ -2340,8 +2337,7 @@
   do_init_first_time (c);
 
   /* catch signals */
-  if (c->first_time)
-    post_init_signal_catch ();
+  post_init_signal_catch ();
 
   /*
    * Actually do UID/GID downgrade, and chroot, if requested.