Change process name to indicate task of process

This commit is contained in:
Niobos committed 2019-09-05 16:40:59 +02:00
1 parent 3aa245efa5
commit 0380a4309f
6 files changed
+67 -1

No files matched your search

+22
View File
@@ -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