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. |
48cef29504b1ffc0df9929f2d8b2af2ad74d2b4a |
|
08-Jan-2016 |
Vito Caputo <vito.caputo@coreos.com> |
journal: normalize priority of logging sources
The stream event source has a priority of SD_EVENT_PRIORITY_NORMAL+5,
and stdout source +10, but the native and syslog event sources are left
at the default of 0.
As a result, any heavy native or syslog logger can cause starvation of
the other loggers. This is trivially demonstrated by running:
dd if=/dev/urandom bs=8k | od | systemd-cat & # native spammer
systemd-run echo hello & # stream logger
journalctl --follow --output=verbose --no-pager --identifier=echo &
... and wait, and wait, the "hello" never comes.
Now kill %1, "hello" arrives finally. |
6355e75610a8d47fc3ba5ab8bd442172a2cfe574 |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
selinux: split up mac_selinux_have() from mac_selinux_use()
Let's distuingish the cases where our code takes an active role in
selinux management, or just passively reports whatever selinux
properties are set.
mac_selinux_have() now checks whether selinux is around for the passive
stuff, and mac_selinux_use() for the active stuff. The latter checks the
former, plus also checks UID == 0, under the assumption that only when
we run priviliged selinux management really makes sense.
Fixes: #1941 |
cfa1b98e832026b0fa5f1ca2f8f5f65bddf12a31 |
|
18-Nov-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
journal: don't remove leading spaces |
6f526243e6a638c2ea7bbdd07b963f57e110d120 |
|
18-Nov-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
journal: drop empty lines after level_prefix removing |
e1427b138fbf7b7f13bb61187635b882be3ca2b2 |
|
09-Nov-2015 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: apply errno.cocci
with small manual cleanups for style. |
e22aa3d3284709234f086ebebc13a905a295b7a7 |
|
01-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: never block when sending messages on NOTIFY_SOCKET socket
Otherwise we might run into deadlocks, when journald blocks on the
notify socket on PID 1, and PID 1 blocks on IPC to dbus-daemon and
dbus-daemon blocks on logging to journald. Break this cycle by making
sure that journald never ever blocks on PID 1.
Note that this change disables support for event loop watchdog support,
as these messages are sent in blocking style by sd-event. That should
not be a big loss though, as people reported frequent problems with the
watchdog hitting journald on excessively slow IO.
Fixes: #1505. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
15a5e95075a7f6007dd97b2a165c8ed16fe683df |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out printf() helpers to stdio-util.h |
afc5dbf37fd2399d37976388d9dd9ab470ecf446 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
io-util.h: move iovec stuff from macro.h to io-util.h |
7ccbd1ae843d77275f2c542582a9a80e5e058a70 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out syslog-related calls into syslog-util.[ch] |
a09561746f15b84da9471b5c4be74e53d19e4f3f |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: introduce dirent-util.[ch] for directory entry calls
Also, move a couple of more path-related functions to path-util.c. |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-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. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
15d91bff36c61d38df8edff258d1702a017a0e66 |
|
02-Aug-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: move server_restore_streams out of server_open_stdout_socket
One has little to do with the other, so it's confusing that the second
also calls the first. |
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 |
|
29-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers. |
2de56f70941eaf91a4520bf33de47a87ebd8b2cb |
|
10-Jun-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: simplify context handling
By using our homegrown function we can dispense with all the iffdefery. |
4a61c3e51e96a747c30598d78ee3a24e7c569e9f |
|
13-Apr-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: use (void) to silence coverity
This shouldn't really fail and anyway not much we can do about it.
CID #996292, #996294, #996295. |
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. |
5ffa8c818120e35c89becd938d160235c069dd12 |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add a snprinf wrapper which checks that the buffer was big enough
If we scale our buffer to be wide enough for the format string, we
should expect that the calculation was correct.
char_array_0() invocations are removed, since snprintf nul-terminates
the output in any case.
A similar wrapper is used for strftime calls, but only in timedatectl.c. |
13790add4bf648fed816361794d8277a75253410 |
|
06-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: allow restarting journald without losing stream connections
Making use of the fd storage capability of the previous commit, allow
restarting journald by serilizing stream state to /run, and pushing open
fds to PID 1. |
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. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
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(). |
6baa7db00812437bbc87e73faa1a11b6cf631958 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention |
6b9732b2bf0499c5e4ea8a9d4f6051d98033f680 |
|
19-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Be more verbose when bind or listen fails
Also be more verbose in devnode_acl_all(). |
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. |
40b71e89bae4e51768db4dc50ec64c1e9c96eec4 |
|
14-Mar-2014 |
Sebastian Thorarensen <sebth@naju.se> |
journald: add support for wall forwarding
This will let journald forward logs as messages sent to all logged in
users (like wall).
Two options are added:
* ForwardToWall (default yes)
* MaxLevelWall (default emerg)
'ForwardToWall' is overridable by kernel command line option
'systemd.journald.forward_to_wall'.
This is used to emulate the traditional syslogd behaviour of sending
emergency messages to all logged in users. |
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. |
eff05270986a13e7de93ae16311f654d3f7c166f |
|
24-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
util: unify SO_PEERCRED/SO_PEERSEC invocations
Introduce new call getpeercred() which internally just uses SO_PEERCRED
but checks if the returned data is actually useful due to namespace
quirks. |
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. |
21c6dc33a6fc0e8617247fc12123bc667dcde92b |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: make sure the stdout/stderr stream fd is removed from epoll before we close it |
91bf3b3e124575f6f647bff29766e9d992f55b32 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
journal: don't go belly up when an stdout/stderr client terminates the connection |
f9a810bedacf1da7c505c1786a2416d592665926 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: port to sd-event and enable watchdog support |
e3bfb7be07d9b1f4ebb12eb22c4c8bcd2a988d51 |
|
11-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: malloc less when streaming messages |
14c1025934e709d07948c13ca62b40c35c91d111 |
|
10-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: use a bit more cleanup magic! |
f92ae4968f070ef0ada61ba7cd585794fac404dd |
|
08-Dec-2013 |
Dan McGee <dan@archlinux.org> |
Fix memory leak in stdout journal streams
Just as 'identifier' is strdup-ed and freed, we need to do the same for
unit_id. |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
d682b3a7e7c7c2941a4d3e193f1e330dbc9fae89 |
|
10-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
security: rework selinux, smack, ima, apparmor detection logic
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled. |
ac50788b0f5aeee09e7d45db28ae8ab7f39cd52e |
|
19-Aug-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: fix parsing of facility in syslog messages
In 49998b383 (journald: do not overwrite syslog facility when
parsing priority) journald started ignoring facility part when
reading service stderr to convert to syslog messages. In this
case it is fine, because only the priority is allowed.
But the same codepath is used for syslog messages, where the
facility should be used. Split the two codepaths by explicitly
specyfing whether the facility should be ignored or not.
https://bugzilla.redhat.com/show_bug.cgi?id=988814 |
968f319679d9069af037240d0c3bcd126181cdac |
|
21-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: allow callers to specify OBJECT_PID=
When journald encounters a message with OBJECT_PID= set
coming from a priviledged process (UID==0), additional fields
will be added to the message:
OBJECT_UID=,
OBJECT_GID=,
OBJECT_COMM=,
OBJECT_EXE=,
OBJECT_CMDLINE=,
OBJECT_AUDIT_SESSION=,
OBJECT_AUDIT_LOGINUID=,
OBJECT_SYSTEMD_CGROUP=,
OBJECT_SYSTEMD_SESSION=,
OBJECT_SYSTEMD_OWNER_UID=,
OBJECT_SYSTEMD_UNIT= or OBJECT_SYSTEMD_USER_UNIT=.
This is for other logging daemons, like setroubleshoot, to be able to
augment their logs with data about the process.
https://bugzilla.redhat.com/show_bug.cgi?id=951627 |
8060a8b32d9f0c6244dfb6814fb0e339475bcd98 |
|
13-May-2013 |
Auke Kok <auke-jan.h.kok@intel.com> |
journald-stream: typo in error message. |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert. |
41891700e02daf0cab9e86908c76ac6f411bbd57 |
|
11-Mar-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: allow priority of 999, too |
e14ddf1cac12f91685cbd5dac6c5127f8cf87863 |
|
08-Mar-2013 |
Michal Schmidt <mschmidt@redhat.com> |
journal: allow priority 0 in stdout stream
Priority 0 is acceptable (it's LOG_EMERG).
BTW, I'm not sure why we allow priorities up to 999, but I'm leaving
this be for now.
http://lists.freedesktop.org/archives/systemd-devel/2013-March/009510.html |
d025f1e4dca8fc1436aff76f9e6185fe3e728daa |
|
14-Nov-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
build-sys: store journald code in a noinst library
The point is to allow the use of journald functions by other binaries.
Before, journald code was split into multiple files (journald-*.[ch]),
but all those files all required functions from journald.c. And
journald.c has its own main(). Now, it is possible to link against
those functions, e.g. from test binaries.
This constitutes a fix for https://bugzilla.redhat.com/show_bug.cgi?id=872638.
The patch does the following:
1. rename journald.h to journald-server.h and move corresponding code
to journald-server.c.
2. add journald-server.c and other journald-*.c parts to
libsystemd-journal-internal.
3. remove journald-syslog.c from test_journal_syslog_SOURCES, since
it is now contained in libsystemd-journal-internal.
There are no code changes, apart from the removal of a few static's,
to allow function calls between files. |
4871690d9e32608bbd9b18505b5326c2079c9690 |
|
24-Aug-2012 |
Allin Cottrell <cottrell@wfu.edu> |
journald: add missing includes |
3b7124a8db56ed57525b9ecfd19cfdc8c9facba0 |
|
22-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: split console transport stuff into its own file |
a45b9fca6b91a767dcd9060cfcb30617dad234c7 |
|
22-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journald: move stream protocol into its own .c file |