1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00
Commit Graph

13246 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
50f72bca65 Do not log all assert_return failures
% build/journalctl help
Assertion 'match_is_valid(data, size)' failed at ../src/journal/sd-journal.c:227, function sd_journal_add_match(). Ignoring.

Callers cannot be expect to check all arguments always.
2013-12-11 22:26:55 -05:00
Djalal Harouni
faf5077f89 journal: pipe journalctl help output into a pager
journalctl help output might run off the screen, so be consistent
as other systemd tools do and pipe it into a pager.
2013-12-11 22:26:55 -05:00
Zbigniew Jędrzejewski-Szmek
05b92756f7 man: mention SYSTEMD_USER_WANTS
Also split into paragraphs for easier reading and make a few minor
corrections.
2013-12-11 22:26:18 -05:00
Lennart Poettering
7596e9e10a service: actually leave watchdog enabled in the states where it matters 2013-12-12 03:06:21 +01:00
Lennart Poettering
fe2b58a4ff timedated: make sure GetAll() succeeds in systems lacking /dev/rtc (such as containers) 2013-12-12 03:06:21 +01:00
Thomas Hindoe Paaboel Andersen
d514feaa87 test-fileio: replace mktemp with mkstemp to avoid warnings
This is a fairly useless thing to do but it makes the compilers
and analyzers shut up about the use of mktemp.
2013-12-12 02:46:09 +01:00
Lennart Poettering
d78bf250b0 bus: properly generate NameOwnerChanged messages when we take from/give back to queue/starter 2013-12-12 01:51:51 +01:00
Lennart Poettering
689bd78d10 bus: fix order in which we check creds 2013-12-12 01:39:32 +01:00
Lennart Poettering
0a825b5cd4 update TODO 2013-12-12 01:39:21 +01:00
Lennart Poettering
7f7030e23e bus: update name listing logic to current kernel interface 2013-12-12 00:35:23 +01:00
Lennart Poettering
6a4abbc877 bus: when checking whether a creds object contains some field, don't use assert_return()
These are not programming errors, so they shouldn't use assert_return()
2013-12-12 00:20:11 +01:00
Lennart Poettering
9e5548644f bus: connect directly via kdbus in sd_bus_open_system_container()
kdbus fortunately exposes the container's busses in the host fs, hence
we can access it directly instead of doing the namespacing dance.
2013-12-12 00:07:49 +01:00
Lennart Poettering
ba276c8153 sd-event: try to move each wakeup to the same spot within every 10s
In addition to the same spot within every 1min, every 1s, every 250s
2013-12-11 23:41:21 +01:00
Lennart Poettering
21c6dc33a6 journald: make sure the stdout/stderr stream fd is removed from epoll before we close it 2013-12-11 23:36:59 +01:00
Lennart Poettering
b3de50cb07 units: don't run readahead done timers in containers
We don't run the collector in the container either, hence we don't need
to stop it either.
2013-12-11 23:31:34 +01:00
Lennart Poettering
e9174f29c7 journald: cache cgroup root path, instead of querying it on every incoming log message 2013-12-11 23:31:07 +01:00
Lennart Poettering
897395791f journal: when listing logs of a container make sure we don't accidentally show messages from host too 2013-12-11 23:10:36 +01:00
Lennart Poettering
0c24bb2346 journald: cache hostname, boot_id and machine_id fields instead of generating them fresh for each log entry 2013-12-11 22:55:57 +01:00
Lennart Poettering
91bf3b3e12 journal: don't go belly up when an stdout/stderr client terminates the connection 2013-12-11 22:17:15 +01:00
Lennart Poettering
b6741478e7 journal: add ability to browse journals of running OS containers
This adds the new library call sd_journal_open_container() and a new
"-M" switch to journalctl. Particular care is taken that journalctl's
"-b" switch resolves to the current boot ID of the container, not the
host.
2013-12-11 22:04:03 +01:00
Lennart Poettering
842129f587 service: clean up watchdog logic a bit 2013-12-11 20:55:09 +01:00
Lennart Poettering
f9a810beda journald: port to sd-event and enable watchdog support 2013-12-11 20:55:09 +01:00
Lennart Poettering
419173e60a man: explain in more detail how SYSTEMD_READY= influences SYSTEMD_WANTS= in udev rules
https://bugzilla.redhat.com/show_bug.cgi?id=1026860
2013-12-11 18:38:51 +01:00
Lennart Poettering
cde93897cd 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.
2013-12-11 18:20:09 +01:00
Lennart Poettering
08cd155254 event: when handling SIGCHLD of a child process only reap after dispatching event source
That way the even source callback is run with the zombie process still
around so that it can access /proc/$PID/ and similar, and so that it can
be sure that the PID has not been reused yet.
2013-12-11 18:20:09 +01:00
Kay Sievers
e599ba01f5 bus: kdbus - skip only STARTER and IN_QUEUE names for NameOwnerChanged 2013-12-11 05:38:25 +01:00
Zbigniew Jędrzejewski-Szmek
c099716487 activate: clean up inherited descriptors
> [simon@troela server]$ /usr/lib/systemd/systemd-activate -l 9000 main.js
> Assertion 'fd == 3 + count' failed at src/activate/activate.c:115,
> function open_sockets(). Aborting.
> Aborted (core dumped)

> after a bit debuging i found the problem:
> slim appears to leak an fd into all of its children:
> stat /proc/14004/fd/3  (14004 is the pid a random process in my session)
>  File: '/proc/14004/fd/3' -> '/var/log/slim.log'

systemd-activate should be robust against the shell (or anything else) leaking
descriptors. Now everything except stdin/stdout/stderr and received sockets
will be closed.
2013-12-10 21:52:57 -05:00
Zbigniew Jędrzejewski-Szmek
8be1284842 Update README with test/ requirements 2013-12-10 20:38:33 -05:00
Zbigniew Jędrzejewski-Szmek
e3bfb7be07 journald: malloc less when streaming messages 2013-12-10 20:38:33 -05:00
Luke Shumaker
90d14d2015 ptyfwd: Don't set the output prop of stdin, nor the input props of stdout.
It was calling cfmakeraw(3) on the properties for STDIN_FILENO; cfmakeraw
sets both input and output properties.  If (and only if) stdin and stdout
are the same device is this correct.  Otherwise, we must change only the
input properties of stdin, and only the output properties of stdout.
2013-12-11 01:04:21 +00:00
Luke Shumaker
eaf73b0616 ptyfwd: Set the size of the PTY base on the size of stdout, not stdin. 2013-12-11 01:01:40 +00:00
David Herrmann
559a4d4cda core: fix Unit.SetProperties argument parsing
SetProperties has signature "ba(sv)", but the bus_unit_set_properties()
helper already does a enter_container('a', "sv") so we have to skip it in
bus_unit_method_set_properties().
2013-12-10 23:28:07 +00:00
Lennart Poettering
f820cf99c1 bus: do not dispatch incoming method calls that are broacasted to vtables 2013-12-10 23:11:10 +00:00
Lennart Poettering
a82cafb97b bus: don't generate assert warnings when we detach a detached bus from an event 2013-12-10 23:06:50 +00:00
Lennart Poettering
80caea6cc7 update TODO 2013-12-10 22:50:29 +00:00
Shawn Landden
9a636ed809 core: epoll and signalfd has been moved into sd event loop 2013-12-10 22:50:29 +00:00
Thomas Hindoe Paaboel Andersen
96115cdfe0 fix scan-build issues
The static analyzer scan-build had a few issues with analysing
parts of systemd.

gpt-auto-generator.c:
scan-build could not find blkid.h. Whether it should be blkid.h or
blkid/blkid.h seems to depend on the version used. We already use
blkid/blkid.h in udev-builtin-blkid.c so it seems safe to use that
here too.

Makefile.am:
Moved some -D's from CFLAGS to CPPFLAGS. I also simplified them a
bit and got rid of a left over DBUS_CFLAGS.

test-cgroup-mask.c/test-sched-prio.c
A variable was added to store the replaced TEST_DIR. When wrapped
in an assert_se TEST_DIR was not replaced in the logged error.
While not an issue introduced in this patch we might as well fix
it up while we are here.
2013-12-10 22:30:46 +01:00
Lennart Poettering
ff4994c507 bus: generate debug messages when we cannot deliver messages via kdbus 2013-12-10 20:38:51 +00:00
Lennart Poettering
5b1bc83f81 bus: when we _unref() a NULL pointer, don't use assert_return()
We support unreffing NULL pointers just fine and we shouldn't pay the
_unlikely_() price for it, not get a debug message if we do, hence let's
not use assert_return() here.
2013-12-10 20:38:04 +00:00
Lukasz Skalski
c8fa3f6030 bus: Add bus_kernel_monitor function 2013-12-10 20:32:20 +00:00
Lennart Poettering
65a6df56f1 hashmap: make gcc shut up on old glibcs that lack getauxval() 2013-12-10 19:52:16 +00:00
Lennart Poettering
14c1025934 journald: use a bit more cleanup magic! 2013-12-10 19:51:47 +00:00
Lennart Poettering
35460afc48 Revert "libsystemd-bus: use assert_return"
This reverts commit f7e2bd5a80.

Most of these checks are not programming errors, but happen during
normal runtime. For example bus_kernel_pop_memfd() is called all the
time on non-kdbus systems and is supposed to quickly fail if kdbus is
not available. However, assert_return() makes this failure
expensive, and hence has no place here. With the most recent change to
assert_return() it will even log a debug message, which should never
happen here.
2013-12-10 19:31:10 +00:00
Lennart Poettering
ecad10fe4a Revert "systemd: add a start job for all units in SYSTEMD_[USER_]WANTS="
This reverts commit e775289d56.

We really should let the dependency logic add jobs for dependencies here
rather than manually adding in jobs, overtaping the real problem.
2013-12-10 18:53:56 +00:00
Lennart Poettering
98088803bb util: check for overflow in greedy_realloc() 2013-12-10 18:53:56 +00:00
Kay Sievers
e77f18939b bus: update kdbus.h 2013-12-10 19:26:51 +01:00
Shawn Landden
145b1f799f core/manager: remove infinite loop 2013-12-10 18:08:25 +00:00
Lennart Poettering
80514f9c9b macro: log assertion at debug level in assert_return() 2013-12-10 17:01:10 +00:00
Lennart Poettering
6e8df5f00a bus: introduce new SD_BUS_VTABLE_HIDDEN flag for vtable members
When this flag is set then its member will not be shown in the
introspection data. Also, properties with this flag set will not be
included in GetAll() responses.
2013-12-10 16:52:49 +00:00
Lennart Poettering
adacb9575a bus: introduce "trusted" bus concept and encode access control in object vtables
Introduces a new concept of "trusted" vs. "untrusted" busses. For the
latter libsystemd-bus will automatically do per-method access control,
for the former all access is automatically granted. Per-method access
control is encoded in the vtables: by default all methods are only
accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag
is set for a method it is accessible to unprivileged clients too. By
default whether a client is privileged is determined via checking for
its CAP_SYS_ADMIN capability, but this can be altered via the
SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field
of the method.

Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and
SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note
however that read access is unrestricted, as PropertiesChanged messages
might send out the values anyway as an unrestricted broadcast.

By default the system bus is set to "untrusted" and the user bus is
"trusted" since per-method access control on the latter is unnecessary.

On dbus1 busses we check the UID of the caller rather than the
configured capability since the capability cannot be determined without
race. On kdbus the capability is checked if possible from the attached
meta-data of a message and otherwise queried from the sending peer.

This also decorates the vtables of the various daemons we ship with
these flags.
2013-12-10 16:52:49 +00:00