summaryrefslogtreecommitdiff
path: root/src/activate/activate.c
diff options
context:
space:
mode:
authorKlearchos Chaloulos <klearchos.chaloulos@nokia.com>2015-12-01 19:29:59 +0200
committerKlearchos Chaloulos <klearchos.chaloulos@nokia.com>2015-12-01 19:29:59 +0200
commit366b7db4b65b994cd33cf4fd3c1be429be561307 (patch)
tree02b7d1a3353569cccd491145ab2c8ca7df974957 /src/activate/activate.c
parentc0f1f52317e6128f44b235aa6edf86ddf2043aaf (diff)
journal-remote: split-mode=host, remove port from journal filename
When constructing the journal filename to store logs from a remote host, remove the port of the tcp connection, as the port will change with every reboot/connection loss between sender/reveiver machines. Having the port in the filename will cause a new journal file to be created for every reboot or connection loss. For the implementation, a new argument "bool include_port" is added to the getpeername_pretty() function. This is passed to the sockaddr_pretty() function. The value of the include_port argument is set to true in all calls of getpeername_pretty(), except for 2 calls in journal-remote.c, where it is set to false.
Diffstat (limited to 'src/activate/activate.c')
-rw-r--r--src/activate/activate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index b7e6255f49..a12ee11b92 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -272,7 +272,7 @@ static int do_accept(const char* name, char **argv, char **envp, int fd) {
}
getsockname_pretty(fd2, &local);
- getpeername_pretty(fd2, &peer);
+ getpeername_pretty(fd2, true, &peer);
log_info("Connection from %s to %s", strna(peer), strna(local));
return launch1(name, argv, envp, fd2);