summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/loadbalance.cc11
-rw-r--r--src/loadbalance.hh3
-rw-r--r--src/main.cc12
3 files changed, 22 insertions, 4 deletions
diff --git a/src/loadbalance.cc b/src/loadbalance.cc
index 57d602d..40c2840 100644
--- a/src/loadbalance.cc
+++ b/src/loadbalance.cc
@@ -93,3 +93,14 @@ LoadBalance::output()
_output.write(_lbdata);
}
+
+/**
+ *
+ **/
+//temporary stand-in for now...
+void
+LoadBalance::sleep()
+{
+ ::sleep(5);
+}
+
diff --git a/src/loadbalance.hh b/src/loadbalance.hh
index 8f57b92..e4ac80a 100644
--- a/src/loadbalance.hh
+++ b/src/loadbalance.hh
@@ -40,8 +40,7 @@ class LoadBalance
void output();
- //temporary stand-in for now...
- void sleep() {::sleep(5);}
+ void sleep();
private:
bool _debug;
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 {