chiark / gitweb /
elogind.git
10 years agologs-show.c: show all messages for a slice
Zbigniew Jędrzejewski-Szmek [Mon, 30 Sep 2013 21:58:44 +0000 (23:58 +0200)]
logs-show.c: show all messages for a slice

10 years agobuild-sys: link libsystemd-login with libsystemd-label.la
Michał Górny [Mon, 30 Sep 2013 08:08:09 +0000 (10:08 +0200)]
build-sys: link libsystemd-login with libsystemd-label.la

libsystemd-login.la uses cg_create() that currently seems to be a part
of libsystemd-label.la. However, it doesn't link against that library
and it seems that none of the (unconditional) libraries it uses do. In
the end, people end up getting «undefined reference to `cg_create'»
when trying to build e.g. dbus.

10 years agoman: mention the systemd homepage from systemd(1)
Lennart Poettering [Mon, 30 Sep 2013 16:56:34 +0000 (18:56 +0200)]
man: mention the systemd homepage from systemd(1)

10 years agoupdate TODO
Lennart Poettering [Mon, 30 Sep 2013 16:54:12 +0000 (18:54 +0200)]
update TODO

10 years agoman: link cgroups api docs from relevant man pages
Lennart Poettering [Mon, 30 Sep 2013 16:54:05 +0000 (18:54 +0200)]
man: link cgroups api docs from relevant man pages

10 years agoset IgnoreOnIsolate=true for systemd-cryptsetup@.service
Andrey Borzenkov [Sun, 29 Sep 2013 11:37:30 +0000 (15:37 +0400)]
set IgnoreOnIsolate=true for systemd-cryptsetup@.service

When crypttab contains noauto, cryptsetup service does not have any
explicit dependencies. If service is started later manually (directly or via
mount dependency) it will be stopped on isolate.

mount units already have IgnoreOnIsolate set by default. Set it by
default for cryptsetup units as well.

10 years agoFix buffer overrun when enumerating files
Zbigniew Jędrzejewski-Szmek [Sun, 29 Sep 2013 12:40:58 +0000 (14:40 +0200)]
Fix buffer overrun when enumerating files

https://bugs.freedesktop.org/show_bug.cgi?id=69887

Based-on-a-patch-by: Hans Petter Jansson <hpj@copyleft.no>
10 years agokmod-static-nodes: condition execution on modules.devname
Dave Reisner [Sat, 28 Sep 2013 18:51:39 +0000 (14:51 -0400)]
kmod-static-nodes: condition execution on modules.devname

10 years agoAdd a bit more explicit message, to help confused users
Michael Scherer [Fri, 27 Sep 2013 09:43:28 +0000 (11:43 +0200)]
Add a bit more explicit message, to help confused users

Seeing http://www.happyassassin.net/2013/09/27/further-sysadmin-adventures-wheres-my-freeipa-badge/
it seems that the default message is a bit confusing for people
who never encountered it before, so adding a link to the manpage could
help them.

10 years agokernel-install: avoid using 'cp --preserve'
Tom Gundersen [Wed, 25 Sep 2013 20:58:00 +0000 (22:58 +0200)]
kernel-install: avoid using 'cp --preserve'

Force 0644 and root:root instead, to avoid problems with fat filesystems.

10 years agobuild-sys: restore detection of sphinx
Zbigniew Jędrzejewski-Szmek [Fri, 27 Sep 2013 06:24:00 +0000 (08:24 +0200)]
build-sys: restore detection of sphinx

10 years agoDo not use unitialized variable and remove duplicated line
Zbigniew Jędrzejewski-Szmek [Fri, 27 Sep 2013 05:58:57 +0000 (07:58 +0200)]
Do not use unitialized variable and remove duplicated line

10 years agoUpdate TODO
Lennart Poettering [Fri, 27 Sep 2013 00:59:50 +0000 (02:59 +0200)]
Update TODO

10 years agoswap: properly expose timeout property on the bus
Lennart Poettering [Fri, 27 Sep 2013 00:02:21 +0000 (02:02 +0200)]
swap: properly expose timeout property on the bus

10 years agodbus: fix introspection for TimerSlackNSec
Lennart Poettering [Thu, 26 Sep 2013 22:35:36 +0000 (00:35 +0200)]
dbus: fix introspection for TimerSlackNSec

10 years agosystemctl: make sure set-property mangles unit names
Lennart Poettering [Thu, 26 Sep 2013 22:11:54 +0000 (00:11 +0200)]
systemctl: make sure set-property mangles unit names

10 years agoman: drop references to "cgroup" wher appropriate
Lennart Poettering [Thu, 26 Sep 2013 22:05:07 +0000 (00:05 +0200)]
man: drop references to "cgroup" wher appropriate

Since cgroups are mostly now an implementation detail of systemd lets
deemphasize it a bit in the man pages. This renames systemd.cgroup(5) to
systemd.resource-control(5) and uses the term "resource control" rather
than "cgroup" where appropriate.

This leaves the word "cgroup" in at a couple of places though, like for
example systemd-cgtop and systemd-cgls where cgroup stuff is at the core
of what is happening.

10 years agocore: drop some out-of-date references to cgroup settings
Lennart Poettering [Thu, 26 Sep 2013 20:49:44 +0000 (22:49 +0200)]
core: drop some out-of-date references to cgroup settings

10 years agologind: never consider a closing session relevant for PK checks
Lennart Poettering [Thu, 26 Sep 2013 19:32:47 +0000 (21:32 +0200)]
logind: never consider a closing session relevant for PK checks

https://bugzilla.redhat.com/show_bug.cgi?id=1010215

10 years agomain: set umask before creating any files
Mike Gilbert [Thu, 26 Sep 2013 18:39:41 +0000 (20:39 +0200)]
main: set umask before creating any files

This avoids a problem when we inherit a non-zero umask from the
initramfs. This would cause /run/systemd to be created with the wrong
mode.

10 years agologind: if a user is sitting in front of the computer and can shutdown the machine...
Lennart Poettering [Thu, 26 Sep 2013 18:31:37 +0000 (20:31 +0200)]
logind: if a user is sitting in front of the computer and can shutdown the machine anyway he should also be able to reboot it

10 years agocore: rework how we match mount units against each other
Lennart Poettering [Thu, 26 Sep 2013 18:14:24 +0000 (20:14 +0200)]
core: rework how we match mount units against each other

Previously to automatically create dependencies between mount units we
matched every mount unit agains all others resulting in O(n^2)
complexity. On setups with large amounts of mount units this might make
things slow.

This change replaces the matching code to use a hashtable that is keyed
by a path prefix, and points to a set of units that require that path to
be around. When a new mount unit is installed it is hence sufficient to
simply look up this set of units via its own file system paths to know
which units to order after itself.

This patch also changes all unit types to only create automatic mount
dependencies via the RequiresMountsFor= logic, and this is exposed to
the outside to make things more transparent.

With this change we still have some O(n) complexities in place when
handling mounts, but that's currently unavoidable due to kernel APIs,
and still substantially better than O(n^2) as before.

https://bugs.freedesktop.org/show_bug.cgi?id=69740

10 years agounit-name: when escaping a path consider the empty path identical to the root dir
Lennart Poettering [Thu, 26 Sep 2013 18:03:20 +0000 (20:03 +0200)]
unit-name: when escaping a path consider the empty path identical to the root dir

10 years agoutil: properly handle the root dir in PATH_FOREACH_PREFIX
Lennart Poettering [Thu, 26 Sep 2013 17:58:33 +0000 (19:58 +0200)]
util: properly handle the root dir in PATH_FOREACH_PREFIX

Also add PATH_FOREACH_PREFIX_MORE which includes the specified dir
itself in the iteration

10 years agocgroup: when referencing cgroup controller trees allow omission of the path
Lennart Poettering [Thu, 26 Sep 2013 17:57:58 +0000 (19:57 +0200)]
cgroup: when referencing cgroup controller trees allow omission of the path

10 years agoMove part of logind.c into a separate file
Zbigniew Jędrzejewski-Szmek [Wed, 25 Sep 2013 15:04:41 +0000 (17:04 +0200)]
Move part of logind.c into a separate file

liblogind-core.la was underlinked, missing a few functions
defined in logind.c. They are moved to a new file, logind-core.c,
and this file is linked into liblogind-core.la.
In addition, logind-acl.c is attached to the liblogind-core.la,
instead of systemd-logind directly.

10 years agoMove functions around to fix underlinking in test-machine-tables
Zbigniew Jędrzejewski-Szmek [Wed, 25 Sep 2013 11:26:08 +0000 (13:26 +0200)]
Move functions around to fix underlinking in test-machine-tables

10 years agobuild-sys: add ./configure --enable-address-sanitizer
Zbigniew Jędrzejewski-Szmek [Thu, 26 Sep 2013 08:31:44 +0000 (10:31 +0200)]
build-sys: add ./configure --enable-address-sanitizer

Enabling address sanitizer seems like a useful thing, but is quite
tricky. Proper flags have to be passed to CPPFLAGS, CFLAGS and
LDFLAGS, but passing them on the commandline doesn't work because
we tests are done with ld directly, and not with libtool like in
real linking. We might want to fix this, but let's add a handy
way to enable address checking anyway.

10 years agojournald: accept EPOLLERR from /dev/kmsg
Zbigniew Jędrzejewski-Szmek [Thu, 19 Sep 2013 21:57:57 +0000 (16:57 -0500)]
journald: accept EPOLLERR from /dev/kmsg

Also print out unexpected epoll events explictly.

10 years agotest-hashmap: fix access to uninitialized memory
Zbigniew Jędrzejewski-Szmek [Wed, 25 Sep 2013 15:52:43 +0000 (17:52 +0200)]
test-hashmap: fix access to uninitialized memory

10 years agoexecute.c: little modernization
Zbigniew Jędrzejewski-Szmek [Wed, 28 Aug 2013 11:54:43 +0000 (07:54 -0400)]
execute.c: little modernization

10 years agoutil: add macro for iterating through all prefixes of a path
Lennart Poettering [Wed, 25 Sep 2013 18:58:23 +0000 (20:58 +0200)]
util: add macro for iterating through all prefixes of a path

Syntactic sugar in a macro PATH_FOREACH_PREFIX.

10 years agokeymap: Add Samsung Ativ 9 Plus
Jimmie Tauriainen [Wed, 25 Sep 2013 05:30:23 +0000 (07:30 +0200)]
keymap: Add Samsung Ativ 9 Plus

https://launchpad.net/bugs/1229936

10 years agocgroup: if we do a cgroup operation then do something on all supported controllers
Lennart Poettering [Tue, 24 Sep 2013 02:56:05 +0000 (21:56 -0500)]
cgroup: if we do a cgroup operation then do something on all supported controllers

Previously we did operations like attach, trim or migrate only on the
controllers that were enabled for a specific unit. With this changes we
will now do them for all supproted controllers, and fall back to all
possible prefix paths if the specified paths do not exist.

This fixes issues if a controller is being disabled for a unit where it
was previously enabled, and makes sure that all processes stay as "far
down" the tree as groups exist.

10 years agojournalctl(1): s/adm/systemd-journal/
Dave Reisner [Tue, 24 Sep 2013 18:39:40 +0000 (14:39 -0400)]
journalctl(1): s/adm/systemd-journal/

10 years agologind: return -EINVAL when PID is wrong
Lukas Nykryn [Tue, 24 Sep 2013 14:27:20 +0000 (16:27 +0200)]
logind: return -EINVAL when PID is wrong

dbus-send --print-reply --system --dest=org.freedesktop.login1
/org/freedesktop/login1 org.freedesktop.login1.Manager.GetUserByPID
uint32:0
causes
systemd-logind[29843]: Assertion 'pid >= 1' failed at
src/login/logind.c:938, function manager_get_user_by_pid(). Aborting.

10 years agoTODO: add header back
Kay Sievers [Tue, 24 Sep 2013 13:47:42 +0000 (15:47 +0200)]
TODO: add header back

10 years agohwdb: update
Kay Sievers [Tue, 24 Sep 2013 13:47:12 +0000 (15:47 +0200)]
hwdb: update

10 years agosupport acpi firmware performance data (FPDT)
Kay Sievers [Mon, 23 Sep 2013 22:23:35 +0000 (17:23 -0500)]
support acpi firmware performance data (FPDT)

Prefer firmware-provided performance data over loader-exported ones; if
ACPI data is available, always use it, otherwise try to read the loader
data.

The firmware-provided variables start at the time the first EFI image
is executed and end when the operating system exits the boot services;
the (loader) time calculated in systemd-analyze increases.

10 years agoshared: device-nodes - add include guard
Kay Sievers [Mon, 23 Sep 2013 21:53:19 +0000 (16:53 -0500)]
shared: device-nodes - add include guard

10 years agoTODO: update
Kay Sievers [Mon, 23 Sep 2013 21:52:58 +0000 (16:52 -0500)]
TODO: update

10 years agocgroup: always enable memory.use_hierarchy= for all cgroups in the memory hierarchy
Lennart Poettering [Mon, 23 Sep 2013 21:02:31 +0000 (16:02 -0500)]
cgroup: always enable memory.use_hierarchy= for all cgroups in the memory hierarchy

The non-hierarchial mode contradicts the whole idea of a cgroup tree so
let's not support this. In the future the kernel will only support the
hierarchial logic anyway.

10 years agoFix obsolete references to systemd-random-seed-load.service
Eelco Dolstra [Sun, 22 Sep 2013 18:38:24 +0000 (20:38 +0200)]
Fix obsolete references to systemd-random-seed-load.service

This service was merged with systemd-random-seed-save.service in
c35b956d34bbb8bb208e49e45de2c103ca11911c.

10 years agocompletion/systemctl: add missing list-sockets verb
Dave Reisner [Thu, 19 Sep 2013 22:00:36 +0000 (18:00 -0400)]
completion/systemctl: add missing list-sockets verb

10 years agologind: put correct user object paths in introspection data
Mantas Mikulėnas [Fri, 20 Sep 2013 15:14:02 +0000 (18:14 +0300)]
logind: put correct user object paths in introspection data

Sync with user_bus_path() in logind-user-dbus.c

10 years agoman: mention --runtime where appropriate
Zbigniew Jędrzejewski-Szmek [Thu, 19 Sep 2013 23:41:35 +0000 (18:41 -0500)]
man: mention --runtime where appropriate

https://bugzilla.redhat.com/show_bug.cgi?id=1009956

10 years agokeymap: Fix wrong assignments to F23
Martin Pitt [Thu, 19 Sep 2013 21:42:10 +0000 (16:42 -0500)]
keymap: Fix wrong assignments to F23

These days, F21/F22/F23 mean Touchpad toggle/on/off. Clean up other assignments
to that from ancient times which belong to keys like "Auto Brightness" (which
doesn't have a keycode and is usually hardwired) or some "launch vendor tool"
key.

https://bugs.freedesktop.org/show_bug.cgi?id=62953

10 years agosystemctl: Avoid ellipsizing when piping output
Dave Reisner [Thu, 19 Sep 2013 21:12:00 +0000 (17:12 -0400)]
systemctl: Avoid ellipsizing when piping output

10 years agoAdd more tests and fix capability logging
Zbigniew Jędrzejewski-Szmek [Thu, 19 Sep 2013 21:22:59 +0000 (16:22 -0500)]
Add more tests and fix capability logging

10 years agobuild-sys: don't build python modules after --without-python
Zbigniew Jędrzejewski-Szmek [Thu, 19 Sep 2013 18:53:38 +0000 (14:53 -0400)]
build-sys: don't build python modules after --without-python

The modules should build just fine, but AM_PATH_PYTHON sets
pkgpyexecdir for us. Without that variable we don't know where to
install modules. In addition libtool tries an empty rpath, breaking
the build. Those issues could be fixed or worked around, but we
probably don't have many people who want to avoid using python binary,
but want to compile python modules. If such uses ever come up, this
issue should be revisited.

10 years agofix grammatical error
Dave Reisner [Thu, 19 Sep 2013 18:55:35 +0000 (14:55 -0400)]
fix grammatical error

10 years agonspawn: be less liberal about creating bind mount destinations
Dave Reisner [Thu, 19 Sep 2013 18:30:07 +0000 (14:30 -0400)]
nspawn: be less liberal about creating bind mount destinations

Previously, if a file's bind mount destination didn't exist, nspawn
would blindly create a directory, and the subsequent bind mount would
fail. Examine the filetype of the source and ensure that, if the
destination does not exist, that it is created appropriately.

Also go one step further and ensure that the filetypes of the source
and destination match.

10 years agotest-utf8: add more tests for public functions
Dave Reisner [Wed, 18 Sep 2013 16:32:23 +0000 (12:32 -0400)]
test-utf8: add more tests for public functions

10 years agodevice-nodes: move device node specific code to own file
Dave Reisner [Wed, 18 Sep 2013 16:12:04 +0000 (12:12 -0400)]
device-nodes: move device node specific code to own file

In the process, rename udev_encode_string which is poorly named for what
it does. It deals specifically with encoding names that udev creates and
has its own rules: utf8 is valid but some ascii is not (e.g. path
separators), and everything else is simply escaped. Rename it to
encode_devnode_name.

10 years agoshared/utf8: merge implementations, remove cruft
Dave Reisner [Wed, 18 Sep 2013 15:52:14 +0000 (11:52 -0400)]
shared/utf8: merge implementations, remove cruft

This unifies the utf8 handling code which was previously duplicated in
udev and systemd.

10 years agoudev-builtin-blkid: export ID_PART_TABLE_UUID
Dave Reisner [Thu, 19 Sep 2013 15:36:40 +0000 (11:36 -0400)]
udev-builtin-blkid: export ID_PART_TABLE_UUID

10 years agoclarify $ escaping in Exec* lines
Andrey Borzenkov [Thu, 19 Sep 2013 11:52:31 +0000 (15:52 +0400)]
clarify $ escaping in Exec* lines

Explain that literal $ can be passed by doubling it.

10 years agoSpelling fix from later revision of committed patch from Shawn Landden <shawn@churcho...
David Strauss [Wed, 18 Sep 2013 20:46:51 +0000 (15:46 -0500)]
Spelling fix from later revision of committed patch from Shawn Landden <shawn@churchofgit.com>.

10 years agoFix capability logging when effective caps are 0
Zbigniew Jędrzejewski-Szmek [Wed, 18 Sep 2013 16:39:32 +0000 (11:39 -0500)]
Fix capability logging when effective caps are 0

Shawn Landen> Doesn't this also skip the last '0' when it is all '0's?
              You need to keep the last one.

10 years agopolkit: Avoid race condition in scraping /proc
Colin Walters [Thu, 22 Aug 2013 17:55:21 +0000 (13:55 -0400)]
polkit: Avoid race condition in scraping /proc

If a calling process execve()s a setuid program, it can appear to be
uid 0.  Since we're receiving requests over DBus, avoid this by simply
passing system-bus-name as a subject.

10 years agologs-show.c: fix enum type in function declaration
Zbigniew Jędrzejewski-Szmek [Wed, 18 Sep 2013 13:36:27 +0000 (08:36 -0500)]
logs-show.c: fix enum type in function declaration

10 years agoutil: restore get_process_capeff behaviour
Zbigniew Jędrzejewski-Szmek [Tue, 17 Sep 2013 23:34:47 +0000 (18:34 -0500)]
util: restore get_process_capeff behaviour

69ab8088 unified parsing of status files and removed the logic of
skipping extra '0's when getting the effective capabilities. Restore
that logic, so that the same capabilities are always mapped to the
same strings in the journal.

10 years agoRemove six unused variables and add annotation
Zbigniew Jędrzejewski-Szmek [Tue, 17 Sep 2013 22:30:47 +0000 (17:30 -0500)]
Remove six unused variables and add annotation

clang FTW!

10 years agologind: fix build for ARM with sizeof(dev_t) > sizeof(void*)
David Herrmann [Tue, 17 Sep 2013 23:00:02 +0000 (01:00 +0200)]
logind: fix build for ARM with sizeof(dev_t) > sizeof(void*)

Unfortunately on ARM-32 systems dev_t can be 64bit and thus we cannot
store it easily in void* keys for hashtables. Fix that by passing a
pointer to the dev_t variable instead.

10 years agogpt-auto-generator: do not assume that /dev/block/%u:%u is useable
Lennart Poettering [Tue, 17 Sep 2013 23:04:40 +0000 (18:04 -0500)]
gpt-auto-generator: do not assume that /dev/block/%u:%u is useable

The generator might run before udev, and udev sets up the /dev/block/
symlinks, hence we cannot use them from the gpt generator. Instead,
manually translate a major/minor to a device node.

10 years agobacklight,random-seed: move state files into /var/lib/systemd
Lennart Poettering [Tue, 17 Sep 2013 22:28:35 +0000 (17:28 -0500)]
backlight,random-seed: move state files into /var/lib/systemd

Let's not scatter (private) files in /var around, let's place them all
in /var/lib/systemd and below.

10 years agologind: implement generic multi-session
David Herrmann [Tue, 17 Sep 2013 21:40:19 +0000 (23:40 +0200)]
logind: implement generic multi-session

This enables the multi-session capability for seats that don't have VTs.
For legacy seats with VTs, everything stays the same. However, all other
seats now also get the multi-session capability.

The only feature that was missing was session-switching. As logind can
force a session-switch and signal that via the "Active" property, we only
need a way to allow synchronized/delayed session switches. Compositors
need to cleanup some devices before acknowledging the session switch.
Therefore, we use the session-devices to give compositors a chance to
block a session-switch until they cleaned everything up.

If you activate a session on a seat without VTs, we send a PauseDevice
signal to the active session for every active device. Only once the
session acknowledged all these with a PauseDeviceComplete() call, we
perform the final session switch.

One important note is that delayed session-switching is meant for
backwards compatibility. New compositors or other sessions should really
try to deal correctly with forced session switches! They only need to
handle EACCES/EPERM from syscalls and treat them as "PauseDevice" signal.

Following logind patches will add a timeout to session-switches which
forces the switch if the active session does not react in a timely
fashion. Moreover, explicit ForceActivate() calls might also be supported.
Hence, sessions must not crash if their devices get paused.

10 years agologind: introduce session-devices
David Herrmann [Tue, 17 Sep 2013 21:39:04 +0000 (23:39 +0200)]
logind: introduce session-devices

A session-device is a device that is bound to a seat and used by a
session-controller to run the session. This currently includes DRM, fbdev
and evdev devices. A session-device can be created via RequestDevice() on
the dbus API of the session. You can drop it via ReleaseDevice() again.
Once the session is destroyed or you drop control of the session, all
session-devices are automatically destroyed.

Session devices follow the session "active" state. A device can be
active/running or inactive/paused. Whenever a session is not the active
session, no session-device of it can be active. That is, if a session is
not in foreground, all session-devices are paused.
Whenever a session becomes active, all devices are resumed/activated by
logind. If it fails, a device may stay paused.

With every session-device you request, you also get a file-descriptor
back. logind keeps a copy of this fd and uses kernel specific calls to
pause/resume the file-descriptors. For example, a DRM fd is muted
by logind as long as a given session is not active. Hence, the fd of the
application is also muted. Once the session gets active, logind unmutes
the fd and the application will get DRM access again.
This, however, requires kernel support. DRM devices provide DRM-Master for
synchronization, evdev devices have EVIOCREVOKE (pending on
linux-input-ML). fbdev devices do not provide such synchronization methods
(and never will).
Note that for evdev devices, we call EVIOCREVOKE once a session gets
inactive. However, this cannot be undone (the fd is still valid but mostly
unusable). So we reopen a new fd once the session is activated and send it
together with the ResumeDevice() signal.

With this infrastructure in place, compositors can now run without
CAP_SYS_ADMIN (that is, without being root). They use RequestControl() to
acquire a session and listen for devices via udev_monitor. For every
device they want to open, they call RequestDevice() on logind. This
returns a fd which they can use now. They no longer have to open the
devices themselves or call any privileged ioctls. This is all done by
logind.
Session-switches are still bound to VTs. Hence, compositors will get
notified via the usual VT mechanisms and can cleanup their state. Once the
VT switch is acknowledged as usual, logind will get notified via sysfs and
pause the old-session's devices and resume the devices of the new session.

To allow using this infrastructure with systems without VTs, we provide
notification signals. logind sends PauseDevice("force") dbus signals to
the current session controller for every device that it pauses. And it
sends ResumeDevice signals for every device that it resumes. For
seats with VTs this is sent _after_ the VT switch is acknowledged. Because
the compositor already acknowledged that it cleaned-up all devices.
However, for seats without VTs, this is used to notify the active
compositor that the session is about to be deactivated. That is, logind
sends PauseDevice("force") for each active device and then performs the
session-switch. The session-switch changes the "Active" property of the
session which can be monitored by the compositor. The new session is
activated and the ResumeDevice events are sent.

For seats without VTs, this is a forced session-switch. As this is not
backwards-compatible (xserver actually crashes, weston drops the related
devices, ..) we also provide an acknowledged session-switch. Note that
this is never used for sessions with VTs. You use the acknowledged
VT-switch on these seats.

An acknowledged session switch sends PauseDevice("pause") instead of
PauseDevice("force") to the active session. It schedules a short timeout
and waits for the session to acknowledge each of them with
PauseDeviceComplete(). Once all are acknowledged, or the session ran out
of time, a PauseDevice("force") is sent for all remaining active devices
and the session switch is performed.
Note that this is only partially implemented, yet, as we don't allow
multi-session without VTs, yet. A follow up commit will hook it up and
implemented the acknowledgements+timeout.

The implementation is quite simple. We use major/minor exclusively to
identify devices on the bus. On RequestDevice() we retrieve the
udev_device from the major/minor and search for an existing "Device"
object. If no exists, we create it. This guarantees us that we are
notified whenever the device changes seats or is removed.

We create a new SessionDevice object and link it to the related Session
and Device. Session->devices is a hashtable to lookup SessionDevice
objects via major/minor. Device->session_devices is a linked list so we
can release all linked session-devices once a device vanishes.

Now we only have to hook this up in seat_set_active() so we correctly
change device states during session-switches. As mentioned earlier, these
are forced state-changes as VTs are currently used exclusively for
multi-session implementations.

Everything else are hooks to release all session-devices once the
controller changes or a session is closed or removed.

10 years agoUpdate TODO
Lennart Poettering [Tue, 17 Sep 2013 22:11:46 +0000 (17:11 -0500)]
Update TODO

10 years agolibudev: add missing 'global' to symbol export
Kay Sievers [Tue, 17 Sep 2013 21:37:42 +0000 (16:37 -0500)]
libudev: add missing 'global' to symbol export

10 years agojournald: avoid NSS in journald
Lennart Poettering [Tue, 17 Sep 2013 21:42:36 +0000 (16:42 -0500)]
journald: avoid NSS in journald

In order to avoid a deadlock between journald looking up the
"systemd-journal" group name, and nscd (or anyother NSS backing daemon)
logging something back to the journal avoid all NSS in journald the same
way as we avoid it from PID 1.

With this change we rely on the kernel file system logic to adjust the
group of created journal files via the SETGID bit on the journal
directory. To ensure that it is always set, even after the user created
it with a simply "mkdir" on the shell we fix it up via tmpfiles on boot.

10 years agotmpfiles: add a new "m" line type that adjusts user/group/mode of a file if it exists
Lennart Poettering [Tue, 17 Sep 2013 21:33:30 +0000 (16:33 -0500)]
tmpfiles: add a new "m" line type that adjusts user/group/mode of a file if it exists

10 years agotest-fileio: assume that Buffers may be missing
Zbigniew Jędrzejewski-Szmek [Tue, 17 Sep 2013 20:50:49 +0000 (15:50 -0500)]
test-fileio: assume that Buffers may be missing

10 years agoMake test-login and test-sleep output debugging
Zbigniew Jędrzejewski-Szmek [Tue, 17 Sep 2013 20:13:18 +0000 (15:13 -0500)]
Make test-login and test-sleep output debugging

Without a call to log_parse_environment(), things
like SYSTEMD_LOG_LEVEL do not work.

10 years agoUse first partition in /proc/swaps for hibernation test
Zbigniew Jędrzejewski-Szmek [Tue, 17 Sep 2013 20:12:16 +0000 (15:12 -0500)]
Use first partition in /proc/swaps for hibernation test

It seems that the kernel uses the first configured partition
for hibernation. If it is too full, hibernation will fail. Test
that directly.

10 years agoUse udev_encode_string in fstab_node_to_udev_node
Dave Reisner [Tue, 17 Sep 2013 19:47:08 +0000 (15:47 -0400)]
Use udev_encode_string in fstab_node_to_udev_node

Resolves a longstanding bug which caused this function to wrongly
handle (escape) valid utf8 characters.

10 years agomove utf8 functions from libudev-private.h to utf8.h
Dave Reisner [Tue, 17 Sep 2013 19:39:09 +0000 (15:39 -0400)]
move utf8 functions from libudev-private.h to utf8.h

There's now some more obvious overlap amongst the two utf8 validation
functions, but no more than there already was previously.

This also adds some menial tests for anyone who wants to do more
merging of these two in the future.

10 years agoUpdate TODO
Lennart Poettering [Tue, 17 Sep 2013 20:28:22 +0000 (15:28 -0500)]
Update TODO

10 years agojournald: log the slice of a process along with each message in _SYSTEMD_SLICE=
Lennart Poettering [Tue, 17 Sep 2013 20:21:00 +0000 (15:21 -0500)]
journald: log the slice of a process along with each message in _SYSTEMD_SLICE=

10 years agoTEST-03-JOBS/test.sh: do not output the "failed" if it does not exist
Harald Hoyer [Mon, 16 Sep 2013 23:07:43 +0000 (18:07 -0500)]
TEST-03-JOBS/test.sh: do not output the "failed" if it does not exist

10 years agoTEST-01-BASIC, TEST-02-CRYPTSETUP: fixed strip
Harald Hoyer [Mon, 16 Sep 2013 23:06:57 +0000 (18:06 -0500)]
TEST-01-BASIC, TEST-02-CRYPTSETUP: fixed strip

also output more status about failed jobs

10 years agocgroup: get rid of MemorySoftLimit=
Lennart Poettering [Tue, 17 Sep 2013 19:58:00 +0000 (14:58 -0500)]
cgroup: get rid of MemorySoftLimit=

The cgroup attribute memory.soft_limit_in_bytes is unlikely to stay
around in the kernel for good, so let's not expose it for now. We can
readd something like it later when the kernel guys decided on a final
API for this.

10 years agoNEWS: add some clarifications
Lennart Poettering [Tue, 17 Sep 2013 18:57:04 +0000 (13:57 -0500)]
NEWS: add some clarifications

As suggested by Colin Guthrie on the ML.

10 years agoudev: path_id - fix by-path link generation for scm devices
Sebastian Ott [Tue, 17 Sep 2013 17:16:08 +0000 (19:16 +0200)]
udev: path_id - fix by-path link generation for scm devices

Set some_transport = true to prevent scm devices from being ignored.

Suggested-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
10 years agologind: extract has_vts() from can_multi_session()
David Herrmann [Tue, 17 Sep 2013 15:40:02 +0000 (17:40 +0200)]
logind: extract has_vts() from can_multi_session()

We currently use seat_can_multi_session() to test for two things:
 * whether the seat can handle session-switching
 * whether the seat has VTs

As both are currently logically equivalent, we didn't care. However, we
want to allow session-switching on seats without VTs, so split this helper
into:
 * seat_can_multi_session(): whether session-switching is supported
 * seat_has_vts(): whether the seat has VTs

Note that only one seat on a system can have VTs. There is only one set of
them. We automatically assign them to seat0 as usual.

With this patch in place, we can easily add new session-switching/tracking
methods without breaking any VT code as it is now protected by has_vts(),
no longer by can_multi_session().

10 years agologind: fix session_activate(vtnr = 0)
David Herrmann [Tue, 17 Sep 2013 15:40:01 +0000 (17:40 +0200)]
logind: fix session_activate(vtnr = 0)

VT numbers start with 1. If a session has vtnr == 0, we must not assume it
is running on a VT.
Note that this could trigger the assert() below as CreateSession() sets
vtnr to 0, not <0.

10 years agologind: fix seat_can_tty() to check for VTs
David Herrmann [Tue, 17 Sep 2013 15:40:00 +0000 (17:40 +0200)]
logind: fix seat_can_tty() to check for VTs

A seat provides text-logins if it has VTs. This is always limited to seat0
so the seat_is_seat0() check is correct. However, if VTs are disabled, no
seat provides text-logins so we also need to check for the console-fd.

This was previously:
  return seat_is_vtconsole();
It looked right, but was functionally equivalent to seat_is_seat0(). The
rename of this helper made it more obvious that it is missing the VT test.

10 years agologind: rename vtconsole to seat0
David Herrmann [Tue, 17 Sep 2013 15:39:59 +0000 (17:39 +0200)]
logind: rename vtconsole to seat0

The seat->vtconsole member always points to the default seat seat0. Even
if VTs are disabled, it's used as default seat. Therefore, rename it to
seat0 to correctly state what it is.

This also changes the seat files in /run from IS_VTCONSOLE to IS_SEAT0. It
wasn't used by any code, yet, so this seems fine.

While we are at it, we also remove every "if (s->vtconsole)" as this
pointer is always valid!

10 years agonspawn: update unit file
Lennart Poettering [Tue, 17 Sep 2013 16:59:47 +0000 (11:59 -0500)]
nspawn: update unit file

ControlGroup= is obsolete, so let's drop it from the default nspawn unit
file.

10 years agoupdate TODO
Lennart Poettering [Tue, 17 Sep 2013 16:59:41 +0000 (11:59 -0500)]
update TODO

10 years agologind: make Session.Activate() lazy
David Herrmann [Tue, 17 Sep 2013 15:39:57 +0000 (17:39 +0200)]
logind: make Session.Activate() lazy

Currently, Activate() calls chvt(), which does an ioctl(VT_ACTIVATE) and
immediately calls seat_set_active(). However, VTs are allowed to prevent
being deactivated. Therefore, logind cannot be sure the VT_ACTIVATE call
was actually successful.

Furthermore, compositors often need to clean up their devices before they
acknowledge the VT switch. The immediate call to seat_set_active() may
modify underlying ACLs, though. Thus, some compositors may fail cleaning
up their stuff. Moreover, the compositor being switched to (if listening
to logind instead of VTs) will not be able to activate its devices if the
old VT still has them active.

We could simply add an VT_WAITACTIVE call, which blocks until the given VT
is active. However, this can block forever if the compositor hangs.

So to fix this, we make Activate() lazy. That is, it only schedules a
session-switch but does not wait for it to complete. The caller can no
longer rely on it being immediate. Instead, a caller is required to wait
for the PropertiesChanged signal and read the "Active" field.

We could make Activate() wait asynchronously for the session-switch to
complete and then send the return-message afterwards. However, this would
add a lot of state-tracking with no real gain:
 1) Sessions normally don't care whether Activate() was actually
    successful as they currently _must_ wait for the VT activation to do
    anything for real.
 2) Error messages for failed session switches can be printed by logind
    instead of the session issuing Activate().
 3) Sessions that require synchronous Activate() calls can simply issue
    the call and then wait for "Active" properties to change. This also
    allows them to implement their own timeout.

This change prepares for multi-session on seats without VTs. Forced VT
switches are always bad as compositors cannot perform any cleanup. This
isn't strictly required, but may lead to loss of information and ambiguous
error messages.
So for multi-session on seats without VTs, we must wait for the current
session to clean-up before finalizing the session-switch. This requires
Activate() to be lazy as we cannot block here.

Note that we can always implement a timeout which allows us to guarantee
the session switch to happen. Nevertheless, this calls for a lazy
Activate().

10 years agologind: add session controllers
David Herrmann [Tue, 17 Sep 2013 15:39:56 +0000 (17:39 +0200)]
logind: add session controllers

A session usually has only a single compositor or other application that
controls graphics and input devices on it. To avoid multiple applications
from hijacking each other's devices or even using the devices in parallel,
we add session controllers.

A session controller is an application that manages a session. Specific
API calls may be limited to controllers to avoid others from getting
unprivileged access to restricted resources. A session becomes a
controller by calling the RequestControl() dbus API call. It can drop it
via ReleaseControl().

logind tracks bus-names to release the controller once an application
closes the bus. We use the new bus-name tracking to do that. Note that
during ReleaseControl() we need to check whether some other session also
tracks the name before we remove it from the bus-name tracking list.

Currently, we only allow one controller at a time. However, the public API
does not enforce this restriction. So if it makes sense, we can allow
multiple controllers in parallel later. Or we can add a "scope" parameter,
which allows a different controller for graphics-devices, sound-devices
and whatever you want.
Note that currently you get -EBUSY if there is already a controller. You
can force the RequestControl() call (root-only) to drop the current
controller and recover the session during an emergency. To recover a seat,
this is not needed, though. You can simply create a new session or
force-activate it.

To become a session controller, a dbus caller must either be root or the
same user as the user of the session. This allows us to run a session
compositor as user and we no longer need any CAP_SYS_ADMIN.

10 years agologind: add infrastructure to watch busnames
David Herrmann [Tue, 17 Sep 2013 15:39:55 +0000 (17:39 +0200)]
logind: add infrastructure to watch busnames

If we want to track bus-names to allow exclusive resource-access, we need
a way to get notified when a bus-name is gone. We make logind watch for
NameOwnerChanged dbus events and check whether the name is currently
watched. If it is, we remove it from the watch-list (notification for
other objects can be added in follow-up patches).

10 years agologind: listen actively for session devices
David Herrmann [Tue, 17 Sep 2013 15:39:54 +0000 (17:39 +0200)]
logind: listen actively for session devices

Session compositors need access to fbdev, DRM and evdev devices if they
control a session. To make logind pass them to sessions, we need to
listen for them actively.

However, we avoid creating new seats for non master-of-seat devices. Only
once a seat is created, we start remembering all other session devices. If
the last master-device is removed (even if there are other non-master
devices still available), we destroy the seat. This is the current
behavior, but we need to explicitly implement it now as there may be
non-master devices in the seat->devices list.

Unlike master devices, we don't care whether our list of non-master
devices is complete. We don't export this list but use it only as cache if
sessions request these devices. Hence, if a session requests a device that
is not in the list, we will simply look it up. However, once a session
requested a device, we must be notified of "remove" udev events. So we
must link the devices somehow into the device-list.

Regarding the implementation, we now sort the device list by the "master"
flag. This guarantees that master devices are at the front and non-master
devices at the tail of the list. Thus, we can easily test whether a seat
has a master device attached.

10 years agotmpfiles: support simple specifier expansion for specified paths
Lennart Poettering [Tue, 17 Sep 2013 16:02:02 +0000 (11:02 -0500)]
tmpfiles: support simple specifier expansion for specified paths

10 years agoMake tmpdir removal asynchronous
Zbigniew Jędrzejewski-Szmek [Mon, 16 Sep 2013 20:50:38 +0000 (15:50 -0500)]
Make tmpdir removal asynchronous

https://bugs.freedesktop.org/show_bug.cgi?id=68232

10 years agoman: add a list of environment variables
Zbigniew Jędrzejewski-Szmek [Sun, 15 Sep 2013 15:56:19 +0000 (11:56 -0400)]
man: add a list of environment variables

10 years agospecifier: rework specifier calls to return proper error message
Lennart Poettering [Tue, 17 Sep 2013 15:03:46 +0000 (10:03 -0500)]
specifier: rework specifier calls to return proper error message

Previously the specifier calls could only indicate OOM by returning
NULL. With this change they will return negative errno-style error codes
like everything else.

10 years agoupdate TODO
Lennart Poettering [Tue, 17 Sep 2013 15:01:08 +0000 (10:01 -0500)]
update TODO

10 years agoAdd YouCompleteMe configuration
Dave Reisner [Mon, 16 Sep 2013 23:09:36 +0000 (19:09 -0400)]
Add YouCompleteMe configuration