b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
366b7db4b65b994cd33cf4fd3c1be429be561307 |
|
01-Dec-2015 |
Klearchos Chaloulos <klearchos.chaloulos@nokia.com> |
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. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups. |
279d3c9cead3a7ffb657fedbab0e2bc90db45667 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno() conversions |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
25dbe4f50f93fb6398844ba67ea197f76adc237a |
|
09-Oct-2014 |
Susant Sahani <susant@redhat.com> |
socket-proxyd: Unchecked return value from library
CID 1237543 (#1 of 1): Unchecked return value from library
(CHECKED_RETURN) |
fdb8bd0fe7244b72ddc1c08e401ebddefdaf4f46 |
|
18-Sep-2014 |
Emil Renner Berthing <systemd@esmil.dk> |
include fcntl.h rather than sys/fcntl.h |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
e5a1c18d706c4d5e16100fe4fb8a07a80f2fa339 |
|
06-Jun-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
fix warnings
Prevent use of uninitialized variable and removed a now unused
cleanup function for freeaddrinfo |
fb69d7096da6baabe74be7db5f59b276129633c5 |
|
05-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
socket-proxyd: port to asynchronous name resolution using sd-resolve |
3d94f76c99da13e5603831d0b278f8c8c21bcb02 |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_pipe() with new safe_close_pair()
safe_close_pair() is more like safe_close(), except that it handles
pairs of fds, and doesn't make and misleading allusion, as it works
similarly well for socketpairs() as for pipe()s... |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
7b77ed8cf36e8eca6017791626044b61ae2d68e7 |
|
13-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: be more conservative when returning errors from event handler callbacks
We really should return errors from event handlers if we have a
continous problem and don't know any other solution. |
cde93897cdefdd7c7f66c400a61e42ceee5f6a46 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: hook up sd-event with the service watchdog logic
Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.
This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic. |
8cf030b349cbcb0901d880c9165d785dfc9cd569 |
|
27-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
Revert "socket-proxyd: Add --listener option for listener/destination pairs."
This reverts commit adcf4c81c58511b67644e17fa743d1729d3c9ccf.
We have a better solution for the problem of making two processes run in
the same namespace, and --listener is not needed hence and should be
dropped.
Conflicts:
man/systemd-socket-proxyd.xml |
adcf4c81c58511b67644e17fa743d1729d3c9ccf |
|
25-Nov-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Add --listener option for listener/destination pairs. |
adcc4ca30dc8ca0cddfcab64ad2eab6f6ab6fe21 |
|
22-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
event: rename sd_event_get() to sd_event_source_get_event() |
afc6adb5ec7e73bc13156c43f52fb015cd80cc68 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a "default" event loop per-thread and make use of it everywhere
Try to emphasize a bit that there should be a mapping between event
loops and threads, hence introduce a logic that there's one "default"
event loop for each thread, that can be queried via
"sd_event_default()". |
e633ea1c9c5249ed5bf708a2ed6385c4823d4706 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
socket-proxy: actually properly keep track of connections |
1ec6af16f501a6e281fe5604d4be8380bad38646 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
socket-proxyd: no need to redefine sockaddr union |
b7484e2a58038c57591457c1439505607bdcd833 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
event: make sure we keep a reference to all events we dispatch while we do so. |
8569a77629949b7818d00eba8eea1d05e2d1fc32 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
socket-proxyd: rework to support multiple sockets and splice()-based zero-copy network IO
This also drops --ignore-env, which can't really work anymore if we
allow multiple fds. Also adds support for pretty printing of peer
identities for debug purposes, and abstract namespace UNIX sockets. Also
ensures that we never take more connections than a certain limit. |
5f7e83e8ad6f83095569c452bff2d0702ac02987 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
socket-proxy: clean-up indenting |
eb9da376d76b48585b3b63b4f91903b54f7abd36 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts. |
a42431ca6a66c5aaa80cf41dbd8220b0778688c0 |
|
31-Oct-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Actually, some of those sizes are unsigned. |
0885468d80e77758bd4c125d3686b68484ef77c4 |
|
31-Oct-2013 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
fix compiler warnings
multiple warnings like
src/socket-proxy/socket-proxyd.c: In function ‘transfer_data_cb’:
src/socket-proxy/socket-proxyd.c:237:25: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘size_t’ [-Wformat=]
log_debug("Buffer now has %ld bytes full.", c->buffer_filled_len); |
f4bd42aa3c9bfbb0fa7a597b715fc3ee8f336764 |
|
22-Oct-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Fix-up from previous change to avoid looping on errors. |
40976028c6f24b9934e6c797ef6f5e123ac520d5 |
|
22-Oct-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Use ONESHOT to behave properly with multiple accept() processes. |
6298945d5c4b9a8116f2b1d1f9c7f6c0ff644a05 |
|
20-Oct-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Remove datagram research TODO. This proxy will not work with them. |
20c7c931a96a51db2d7759525d3ce4e949cf2b17 |
|
20-Oct-2013 |
David Strauss <david@davidstrauss.net> |
socket-proxyd: Comment and log text cleanup.
* Standardize on "nonblocking" spelling, per Linux man pages.
* Clarify that the nonblocking sockets are never in a "blocking"
or "unblocked" state, just a "would block" or "ready" state. |
b6818c7d10659495de6424bad8e019be1001979f |
|
20-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
socket-proxyd: initialize variable used in error code path |
96c374d0a536286e18cad64d1b5ebb8f07c90334 |
|
18-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
socket-proxyd: rename from saproxy
The thing is a daemon, hence needs a "d" prefix. Also, we tend to not
abbreviate names of background components unnecessarily, since they are
not primary commands people type. Then, the fact that this thing does
socket actviation is mostly in implementationd detail for the proxy.
Also, do some minor indenting clean-ups and other code updates. |