summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-11-13 09:31:40 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-11-13 09:31:40 +0000
commit2c21891ec156adc304f4012343d75808a1036d0f (patch)
treebae7dffb6eefb75ee653848bc1926b188eaf917b /init.c
parent1f99578ce98947170a8f3809e8d77cb2d4b9a4f4 (diff)
downloadopenvpn-2c21891ec156adc304f4012343d75808a1036d0f.tar.gz
openvpn-2c21891ec156adc304f4012343d75808a1036d0f.tar.xz
openvpn-2c21891ec156adc304f4012343d75808a1036d0f.zip
Attempt at rational signal handling when in the
management hold state. During management hold, ignore SIGUSR1/SIGHUP signals thrown with the "signal" command. Also, "signal" command will now apply remapping as specified with the --remap-usr1 option. When a signal entered using the "signal" command from a management hold is ignored, output: >HOLD:Waiting for hold release git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1458 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.c b/init.c
index 2eb1896..244f03c 100644
--- a/init.c
+++ b/init.c
@@ -1225,6 +1225,7 @@ socket_restart_pause (struct context *c)
sec = c->persist.restart_sleep_seconds;
c->persist.restart_sleep_seconds = 0;
+ /* do managment hold on context restart, i.e. second, third, fourth, etc. initialization */
if (do_hold (NULL))
sec = 0;
@@ -1244,7 +1245,7 @@ do_startup_pause (struct context *c)
if (!c->first_time)
socket_restart_pause (c);
else
- do_hold (NULL);
+ do_hold (NULL); /* do management hold on first context initialization */
}
/*
@@ -2456,7 +2457,8 @@ open_management (struct context *c)
c->options.management_state_buffer_size,
c->options.management_hold,
c->options.management_client,
- c->options.management_write_peer_info_file))
+ c->options.management_write_peer_info_file,
+ c->options.remap_sigusr1))
{
management_set_state (management,
OPENVPN_STATE_CONNECTING,
@@ -2465,7 +2467,7 @@ open_management (struct context *c)
(in_addr_t)0);
}
- /* possible wait */
+ /* initial management hold, called early, before first context initialization */
do_hold (c);
if (IS_SIG (c))
{