Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

journal-remote: split-mode=host, remove port from journal filename #2080

Conversation

chaloulo
Copy link
Contributor

@chaloulo chaloulo commented Dec 1, 2015

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.

This pull request extends #2078. It actually includes the changes of 2078, so if this pull request is accepted, 2078 can be closed. I created 2078 separately because it is much simpler and it has a distinct functionality

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.
@zonque
Copy link
Member

zonque commented Jan 20, 2016

@keszybz, could you have a look at this? There are a number of journal-remote related PRs that need attention: journal-remote

@zonque
Copy link
Member

zonque commented Jan 22, 2016

FWIW, this looks sane to me. Sorry for the delay.

zonque added a commit that referenced this pull request Jan 22, 2016
…om-journal-filename

journal-remote: split-mode=host, remove port from journal filename
@zonque zonque merged commit 371859d into systemd:master Jan 22, 2016
@chaloulo chaloulo deleted the split-mode-host-remove-port-from-journal-filename branch April 22, 2016 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants