1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00
Commit Graph

11214 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
e8e581bf25 Report about syntax errors with metadata
The information about the unit for which files are being parsed
is passed all the way down. This way messages land in the journal
with proper UNIT=... or USER_UNIT=... attribution.

'systemctl status' and 'journalctl -u' not displaying those messages
has been a source of confusion for users, since the journal entry for
a misspelt setting was often logged quite a bit earlier than the
failure to start a unit.

Based-on-a-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
2013-04-17 00:09:16 -04:00
Zbigniew Jędrzejewski-Szmek
c1b6628d64 core: log a few more things under UNIT=... 2013-04-17 00:09:16 -04:00
Zbigniew Jędrzejewski-Szmek
799de03f51 core/main: generate 4 parsing functions from a macro 2013-04-17 00:09:15 -04:00
Zbigniew Jędrzejewski-Szmek
eb3491d9ab conf-parser: generate 7 parsing functions from a macro
Those functions were identical, apart from typos. Log message
is modified to contain the type of destination var (int, double,
...). I think this might make it easier to understand why a value
was rejected (e.g. a minus from an unsigned type).
2013-04-17 00:09:15 -04:00
Steven Hiscocks
6a58bf4135 python-systemd: Reader return special fields and _Reader changes
Changes to _Reader make it match closer to C API, by removing `get_next`
and `get_previous`. A `get_all` method added, which returns dictionary
of fields using C API SD_JOURNAL_FOREACH_DATA macro, which can be used
in conjunction with `next`.

_Reader `get`, `next`, `get_{realtime,monotonic,cursor}` and new
`previous` methods are made private. This is so the traversal and
getting of journal fields can be made transparent in the python
interface.

Reader now solely implements `get_next` and `get_previous`, returning a
standard dictionary (future: other mapping types?) with all standard and
special fields through the converters. This makes the output the same as
journalctl json/export format output.

Iterator methods also moved to Reader, as they do not function as intend
with changes to _Reader.

These changes also mean that more optimised journal interfaces can be
made more easily from _Reader, by avoiding getting of unrequired fields
by using the `_get` method, and avoiding field conversions.
2013-04-17 00:09:15 -04:00
Zbigniew Jędrzejewski-Szmek
76a80d93b5 systemd-python: export new sd_journal_{process,get_events,get_timeout}
get_timeout_ms is added as a convenience function, since
it is abysmally hard to call clock_gettime() in Python
versions lower than 3.3. And even for Python 3.3 users
it saves a few lines.
2013-04-16 20:17:40 -04:00
Michal Schmidt
f6422def2c journal: fix off-by-one error in native message iovec counting
Thanks to Cristian Ciupitu for a reproducer.
https://bugzilla.redhat.com/show_bug.cgi?id=924359
2013-04-16 23:07:14 +02:00
Lennart Poettering
49aa47c7fb util: make generation of profcs PID paths nicer 2013-04-16 14:50:05 +02:00
Lennart Poettering
6606089752 path-util: unify code for detecting OS trees
This also makes sure we always detect an OS tree the same way, by
checking for /etc/os-release.
2013-04-16 05:47:04 +02:00
Lennart Poettering
dfb33a9737 macro: rework how we define cleanup macros
There's now a generic _cleanup_ macro with an argument. The macros for
specific types are now defined using this macro, and in the header files
where they belong.

All cleanup handlers are now inline functions.
2013-04-16 05:25:57 +02:00
Lennart Poettering
82da66fb75 util: replace decimal_str_max() by a typesafe macro DECIMAL_STR_WIDTH()
DECIMAL_STR_WIDTH() now works on any numeric type, and is easier to
distingish from DECIMAL_STR_MAX().

This also replaces another manual implementaiton of ulog10 by this macro.
2013-04-16 05:04:53 +02:00
Lennart Poettering
d8d3d8a781 bus: parse unit/user unit/session from cgroup path 2013-04-16 04:54:46 +02:00
Lennart Poettering
4ff49cb630 update TODO 2013-04-16 04:41:21 +02:00
Lennart Poettering
7027ff61a3 nspawn: introduce the new /machine/ tree in the cgroup tree and move containers there
Containers will now carry a label (normally derived from the root
directory name, but configurable by the user), and the container's root
cgroup is /machine/<label>. This label is called "machine name", and can
cover both containers and VMs (as soon as libvirt also makes use of
/machine/).

libsystemd-login can be used to query the machine name from a process.

This patch also includes numerous clean-ups for the cgroup code.
2013-04-16 04:41:21 +02:00
Lennart Poettering
cec4ead904 util: make sure result of hostname_cleanup() passes hostname_is_valid() 2013-04-16 04:41:21 +02:00
Lennart Poettering
ed85d9a58d logind: filter configured cgroup controller lists 2013-04-16 04:41:21 +02:00
Lennart Poettering
54b758dd14 logind: when looking for cgroup prefixes, allocate from stack 2013-04-16 04:41:21 +02:00
Michael Biebl
b45e9abd1d libudev: remove udev_monitor_new_from_socket() symbol
This function was removed in v183, so drop it from the symbols
versioning file.
2013-04-16 02:15:45 +02:00
Kay Sievers
6133cee253 bus: copy iteration macro from the kernel 2013-04-16 02:10:55 +02:00
Kay Sievers
c225e76785 hwdb: update 2013-04-16 01:45:44 +02:00
Kay Sievers
68cfd33173 bus: catch up with kernel changes 2013-04-16 01:44:36 +02:00
Auke Kok
c4d58b0b6d bootchart: put the bootchart into the journal.
This bit of code is mostly stolen from coredump.c. We construct
a simple journal message and append the bootchart file in the
journal automatically.

You can extract the latest bootchart from the current boot with
something like:

$ journalctl -b MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518 --field=BOOTCHART

which prints it to stdout.

None of the other logic is touched. The journal entry is created
even if bootchart was run manually, which is probably wrong.
2013-04-15 16:28:41 -07:00
Kay Sievers
8ad802ec35 bus: fix missing macro argument renaming
<fdo-vcs> systemd kay master * b1454bf src/libsystemd-bus/ bus-kernel.c kdbus.h
<fdo-vcs> systemd bus: catch up with kernel changes
<kmacleod> kay: randomly looked at your commit, it looks like in KDBUS_FOREACH_ITEM
  you missed changing a (d) to an (i) in (uint8_t*) (d) < (uint8_t*) (k) + (k)->size;  ?
<kay> kmacleod: hah, so there *is* a reason for using _foo in macros :)
<kay> kmacleod: thanks!
2013-04-15 23:39:42 +02:00
Kay Sievers
b1454bf05c bus: catch up with kernel changes 2013-04-15 23:32:38 +02:00
Lennart Poettering
9a3ef988b8 audit: since nspawn now sets CAP_AUDIT_CONTROL for containers we cannot user this anymore to skip audit session ID retrieval
As audit is still broken in containers we need a reliable way how we can
determine whether the audit data we read from 7proc is actually useful.
Previously we used CAP_AUDIT_CONTROL for this, since nspawn removed that
from the nspawn container. This has changed a while back however, which
means we used audit data of host system in the container.

This adds an explicit container check to the audit calls, so that all
audit data is turned off in containers.

This should fix session creation with pam_systemd/logind in nspawn containers.
2013-04-15 21:59:04 +02:00
Lennart Poettering
7a9ec5c902 core: let's make our log messages proper sentences with full stops 2013-04-15 21:59:04 +02:00
Lennart Poettering
a32360f1a5 core: always create /user and /machine top-level cgroup dirs
This allows clients to put inotify watches on these trees to watch for
state changes, without having to wait until these dirs are created.

This introduces the new top-level /machine cgroup dir as canonical
location where OS containers and VMs shall be located (as discussed with
the libvirt folks).
2013-04-15 21:59:04 +02:00
Lennart Poettering
a53824ea74 update TODO 2013-04-15 21:59:04 +02:00
Harald Hoyer
fee79e010f do not change console to non-unicode for LANG=C
If systemd-vconsole-setup was started with LANG=C (no locale.conf), then
it would set the console to non-unicode, which is not what we want.
2013-04-15 18:37:24 +02:00
Anatol Pomozov
ab06eef810 Fix spelling errors using 'codespell' tool 2013-04-15 08:40:05 -04:00
Lennart Poettering
97e1305817 sd-login: add a sd_pid_get_user_unit() call 2013-04-15 14:16:45 +02:00
Lennart Poettering
6c03089c32 bus: handle env vars safely
Make sure that our library is safe for usage in SUID programs when it
comes to env var handling
2013-04-15 14:05:03 +02:00
Lennart Poettering
4a875b6133 kdbus: parse cgroup meta data, too 2013-04-15 01:51:37 +02:00
Lennart Poettering
c62e11ce39 localectl: read X11 keymaps from the correct file
As reported by Sergey Udaltsov.
2013-04-15 01:30:21 +02:00
Zbigniew Jędrzejewski-Szmek
1e8e0a3221 udev/ata_id: zero out variable properly
b8a2b0f76 'use initalization instead of explicit zeroing'
introduced a bug where only the first sizeof(uint_t*) bytes
would be zeroed out, instead of the whole array.
2013-04-14 18:52:24 -04:00
Zbigniew Jędrzejewski-Szmek
e9b807c168 bus: remove two unused variables 2013-04-14 18:52:24 -04:00
Zbigniew Jędrzejewski-Szmek
ee6349a726 systemd-python: fix formatting in docstring 2013-04-14 18:38:32 -04:00
Auke Kok
a1d4ca9d8a TODO: bootchart items. 2013-04-14 14:11:47 -07:00
Auke Kok
cfca24f3df readahead: document options and commands. 2013-04-14 12:54:54 -07:00
Zbigniew Jędrzejewski-Szmek
268d944e44 readahead-analyze: avoid division-by-0
Also remove a few casts and use _cleanup_fclose_ to simplify logic.
2013-04-14 14:29:17 -04:00
Zbigniew Jędrzejewski-Szmek
4094bcbfac MurmurHash3: actually inline functions
"__attribute__((always_inline))" does not replace "inline" and they
still need to be used together. This fixes "always_inline function
might not be inlinable [-Wattributes]" warning in gcc 4.7

Idea-from-patch-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
2013-04-14 13:11:06 -04:00
Lennart Poettering
a56f19c4f9 kdbus: generare bloom filters properly for messages we send 2013-04-14 17:49:18 +02:00
Lennart Poettering
2404302e50 kdbus: update kdbus.h from upstream 2013-04-14 17:47:12 +02:00
Lennart Poettering
88fe224c8c bus: always explicitly rewind read index before passing message to caller or callback 2013-04-14 17:46:41 +02:00
Lennart Poettering
42c5aaf3ba bus: fix counting of argN= matches 2013-04-14 17:45:26 +02:00
Lennart Poettering
ed5c5dbde1 util: introduce alloca0() and use it at a number of places 2013-04-14 17:43:59 +02:00
Kay Sievers
01f6c9d468 bus: zero data structure and catch up with error value change 2013-04-14 16:28:34 +02:00
Lennart Poettering
77930f1120 kdbus: also parse cmdline message attribute 2013-04-14 03:20:23 +02:00
Lennart Poettering
75722f1d48 kdbus: make name acquirement ioctls valgrind clean 2013-04-14 03:20:23 +02:00
Zbigniew Jędrzejewski-Szmek
abad76cc4c Include <fcntl.h> instead of <sys/fcntl.h>
<fcntl.h> is POSIX. On Linux, <sys/fcntl.h> simply includes
<fcntl.h>, so there should be on difference. On Android
likewise, except that there is some more stuff. QNX has
only <fcntl.h>.

https://bugs.freedesktop.org/show_bug.cgi?id=63423
2013-04-13 21:02:03 -04:00