Commit graph

10170 commits

Author SHA1 Message Date
Lennart Poettering b619ec8f83 man: bring systemctl man page and --help text into the same order 2015-01-08 23:13:45 +01:00
Lennart Poettering 079dac08c6 systemctl,loginctl: start polkit agent for all polkit enabled operations 2015-01-08 23:13:45 +01:00
Lennart Poettering acf97e213e machinectl: given that machinectl invokes a number of polkit enabled methods, start the polkit agent on terminals 2015-01-08 23:13:45 +01:00
Lennart Poettering 8b0cc9a36c machinectl: show most recent log output in "machinectl status", too 2015-01-08 23:13:45 +01:00
Lennart Poettering 3c7560019e loginctl: show the 10 most recent log user/session log lines in "loginctl user-status" and "loginctl session-status" 2015-01-08 23:13:45 +01:00
Andrey Chaser 7376e83528 cryptsetup: support header= option
https://bugs.freedesktop.org/show_bug.cgi?id=66396
2015-01-08 16:33:59 -05:00
Dave Reisner d2f0e78f2b test-verbs: add unit tests for verbs minilib 2015-01-08 15:57:38 -05:00
David Herrmann b864535791 bus-proxyd: fix EPERM on replies
Imagine a kdbus peer sending a method-call without EXPECT_REPLY set
through the proxy to a dbus1 peer. The proxy turns the missing
EXPECT_REPLY flag into a dbus1 NO_REPLY_EXPECTED flag. However, if the
receipient ignores that flag (valid dbus1 behavior) and sends a reply, the
proxy will try to forward it to the original peer. This will fail with
EPERM as the kernel didn't track the reply.

We have two options now: Either we ignore EPERM for reply messages, or we
track reply-windows in the proxy so we can properly ignore replies if
EXPECT_REPLY wasn't set.

This commit chose the first option: ignore EPERM for replies. The only
down-side is that replies without matching method call will no longer be
forwarded by the proxy. This works on dbus1, though.
Nobody sane does this, so lets ignore it.
2015-01-08 21:06:14 +01:00
David Herrmann 426bb5ddb8 bus-proxyd: optimize replies if they're not requested
If a caller does not request a reply, dont send it. This skips message
creation and speeds up NO_REPLY_EXPECTED cases. Note that sd-bus still
handles this case internally, but if we handle it in bus-proxyd, we can
skip the whole message creation step.
2015-01-08 20:58:59 +01:00
David Herrmann 9dc41cc597 bus-proxy: augment credentials from /proc for cmdline update
dbus1 does not provide cmdline, so we have to augment our credentials from
/proc to beautify the bus-proxyd cmdline. We dont use this for anything
but beautification, so there shouldn't be any problems due to /proc
pid-recycling races.

This fixes bus-proxyd to no longer display 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
in its cmdline.
2015-01-08 17:46:42 +01:00
Tom Gundersen 080e78329a nspawn: fix error message when mknod fails 2015-01-08 17:09:45 +01:00
Tom Gundersen a0539d7753 path-util: plug leak 2015-01-08 17:09:45 +01:00
David Herrmann 34a317e1cc dbus1-generator: fix array sentinal
Add a {} sentinal entry so the config-iterator can properly iterate all
array elements. Fixes a segfault in the dbus1-generator.
2015-01-08 16:13:39 +01:00
Lukasz Skalski 23539f6779 sd-bus: fix copy-paste error 2015-01-08 11:11:58 +01:00
Lennart Poettering de45d72603 journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
When there are a lot of split out journal files, we might run out of fds
quicker then we want. Hence: bump RLIMIT_NOFILE to 16K if possible.

Do these even for journalctl. On Fedora the soft RLIMIT_NOFILE is at 1K,
the hard at 4K by default for normal user processes, this code hence
bumps this up for users to 4K.

https://bugzilla.redhat.com/show_bug.cgi?id=1179980
2015-01-08 03:20:45 +01:00
Lennart Poettering 2ac23519d0 udevadm: don't hit an assert when obsolete parameters are passed
https://bugzilla.redhat.com/show_bug.cgi?id=1178051
2015-01-08 01:59:58 +01:00
Lennart Poettering d61b600dde util: make it easy to initialize the crtime from the current time in fd_setcrtime() 2015-01-08 01:27:13 +01:00
Lennart Poettering dfd1520d3a import: also set NOCOW for gpt disk images
Given the write patterns on disk images, we better should turn COW off
for them. In particular as the file systems used inside the disk images
should do their own data integrity checks anyway and we don't need
multiple layers of it.
2015-01-08 01:25:40 +01:00
Lennart Poettering 11689d2a02 journald: turn off COW for journal files on btrfs
btrfs' COW logic results in heavily fragment journal files, which is
detrimental for perfomance. Hence, turn off COW for journal files as we
create them.

Turning off COW comes at the cost of data integrity guarantees, but this
should be acceptable, given that we do our own checksumming, and
generally have a pretty conservative write pattern.

Also see discussion on linux-btrfs:

http://www.spinics.net/lists/linux-btrfs/msg41001.html
2015-01-08 01:22:29 +01:00
Lennart Poettering 3c4230a5af util: upgrade default $TERM from vt102 to vt220 if we have no idea about the connected terminal
So far, if we had no knowledge about the correct $TERM we defaulted to
v102, as a safe, conservative choice. However, the terminfo data for
vt102 is not aware of pageup/pagedown, which makes "less" much harder
work with than necessary. Setting vt220 allows them to work correctly.

"vt220" should be a sufficiently safe choice too, given that xterm,
gnome-terminal and the linux console all strive to implement vt220 as
baseline, already to pass pageup/pagedown correctly to apps.

Effectively, with this change "journalctl -e" run inside a
"systemd-nspawn" terminal will now run a pager where pageup/pagedown
works, which is quite an improvement of usability for containers.
2015-01-07 23:44:08 +01:00
Lennart Poettering 2efe2438fd bus-util: fix error number output when waiting for job 2015-01-07 23:44:08 +01:00
Lennart Poettering 8545f7ceaa service: automatically create After= dependency from services to their .busname units, if BusName= is set 2015-01-07 23:44:08 +01:00
Lennart Poettering b02cb41c78 conf-parse: don't accept invalid bus names as BusName= arguments in service units 2015-01-07 23:44:08 +01:00
Lennart Poettering 978553ce5e conf-parse: make syntax logging functions behave more like other log functons
In particular, don't patch the error number to EINVAL if 0, and don't
negate it.

(Also, add do {} while (false) around multi-line macro)
2015-01-07 23:44:08 +01:00
Lennart Poettering 92d6662579 busctl: exit cleanly when the bus connection is severed 2015-01-07 20:42:14 +01:00
Lennart Poettering 52cd587789 sd-bus: when we synthesize messages, initialize timestamps ourselves 2015-01-07 20:36:23 +01:00
Lennart Poettering d29ae2914e sd-bus: unify how we set the sender of synthetic messages 2015-01-07 20:25:30 +01:00
Lennart Poettering 76877fb9cc sd-bus: make use of the newly added timestamps on kdbus kernel messages 2015-01-07 19:53:39 +01:00
Lennart Poettering 210a68826f sd-bus: always catch name requests for the special names "org.freedesktop.DBus" and "org.freedesktop.DBus.Local" and refuse them 2015-01-07 19:32:42 +01:00
Lennart Poettering 0b63e2789f machinectl: prettify "machinectl list" output 2015-01-07 19:32:42 +01:00
Michael Biebl 1ed0c19f81 sysv-generator: initialize units before use to ensure correct ordering
The original loop called fix_order() on each service immediately after
loading it, but fix_order() would reference other units which were not
loaded yet.
This resulted in bogus and unnecessary orderings based on the static
start priorities.

Therefore call load_sysv() for every init script when traversing them in
enumerate_sysv(). This ensures that all units are loaded when
fix_order() is called.

Bug-Debian: https://bugs.debian.org/771118
2015-01-07 19:08:58 +01:00
Lennart Poettering da054c3782 ptyfwd: simplify how we handle vhangups a bit 2015-01-07 14:47:10 +01:00
Lennart Poettering 5743a5852d btrfs-util: rework how we iterate through the results of the TREE_SEARCH results
Let's introduce some syntactic sugar with iteration macros, and add
correct key increment calls.
2015-01-07 14:47:10 +01:00
Michael Biebl b7e7184634 sysv-generator: handle Provides: for non-virtual facility names
The list of provided facility names as specified via Provides: in the
LSB header was originally implemented by adding those facilities to the
Names= property via unit_add_name().

In commit 95ed3294c6 the internal SysV
support was replaced by a generator and support for parsing the Names=
option had been removed from the unit file parsing in v186.
As a result, Provides: for non-virtual facility was dropped when
introducing the sysv-generator.

Since quite a few SysV init scripts still use that functionality (at
least in distros like Debian which have a large body of SysV init
scripts), add back support by making those facility names available via
symlinks to the unit filename to ensure correct orderings between
SysV init scripts which use those facility names.

Bug-Debian: https://bugs.debian.org/774335
2015-01-07 13:20:40 +01:00
Lennart Poettering 0ec5543c4c machinectl: make sure that "machinectl login" exits immediately when the machine it is connected to dies 2015-01-07 03:08:00 +01:00
Lennart Poettering f7ad54a301 util: make use of kcmp() to compare fds, if it is available 2015-01-07 02:14:14 +01:00
Lennart Poettering a7e0720602 util: don't fail recursive bind mounting if we cannot read the mount flags from an obstructed mounted 2015-01-07 01:32:13 +01:00
Lennart Poettering 2339fc936a core: implement serialization/deserialization of fd store elements 2015-01-07 01:18:13 +01:00
Lennart Poettering 1e95893a89 tmpfiles: make gcc shut up 2015-01-06 20:33:46 +01:00
Lennart Poettering b9a1617d75 journal: consider file deletion errors a reason for rotation 2015-01-06 20:31:40 +01:00
Lennart Poettering f27a386430 journald: whenever we rotate a file, btrfs defrag it
Our write pattern is quite awful for CoW file systems (btrfs...), as we
keep updating file parts in the beginning of the file. This results in
fragmented journal files. Hence: when rotating files, defragment them,
since at that point we know that no further write accesses will be made.
2015-01-06 20:31:40 +01:00
Zbigniew Jędrzejewski-Szmek 1db50423ba tmpfiles: finish with EXIT_FAILURE if anything failed
Return value is successful only if everything succeeded.
2015-01-06 09:57:40 -05:00
Zbigniew Jędrzejewski-Szmek 553d2243e2 tree-wide: remove unnecessary LOG_PRI
LOG_DEBUG is already a log level, there is no need to use LOG_PRI which
is for filtering out the facility.
2015-01-06 00:29:40 -05:00
Zbigniew Jędrzejewski-Szmek 5dabb1e04e journal-upload: enable curl debug output conditionally
https://bugs.freedesktop.org/show_bug.cgi?id=86464
2015-01-06 00:26:26 -05:00
Lennart Poettering 15f7a395c8 build-sys: add two more missing makefile links 2015-01-06 03:16:39 +01:00
Lennart Poettering 17a20d6491 machined: simplification 2015-01-06 03:16:39 +01:00
Lennart Poettering 13790add4b 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.
2015-01-06 03:16:39 +01:00
Lennart Poettering a354329f72 core: add new logic for services to store file descriptors in PID 1
With this change it is possible to send file descriptors to PID 1, via
sd_pid_notify_with_fds() which PID 1 will store individually for each
service, and pass via the usual fd passing logic on next invocation.
This is useful for enable daemon reload schemes where daemons serialize
their state to /run, push their fds into PID 1 and terminate, restoring
their state on next start from the data in /run and passed in from PID
1.

The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on
them, and the service they belong to are either not dead or failed, or
have a job queued.
2015-01-06 03:16:39 +01:00
Zbigniew Jędrzejewski-Szmek 7539904965 cgroup: memory limits on / are not supported 2015-01-05 19:04:10 -05:00
Zbigniew Jędrzejewski-Szmek 6da139137e cgroup: fix error message
systemd[1]: Failed to set memory.limit_in_bytes on : Invalid argument
2015-01-05 19:04:10 -05:00