diff options
author | slioch <slioch@eng-140.vyatta.com> | 2008-12-04 14:45:06 -0800 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2008-12-04 14:45:06 -0800 |
commit | 1c57ff025f86300db03dfa8fe08f7e64bf462629 (patch) | |
tree | 92c62f3acd90fce21f563ac84938756ae99638de /src/main.cc | |
parent | 43be74e8740be9ea7d85ac76210884db53bac172 (diff) | |
download | vyatta-wanloadbalance-1c57ff025f86300db03dfa8fe08f7e64bf462629.tar.gz vyatta-wanloadbalance-1c57ff025f86300db03dfa8fe08f7e64bf462629.zip |
added sigusr2 to wake up process from sleep call. will be used to wake up process when address changes via dhcp.
Diffstat (limited to 'src/main.cc')
-rw-r--r-- | src/main.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc index c8393e8..1d3a35d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -41,7 +41,7 @@ static void sig_end(int signo) exit(0); } -static void sig_user(int signo) +static void sig_user1(int signo) { if (g_lb) delete g_lb; @@ -50,6 +50,13 @@ static void sig_user(int signo) exit(0); } +static void sig_user2(int signo) +{ + //used to wake up the process + cerr << "User signal: " << signo << endl; + syslog(LOG_ERR, "wan_lb, user exit signal caught, exiting.."); +} + int main(int argc, char* argv[]) { @@ -132,7 +139,8 @@ int main(int argc, char* argv[]) // sighup... signal(SIGINT, sig_end); signal(SIGTERM, sig_end); - signal(SIGUSR1, sig_user); + signal(SIGUSR1, sig_user1); + signal(SIGUSR2, sig_user2); //drop into event loop do { |