diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2015-10-16 02:09:32 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2015-10-16 02:09:32 +0000 |
commit | 3c3e0acccba5c3a168dfd997fc41621a4c96f9c2 (patch) | |
tree | bb16bd85b3f92a89826b9542fb1cf16ce640f136 | |
parent | 57f38d2a97938de6306f6aa516a17aec4ca77639 (diff) |
fine tune the logging some more
-rw-r--r-- | usr.sbin/rebound/rebound.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c index 384d236cac7..c8b155cac0c 100644 --- a/usr.sbin/rebound/rebound.c +++ b/usr.sbin/rebound/rebound.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rebound.c,v 1.18 2015/10/16 01:58:28 tedu Exp $ */ +/* $OpenBSD: rebound.c,v 1.19 2015/10/16 02:09:31 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -381,6 +381,7 @@ launch(const char *confname, int ud, int ld, int kq) EV_SET(&kev[2], SIGHUP, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); kevent(kq, kev, 3, NULL, 0, NULL); signal(SIGHUP, SIG_IGN); + logmsg(LOG_INFO, "worker process going to work"); while (1) { r = kevent(kq, NULL, 0, kev, 4, timeout); if (r == -1) @@ -390,6 +391,7 @@ launch(const char *confname, int ud, int ld, int kq) for (i = 0; i < r; i++) { if (kev[i].filter == EVFILT_SIGNAL) { + logmsg(LOG_INFO, "hupped, exiting"); exit(0); } else if (kev[i].ident == ud) { req = newrequest(ud, @@ -495,6 +497,8 @@ main(int argc, char **argv) if (argc) usage(); + openlog("rebound", LOG_PID | LOG_NDELAY, LOG_DAEMON); + if (!debug) daemon(0, 0); @@ -547,6 +551,9 @@ main(int argc, char **argv) /* wait for something to happen: HUP or child exiting */ while (1) { r = kevent(kq, NULL, 0, &kev, 1, timeout); + if (r == -1) + logerr("kevent failed (%d)", errno); + if (r == 0) { logerr("child died without HUP"); } else if (kev.filter == EVFILT_SIGNAL) { |