diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2020-01-21 22:39:58 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2020-01-21 22:39:58 +0000 |
commit | 27b9c344ea3b04ee4c496fa3520a47b83c131d9a (patch) | |
tree | a84946298d086b7256ae9fc0e55e8449111836d8 | |
parent | e7ba7a5302bffdc56d34818a7632540d0e949786 (diff) |
expose the number of currently-authenticating connections
along with the MaxStartups limit in the proctitle;
suggestion from Philipp Marek, w/ feedback from Craig Miskell
ok dtucker@
-rw-r--r-- | usr.bin/ssh/sshd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 6129b0acd2c..ec644c94f75 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.542 2019/12/15 18:57:30 djm Exp $ */ +/* $OpenBSD: sshd.c,v 1.543 2020/01/21 22:39:57 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1005,7 +1005,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) { fd_set *fdset; int i, j, ret, maxfd; - int startups = 0, listening = 0, lameduck = 0; + int ostartups = -1, startups = 0, listening = 0, lameduck = 0; int startup_p[2] = { -1 , -1 }; char c = 0; struct sockaddr_storage from; @@ -1029,6 +1029,12 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * the daemon is killed with a signal. */ for (;;) { + if (ostartups != startups) { + setproctitle("[listener] %d of %d-%d startups", + startups, options.max_startups_begin, + options.max_startups); + ostartups = startups; + } if (received_sighup) { if (!lameduck) { debug("Received SIGHUP; waiting for children"); |