mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 18:12:10 +03:00
Change process name to indicate task of process
This commit is contained in:
1 parent
3aa245efa5
commit
0380a4309f
6 files changed
+67
-1
No files matched your search
@@ -30,6 +30,10 @@
|
||||
#include <systemd/sd-daemon.h>
|
||||
#endif
|
||||
|
||||
#ifdef LIBBSD
|
||||
#include <bsd/unistd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Settings that depend on the command line or the config file
|
||||
*/
|
||||
@@ -621,6 +625,24 @@ void log_connection(struct connection_desc* desc, const struct connection *cnx)
|
||||
desc->target);
|
||||
}
|
||||
|
||||
void set_proctitle_shovel(struct connection_desc* desc, const struct connection *cnx)
|
||||
{
|
||||
#ifdef LIBBSD
|
||||
struct connection_desc d;
|
||||
|
||||
if (!desc) {
|
||||
desc = &d;
|
||||
get_connection_desc(desc, cnx);
|
||||
}
|
||||
setproctitle("shovel %s %s->%s => %s->%s",
|
||||
cnx->proto->name,
|
||||
desc->peer,
|
||||
desc->service,
|
||||
desc->local,
|
||||
desc->target);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* libwrap (tcpd): check the connection is legal. This is necessary because
|
||||
* the actual server will only see a connection coming from localhost and can't
|
||||
|
||||
Reference in new issue
Block a user