Commit graph

12340 commits

Author SHA1 Message Date
Lennart Poettering 3a7d4f1ba4 bus: fix synthetic error messages 2013-10-09 03:29:20 +02:00
Lennart Poettering 29ddb38fea libsystemd-bus: add lightweight object vtable implementation for exposing objects on the bus
This adds a lightweight scheme how to define interfaces in static fixed
arrays which then can be easily registered on a bus connection. This
makes it much easier to write bus services.

This automatically handles implementation of the Properties,
ObjectManager, and Introspection bus interfaces.
2013-10-09 02:40:07 +02:00
Lennart Poettering 8d1a280204 core: unify the way we denote serialization attributes 2013-10-09 00:13:55 +02:00
Sylvia Else 6aca9a587d systemd: serialize/deserialize forbid_restart value
The Service type's forbid_restart field was not preserved by
serialization/deserialization, so the fact that the service should not
be restarted after stopping was lost.

If a systemctl stop foo command has been given, but the foo service
has not yet stopped, and then the systemctl --system daemon-reload was
given, then when the foo service eventually stopped, systemd would
restart it.

https://bugs.freedesktop.org/show_bug.cgi?id=69800
2013-10-07 23:41:05 -04:00
Zbigniew Jędrzejewski-Szmek 2b8f6883a1 journalctl: flip to --full by default
We already shew lines in full when using a pager or not on a
tty. The commit disables ellipsization in the sole remaining case,
namely when --follow is used.

This has been a popular request for a long time, and indeed, full
output seems much more useful. Old behaviour can still be requested by
using --no-full. Old options retain their behaviour for compatiblity,
but aren't advertised as much. This change applies only to jornalctl,
not to systemctl, when ellipsization is useful to keep the layout.

https://bugzilla.redhat.com/show_bug.cgi?id=984758
2013-10-07 23:41:05 -04:00
Kay Sievers c26547d612 udev: support custom Linux Security Module labels for device nodes 2013-10-08 02:23:24 +02:00
Auke Kok 8b197c3a8a Run with a custom SMACK domain (label).
Allows the systemd --system process to change its current
SMACK label to a predefined custom label (usually "system")
at boot time.

This is needed to have a few system-generated folders and
sockets automatically be created with the right SMACK
label. Without that, processes either cannot communicate with
systemd or systemd fails to perform some actions.
2013-10-07 10:23:20 -07:00
Auke Kok d407c94020 Mount /run, /dev/shm usable to tasks when using SMACK.
Once systemd itself is running in a security domain for SMACK,
it will fail to start countless tasks due to missing privileges
for mounted and created directory structures. For /run and shm
specifically, we grant all tasks access.

These 2 mounts are allowed to fail, which will happen if the
system is not running a SMACK enabled kernel or security=none is
passed to the kernel.
2013-10-07 10:23:20 -07:00
Dave Reisner 1d5989fd80 shared/util: fix off-by-one error in tag_to_udev_node
Triggered false negatives when encoding a string which needed every
character to be escaped, e.g. "LABEL=/".
2013-10-06 18:29:12 -04:00
Zbigniew Jędrzejewski-Szmek a7176505e0 utf8: fix utf8_is_printable 2013-10-05 22:59:43 -04:00
Zbigniew Jędrzejewski-Szmek fc676b00a7 core: do not add "what" to RequiresMountsFor for network mounts
For cifs mount like //server/share, we would get
RequiresMountsFor=/server/share, which probably isn't
harmful, but quite confusing.

Unfortunately a bunch of static functions had to be moved
up, but patch is really one line.
2013-10-05 13:39:46 -04:00
Dave Reisner 9c03872bc8 mount: check for NULL before reading pm->what
Since a57f7e2c82, a mount unit with garbage in it would cause
systemd to crash on loading it.

ref: https://bugs.freedesktop.org/show_bug.cgi?id=70148
2013-10-04 18:23:53 -04:00
Lennart Poettering 660ea9620f logind: fix bus introspection data for TakeControl() 2013-10-04 21:17:17 +02:00
Lennart Poettering a316932f5a manager: when verifying whether clients may change environment using selinux check for "reload" rather "reboot"
This appears to be a copy/paste error.
2013-10-04 17:05:15 +02:00
Lennart Poettering 7f79cd7109 update TODO 2013-10-04 17:05:14 +02:00
Zbigniew Jędrzejewski-Szmek 77009452cf systemd: order remote mounts from mountinfo before remote-fs.target
Usually the network is stopped before filesystems are umounted.
Ordering network filesystems before remote-fs.target means that their
unmounting will be performed earlier, and can terminate sucessfully.

https://bugs.freedesktop.org/show_bug.cgi?id=70002
2013-10-03 22:15:08 -04:00
Zbigniew Jędrzejewski-Szmek 5862d652ba Introduce _cleanup_endmntent_ 2013-10-03 22:13:55 -04:00
Zbigniew Jędrzejewski-Szmek 9a5cb1371b gpt-auto-generator: exit immediately if in container
Otherwise we get an ugly warning when running systemd in
a container.
2013-10-03 22:13:01 -04:00
Zbigniew Jędrzejewski-Szmek 970edce6ef execute: more debugging messages 2013-10-03 22:12:32 -04:00
Václav Pavlín e776c8cfcd man: Improve the description of parameter X in tmpfiles.d page 2013-10-03 15:49:03 +02:00
Zbigniew Jędrzejewski-Szmek 59fccd8211 execute.c: always set $SHELL
In e6dca81 $SHELL was added to user@.service. Let's
instead provide it to all units which have a user.
2013-10-02 22:23:56 +02:00
Dave Reisner 7074fecf67 tmpfiles.d: include setgid perms for /run/log/journal
4608af4333 set permissions for journal storage on persistent disk
but not the volatile storage.

ref: https://bugs.archlinux.org/task/37170
2013-10-02 15:35:16 -04:00
Lennart Poettering 51045322c4 nspawn: always copy /etc/resolv.conf rather than bind mount
We were already creating the file if it was missing, and this way
containers can reconfigure the file without running into problems.

This also makes resolv.conf handling more alike to handling of
/etc/localtime, which is also not a bind mount.
2013-10-02 19:45:12 +02:00
Lennart Poettering 69c2b6be8f mkdir: pass a proper function pointer to mkdir_safe_internal 2013-10-02 19:45:12 +02:00
Lennart Poettering 5b4fb02d89 strv: don't access potentially NULL string arrays 2013-10-02 19:45:12 +02:00
Lennart Poettering 62678deda2 efi: never call qsort on potentially NULL arrays 2013-10-02 19:45:12 +02:00
Lennart Poettering b857193b1d modules-load: fix error handling 2013-10-02 19:45:12 +02:00
Lennart Poettering 2e8d788c2f dbus: fix return value of dispatch_rqueue() 2013-10-02 19:45:12 +02:00
Lennart Poettering f5f6e41a9e bus: fix potentially uninitialized memory access 2013-10-02 19:45:12 +02:00
Lennart Poettering 8c92d4bbc7 journald: add missing error check 2013-10-02 19:45:12 +02:00
Lennart Poettering 4b93637fd7 cryptsetup: fix OOM handling when parsing mount options 2013-10-02 19:45:12 +02:00
Václav Pavlín cbb13b2a53 systemctl: fix name mangling for sysv units 2013-10-02 16:42:53 +02:00
Lennart Poettering 2c64a8d0ca acpi: make sure we never free an uninitialized pointer 2013-10-02 14:03:56 +02:00
Dave Reisner 6c8c92fef7 fix lingering references to /var/lib/{backlight,random-seed}
This should have been part of ef5bfcf668.
2013-10-02 07:51:06 -04:00
Lukas Nykryn 7e326fb5b2 acpi-fptd: fix memory leak in acpi_get_boot_usec 2013-10-02 13:39:49 +02:00
Lennart Poettering 1434ae6fd4 cgroup: there's no point in labelling cgroupfs dirs, so let's not do that
This allows us to get rid of the dep on libsystemd-label for cgroup
management.

https://bugs.freedesktop.org/show_bug.cgi?id=69966
2013-10-02 04:59:05 +02:00
Lennart Poettering fbd8ebddbe build-sys: mkdir.[ch] should be in libsystemd-shared
Otherwise, why is mkdir-label.[ch] split out?
2013-10-02 04:56:33 +02:00
Lennart Poettering cd4010b373 build-ss: prepare new release 2013-10-02 03:02:25 +02:00
Lennart Poettering a3b6fafed4 hashmap: randomize hash functions a bit 2013-10-01 23:11:49 +02:00
David Herrmann ef7939dfbb Update TODO
Remove "logind fbdev removal" as it is no longer supported.
2013-10-01 19:21:35 +02:00
David Herrmann 3a83f5223a logind: remove fbdev session-device support
fbdev does not support access-handover so it is quite useless to route it
through logind. If compositors want to use it they ought to open it
themselves. It's highly recommended to be ignored entirely, though. fbdev
is about to be deprecated in the kernel.
2013-10-01 18:08:54 +02:00
David Herrmann 11c2f7a813 logind: run with CAP_SYS_ADMIN
DRM Master access requires CAP_SYS_ADMIN, yay! Add it to the capability
bounding set for systemd-logind. As CAP_SYS_ADMIN actually allows a huge
set of actions, this mostly renders the restriction-set useless. Anyway,
patches are already pending to reduce the restriction on the kernel side.
But these won't really make it into any stable-release so for now we're
stuck with CAP_SYS_ADMIN.
2013-10-01 17:59:44 +02:00
David Herrmann dfd552707d logind: send PropertyChanged during deactivation
We only send the PropertyChanged signal for the to-be-activated session
but not for the to-be-deactivated one. Fix that so both listeners get
notified about the new state.
2013-10-01 17:58:58 +02:00
David Herrmann c2e5d024a3 logind: check whether first drmSetMaster succeeded
The initial drmSetMaster may fail if there is an active master already. We
must not assume that all existing clients comply to logind rules. We check
for this during session-activation already but didn't during device setup.
Fix this by checking the return code.

As drmSetMaster has had horrible return codes in the past (0 for failure?
EINVAL for denied access, ..) we need to be quite pedantic. To guarantee
an open file-descriptor we need to close the device and reopen it without
master if setting master failed first.
2013-10-01 17:53:43 +02:00
David Herrmann 081dfa852f logind: fix session-device dbus notify
Had this fix lying around here for some time. Thanks to missing
type-checking for va-args we passed in the actual major/minor values
instead of pointers to it. Fix it by saving the values on the stack first
and passing in the pointers.
2013-10-01 17:48:15 +02:00
Tom Gundersen ea52e2aee8 kernel-install: add compat with 'installkernel'
If 'kernel-install' is called as 'installkernel' it will be compatible with the
syntax used by the kernel's build system.

This means it can be called by doing 'make install' in a kernel build
directory, if the correct symlink has been installed (which we don't do by
default yet).

[Edit harald@redhat.com: removed basename and use shift]
2013-10-01 17:40:30 +02:00
Lennart Poettering 4cc1fe6913 update TODO 2013-10-01 13:35:37 +02:00
Lennart Poettering 7400b9d2e9 core: whenever a new PID is passed to us, make sure we watch it 2013-10-01 05:06:56 +02:00
Chen Jie c22ceead43 util.c: ignore pollfd.revent for loop_read/loop_write
Let read()/write() report any error/EOF.
2013-10-01 04:49:59 +02:00
Evan Callicoat e6dca81441 units: Add SHELL environment variable
With the advent of systemd --user sessions, it's become very interesting to spawn X as a user unit, as well as accompanying processes that may have previously been in a .xinitrc/.xsession, or even just to replace a collection of XDG/GDM/KDM/etc session files with independent systemd --user units. The simplest case here would be to login on a tty, with the traditional /usr/sbin/login "login manager".

However, systemd --user (spawned by user@.service) is at the top level of the slice for the user, and does not inherit any environment variables from the login process. Given the number of common applications which rely on SHELL being set in the environment, it seems like the cleanest way to provide this variable is to set it to %s in the user@.service.

Ideally in the long-term, applications which rely on SHELL being set should be fixed to just grab it from getpwnam() or similar, but until that becomes more common, I propose this simple change to make user sessions a little bit nicer out of the box.
2013-10-01 04:17:31 +02:00