chiark / gitweb /
8 years agosystemctl: do not show SourcePath when FragmentPath cannot be found
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 03:29:33 +0000 (22:29 -0500)]
systemctl: do not show SourcePath when FragmentPath cannot be found

Those files can be in a completely deferent format and also
arbitrarily long, and usually contain information about other
stuff. If we ever add SourceLine= or SourceLines= in addition
to SourcePath=, and can show the relevant information only, this
commit can be reverted.

8 years agosystemctl: add "systemctl cat"
Shawn Landden [Sun, 1 Dec 2013 00:09:26 +0000 (16:09 -0800)]
systemctl: add "systemctl cat"

8 years agosystemctl: refactor show()
Shawn Landden [Sun, 24 Nov 2013 03:52:52 +0000 (19:52 -0800)]
systemctl: refactor show()

v2, don't leave in unused function

8 years agoman: explicitly say when multiple units can be specified
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 02:23:01 +0000 (21:23 -0500)]
man: explicitly say when multiple units can be specified

itistoday> how do you specify multiple dependencies in a unit file? i've been
           googling and can't find this basic thing :-\
itistoday> do you use a comma, or use multiple After= statements?

8 years agodocs: remove unneeded the's in gudev docs
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 01:27:54 +0000 (20:27 -0500)]
docs: remove unneeded the's in gudev docs

8 years agobus: remove unused variable
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 01:10:18 +0000 (20:10 -0500)]
bus: remove unused variable

8 years agobus: remove unused variable
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 23:26:08 +0000 (00:26 +0100)]
bus: remove unused variable

8 years agoutil.c: check if return value from ttyname_r is > 0 instead of != 0
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 22:45:31 +0000 (23:45 +0100)]
util.c: check if return value from ttyname_r is > 0 instead of != 0

We must return a negative error code from getttyname_malloc but
that would not be the case if ttyname_r returned a negative value.

ttyname_r should only return EBADF, ENOTTY, or ERANGE so it should
be safe to change.

8 years agosysfs-show.c: return negative error
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 20:59:40 +0000 (21:59 +0100)]
sysfs-show.c: return negative error

introduced in 1ca208fb4f93e5869704af1812cbff7130a2fc03

8 years agomacro.h: fix typo in comment
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 20:55:35 +0000 (21:55 +0100)]
macro.h: fix typo in comment

8 years agobus: catch up with kdbus
Kay Sievers [Sat, 30 Nov 2013 19:41:02 +0000 (20:41 +0100)]
bus: catch up with kdbus

8 years agobus: do kdbus only if this is enabled on the configure switch
Lennart Poettering [Sat, 30 Nov 2013 19:18:48 +0000 (20:18 +0100)]
bus: do kdbus only if this is enabled on the configure switch

Since we want to retain the ability to break kernel ←→ userspace ABI
after the next release, let's not make use by default of kdbus, so that
people with future kernels will not suddenly break with current systemd

kdbus support is left in all builds but must now be explicitly requested
at runtime (for example via setting $DBUS_SESSION_BUS). Via a configure
switch the old behaviour can be restored. In fact, we change
to do this, so that git builds (which run get kdbus by
default, but tarball builds (which ue the configure defaults) do not get
it, and hence this stays out of the distros by default.

8 years agoupdate TODO
Lennart Poettering [Sat, 30 Nov 2013 18:55:23 +0000 (19:55 +0100)]
update TODO

8 years agobus: use "System.Error." as prefix for implicit errno bus errors
Lennart Poettering [Sat, 30 Nov 2013 18:53:33 +0000 (19:53 +0100)]
bus: use "System.Error." as prefix for implicit errno bus errors

We probably shouldn't use "Posix.Error" since many of the errors have
nothing to do with Posix.

8 years agobus: support temporarily const errors that don't need to be freed but require deep...
Lennart Poettering [Sat, 30 Nov 2013 18:45:32 +0000 (19:45 +0100)]
bus: support temporarily const errors that don't need to be freed but require deep copies

This should fix issues with incorrectly copying bus error messages out
of sd_bus_message objects.

Original bug found by: Djalal Harouni

8 years agolibsystemd-bus: sync kdbus.h
Daniel Mack [Sat, 30 Nov 2013 18:23:16 +0000 (19:23 +0100)]
libsystemd-bus: sync kdbus.h

8 years agonspawn: set up a kdbus namespace when starting a container
Lennart Poettering [Sat, 30 Nov 2013 15:36:46 +0000 (16:36 +0100)]
nspawn: set up a kdbus namespace when starting a container

8 years agobus: append unique and well known names to all messages unconditionally
Lennart Poettering [Sat, 30 Nov 2013 15:08:11 +0000 (16:08 +0100)]
bus: append unique and well known names to all messages unconditionally

8 years agobus: include unique and well known names in credentials object
Lennart Poettering [Sat, 30 Nov 2013 03:14:10 +0000 (04:14 +0100)]
bus: include unique and well known names in credentials object

8 years agobus: update kdbus.h
Kay Sievers [Sat, 30 Nov 2013 13:14:39 +0000 (14:14 +0100)]
bus: update kdbus.h

8 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Sat, 30 Nov 2013 12:31:04 +0000 (13:31 +0100)]
libsystemd-bus: catch up with latest kdbus changes

The name list and query functions now work differently in kdbus, as the
result is stored in the connection's pool, rather than being copied back
through the ioctl buffer. That also safes us some logic, as we don't
have to resize the communication buffer in a loop with growing buffer

Due to this, KDBUS_CMD_MSG_RELEASE was renamed to KDBUS_CMD_FREE, as it
is now used outside the message logic as well.

8 years agobus-proxyd: Fix CLI help. --bus-path is also usable as -p.
David Strauss [Sat, 30 Nov 2013 06:55:30 +0000 (16:55 +1000)]
bus-proxyd: Fix CLI help. --bus-path is also usable as -p.

8 years agocore: allocate a kdbus bus for each systemd instance, if we can
Lennart Poettering [Sat, 30 Nov 2013 02:53:42 +0000 (03:53 +0100)]
core: allocate a kdbus bus for each systemd instance, if we can

8 years agobus: whenever we notice the connection is terminated enter CLOSING state
Lennart Poettering [Sat, 30 Nov 2013 00:49:40 +0000 (01:49 +0100)]
bus: whenever we notice the connection is terminated enter CLOSING state

8 years agobus: synthesize local error reply when we cannot deliver a message to kdbus because...
Lennart Poettering [Sat, 30 Nov 2013 00:02:51 +0000 (01:02 +0100)]
bus: synthesize local error reply when we cannot deliver a message to kdbus because the destination is unavailable

8 years agobus: don't generate NameAcquired/NameLost messages in the library
Lennart Poettering [Fri, 29 Nov 2013 23:19:01 +0000 (00:19 +0100)]
bus: don't generate NameAcquired/NameLost messages in the library

The signals appear entirely redundant due to NameOwnerChange, hence
don't do them in the new library, instead leave them for the
compatibility bridge only.

Also, set the serial number for synthesized messages to (uint32_t) -1.

8 years agobuild-sys: no longer rebuild various bits and pieces such as man pages each time...
Lennart Poettering [Fri, 29 Nov 2013 23:16:49 +0000 (00:16 +0100)]
build-sys: no longer rebuild various bits and pieces such as man pages each time the Makefile changes

We don't do this for .c files either, even they are also influence quite
a bit by makefile settings. Given that XSLT is a lot slower then the
rest of the build let's make our build a bit faster if people end up
touching the Makefile.

8 years agobus: revert attempts to make the integration-testing work
Kay Sievers [Fri, 29 Nov 2013 22:55:09 +0000 (23:55 +0100)]
bus: revert attempts to make the integration-testing work


8 years agorename stdio-bridge to bus-proxyd
Kay Sievers [Fri, 29 Nov 2013 20:54:44 +0000 (21:54 +0100)]
rename stdio-bridge to bus-proxyd

8 years agobus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange
Lennart Poettering [Fri, 29 Nov 2013 21:02:43 +0000 (22:02 +0100)]
bus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange

8 years agobus: fix callback index when dispatching kernel messages
Lennart Poettering [Fri, 29 Nov 2013 21:02:14 +0000 (22:02 +0100)]
bus: fix callback index when dispatching kernel messages

8 years agobus: add the ability for backends to queue to input messages at the same time
Lennart Poettering [Fri, 29 Nov 2013 20:29:16 +0000 (21:29 +0100)]
bus: add the ability for backends to queue to input messages at the same time

We need this so that one incoming kernel message can result in two
high-level bus messages, for the case where we synthesize NameAcquired
and NameOwnerChanged in the same instance.

8 years agolibsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags()
Daniel Mack [Fri, 29 Nov 2013 20:58:39 +0000 (21:58 +0100)]
libsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags()

8 years agolibsystemd-bus: rename sd_bus_kernel_translate_request_name_flags
Daniel Mack [Fri, 29 Nov 2013 20:14:07 +0000 (21:14 +0100)]
libsystemd-bus: rename sd_bus_kernel_translate_request_name_flags

... to keep the namespace clean.

8 years agolibsystemd-bus: add kdbus support for sd_bus_get_owner()
Daniel Mack [Fri, 29 Nov 2013 19:44:10 +0000 (20:44 +0100)]
libsystemd-bus: add kdbus support for sd_bus_get_owner()

8 years agolibsystemd-bus: add sd_bus_translate_attach_flags()
Daniel Mack [Fri, 29 Nov 2013 16:21:39 +0000 (17:21 +0100)]
libsystemd-bus: add sd_bus_translate_attach_flags()

Factor out code from sd_bus_negotiate_attach_creds() to a generic
translate function, so it can be used from other places.

8 years agolibsystemd-bus: factor out DBus bits out of sd_bus_get_owner()
Daniel Mack [Fri, 29 Nov 2013 15:52:06 +0000 (16:52 +0100)]
libsystemd-bus: factor out DBus bits out of sd_bus_get_owner()

Just a preparation for upcoming kdbus support.

8 years agobus: do not fail if "comm" information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 20:34:14 +0000 (21:34 +0100)]
bus: do not fail if "comm" information cannot be retrieved from /proc

8 years agobus: fix size calculation for match data
Kay Sievers [Fri, 29 Nov 2013 20:03:54 +0000 (21:03 +0100)]
bus: fix size calculation for match data

8 years agobus: when synthesizing messages locally, fill in a sender
Lennart Poettering [Fri, 29 Nov 2013 19:10:08 +0000 (20:10 +0100)]
bus: when synthesizing messages locally, fill in a sender

8 years agobusctl: fix --help line breaks
Lennart Poettering [Fri, 29 Nov 2013 19:08:54 +0000 (20:08 +0100)]
busctl: fix --help line breaks

8 years agokdbus: synthesize NameOwnerChange signals from kernel messages and support matches...
Lennart Poettering [Fri, 29 Nov 2013 19:07:56 +0000 (20:07 +0100)]
kdbus: synthesize NameOwnerChange signals from kernel messages and support matches against NameOwnerChange

8 years agokdbus: add base enums for items
Lennart Poettering [Fri, 29 Nov 2013 19:09:41 +0000 (20:09 +0100)]
kdbus: add base enums for items

8 years agobus: do not fail if task information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 18:46:59 +0000 (19:46 +0100)]
bus: do not fail if task information cannot be retrieved from /proc

8 years agolibsystemd-bus: clean up bus-control.c file
Lukasz Skalski [Fri, 29 Nov 2013 16:57:00 +0000 (17:57 +0100)]
libsystemd-bus: clean up bus-control.c file

8 years agobus: do not fail if cgroup information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 17:57:06 +0000 (18:57 +0100)]
bus: do not fail if cgroup information cannot be retrieved from /proc

8 years agolibsystemd-bus: catch up with latest kdbus changes
Kay Sievers [Fri, 29 Nov 2013 17:37:39 +0000 (18:37 +0100)]
libsystemd-bus: catch up with latest kdbus changes

8 years agolibsystemd-bus: follow kdbus renames
Daniel Mack [Fri, 29 Nov 2013 17:10:36 +0000 (18:10 +0100)]
libsystemd-bus: follow kdbus renames

kdbus now has more generic names for the items it passes around. That
allows for usage from other contexts.

8 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Fri, 29 Nov 2013 15:26:47 +0000 (07:26 -0800)]
hwdb: Update database of Bluetooth company identifiers

8 years agolibsystemd-bus: copy over kdbus provided 128-bit bus id
Daniel Mack [Fri, 29 Nov 2013 15:24:40 +0000 (16:24 +0100)]
libsystemd-bus: copy over kdbus provided 128-bit bus id

kdbus now copies the bus unique id back to userspace in the hello
ioctl(). Use these bytes to set the server id of the sd_bus.

8 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Fri, 29 Nov 2013 14:36:37 +0000 (15:36 +0100)]
libsystemd-bus: catch up with latest kdbus changes

kdbus_cmd_hello now has a new uint64_t flags field for the requested
attachments. Follow that change in libsystemd-bus.

8 years agosystemd-stdio-bridge: make it socket-activatable and usable as kdbus bridge
Daniel Mack [Fri, 15 Nov 2013 17:05:27 +0000 (18:05 +0100)]
systemd-stdio-bridge: make it socket-activatable and usable as kdbus bridge

Augment systemd-stdio-bridge a bit to make it a 1:1 bridge from legacy
DBus clients to kdbus. In particular,

 * allow setting the bus path of the upstream bus as command line
 * use sd_listen_fds() for systemd's socket activation
 * omit calling sd_bus_negotiate_fds() when upstream bus is kdbus
 * reply to bus send errors with proper dbus error messages
 * treat -ECONNRESET as expected end-of-connection condition

8 years agolibsystemd-bus: sd_bus_request_name: fix return value for kdbus
Daniel Mack [Tue, 26 Nov 2013 16:24:18 +0000 (17:24 +0100)]
libsystemd-bus: sd_bus_request_name: fix return value for kdbus

kdbus returns -EALREADY if the requesting connection is already the
owner of a name, and -EEXIST if the name already exists and the
connection is not able to take it over.

Also, n->flags needs a translation as well to match the SD_BUS_* enum

8 years agolibsystemd-bus: kernel: add sd_bus_kernel_translate_request_name_flags
Daniel Mack [Tue, 26 Nov 2013 15:45:50 +0000 (16:45 +0100)]
libsystemd-bus: kernel: add sd_bus_kernel_translate_request_name_flags

Flags used to request a name from kdbus are not identical to what DBus
and sd_bus use internally. Introduce a simple function to do the
translation for us. It's factored out to a separate function so the
dbus-driver instance can make use of it as well.

8 years agolibsystemd-bus: make sd_bus_list_names return all connections, including unique names
Daniel Mack [Tue, 19 Nov 2013 15:33:05 +0000 (16:33 +0100)]
libsystemd-bus: make sd_bus_list_names return all connections, including unique names

8 years agolibsystemd-bus: add kdbus support for sd_bus_list_names()
Daniel Mack [Fri, 15 Nov 2013 15:04:32 +0000 (16:04 +0100)]
libsystemd-bus: add kdbus support for sd_bus_list_names()

kdbus will tell us the minimum buffer size it needs in case the default
8kb buffer doesn't suffice.

8 years agolibsystemd-bus: bring definitions in sync with kdbus
Daniel Mack [Fri, 15 Nov 2013 14:55:27 +0000 (15:55 +0100)]
libsystemd-bus: bring definitions in sync with kdbus

In particular, KDBUS_ITEM_NEXT is now called KDBUS_PART_NEXT, and
KDBUS_ITEM_FOREACH was renamed to KDBUS_PART_FOREACH and takes one more
argument to make it more flexible.

8 years agobus: when turning a buffer into a sd_bus_message avoid creating zero-length parts
Lennart Poettering [Fri, 29 Nov 2013 12:34:16 +0000 (13:34 +0100)]
bus: when turning a buffer into a sd_bus_message avoid creating zero-length parts

8 years agoRevert "build-sys: avoid warnings from assert_cc"
Lennart Poettering [Fri, 29 Nov 2013 01:09:58 +0000 (02:09 +0100)]
Revert "build-sys: avoid warnings from assert_cc"

This reverts commit f1a1264d13b31b9f5521f482d9a5a9d78da55efb.

We can turn this off with a pragma only on old gcc. Newer gcc doesn't
need this, so let's not turn this off for everybody.

8 years agobus: creds - ignore EINVAL when acessing the (inactive) LSM /proc interface
Kay Sievers [Fri, 29 Nov 2013 10:52:22 +0000 (11:52 +0100)]
bus: creds - ignore EINVAL when acessing the (inactive) LSM /proc interface

8 years agobus: Add KDBUS_MSG_SRC_NAMES to bus_kernel_make_message() function
Lukasz Skalski [Fri, 29 Nov 2013 10:37:10 +0000 (11:37 +0100)]
bus: Add KDBUS_MSG_SRC_NAMES to bus_kernel_make_message() function

8 years agobusctl: drop bus driver name from list of services
Lennart Poettering [Thu, 28 Nov 2013 19:43:25 +0000 (20:43 +0100)]
busctl: drop bus driver name from list of services

8 years agobus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one call
Lennart Poettering [Thu, 28 Nov 2013 19:41:55 +0000 (20:41 +0100)]
bus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one call

Since the backing ioctl for this on kdbus is the same we retain
atomicity this way.

8 years agoRemove some unused variables
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 19:20:07 +0000 (14:20 -0500)]
Remove some unused variables

8 years agobuild-sys: use C99
Zbigniew Jędrzejewski-Szmek [Wed, 20 Nov 2013 20:43:50 +0000 (15:43 -0500)]
build-sys: use C99

We already use various constructs, so let's just admit that we're using C99.

8 years agovirt: split detect_vm into separate functions
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 18:34:08 +0000 (13:34 -0500)]
virt: split detect_vm into separate functions

It didn't build on arm. Let's simplify it a bit by
splitting x86 specific parts out, which should also make
things easier when arm virtualization support is added.

8 years agobuild-sys: make multi-seat-x optional
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 17:07:29 +0000 (12:07 -0500)]
build-sys: make multi-seat-x optional

At some point it should become disabled by default.

8 years agocore: fix SetUnitProperties
Marc-Antoine Perennou [Tue, 26 Nov 2013 03:42:17 +0000 (12:42 +0900)]
core: fix SetUnitProperties

8 years agoRevert "link-config: match length for kernel commandline option"
Tom Gundersen [Thu, 28 Nov 2013 19:06:42 +0000 (20:06 +0100)]
Revert "link-config: match length for kernel commandline option"

This reverts commit da66338e17f4df04d9d7cc22ec971b416d57761e.

It is superseeded by 70f75a523b16ad495a7791d595ee3eececf75953

8 years agoclean up TODO
Lennart Poettering [Thu, 28 Nov 2013 17:42:00 +0000 (18:42 +0100)]
clean up TODO

8 years agobus: add new sd_bus_creds object to encapsulate process credentials
Lennart Poettering [Thu, 28 Nov 2013 16:50:02 +0000 (17:50 +0100)]
bus: add new sd_bus_creds object to encapsulate process credentials

This way we can unify handling of credentials that are attached to
messages, or can be queried for bus name owners or connection peers.

This also adds the ability to extend incomplete credential information
with data from /proc,

Also, provide a convenience call that will automatically determine the
most appropriate credential object for an incoming message, by using the
the attached information if possible, the sending name information if
available and otherwise the peer's credentials.

8 years agoutil: fix handling of trailing whitespace in split_quoted()
Lennart Poettering [Wed, 27 Nov 2013 21:37:52 +0000 (22:37 +0100)]
util: fix handling of trailing whitespace in split_quoted()

Inspired by a patch by Lukas Nykryn.

8 years agoman: move socket-proxyd man page to section 8, since it is not in the $PATH
Lennart Poettering [Wed, 27 Nov 2013 20:14:56 +0000 (21:14 +0100)]
man: move socket-proxyd man page to section 8, since it is not in the $PATH

8 years agoman: get rid of shell script example in systemd-socket-proxyd man page
Lennart Poettering [Wed, 27 Nov 2013 20:14:08 +0000 (21:14 +0100)]
man: get rid of shell script example in systemd-socket-proxyd man page

8 years agoRevert "socket-proxyd: Add --listener option for listener/destination pairs."
Lennart Poettering [Wed, 27 Nov 2013 19:55:15 +0000 (20:55 +0100)]
Revert "socket-proxyd: Add --listener option for listener/destination pairs."

This reverts commit adcf4c81c58511b67644e17fa743d1729d3c9ccf.

We have a better solution for the problem of making two processes run in
the same namespace, and --listener is not needed hence and should be


8 years agologind: remove unused session->closing field
David Herrmann [Thu, 28 Nov 2013 16:29:01 +0000 (17:29 +0100)]
logind: remove unused session->closing field

This field is always false, drop it. If you want a reliable way to get
session state, call session_get_state(). Testing for any flags directly
doesn't work currently so don't pretend it would.

8 years agologind: require VTs on seat0 and forbid elsewhere
David Herrmann [Thu, 28 Nov 2013 16:25:25 +0000 (17:25 +0100)]
logind: require VTs on seat0 and forbid elsewhere

Sessions on seat0 must pass us a vtnr, otherwise, you shouldn't try
attaching it to seat0. For seats without VTs, we do the exact opposite: we
forbid VTs.

There can be odd situations if the session-files contain invalid
combinations. However, we try to keep sessions alive and restore state as
good as possible.

8 years agologind: make VT numbers unsigned
David Herrmann [Thu, 28 Nov 2013 16:05:34 +0000 (17:05 +0100)]
logind: make VT numbers unsigned

Fix the whole code to use "unsigned int" for vtnr. 0 is an invalid vtnr so
we don't need negative numbers at all.

Note that most code already assumes it's unsigned so in case there's a
negative vtnr, our code may, under special circumstances, silently break.
So this patch makes sure all sources of vtnrs verify the validity. Also
note that the dbus api already uses unsigned ints.

8 years agonetworkd: fix several Address entries in [Network] section
Tom Gundersen [Thu, 28 Nov 2013 16:17:04 +0000 (17:17 +0100)]
networkd: fix several Address entries in [Network] section

8 years agoevent: allow EPOLLET as event flag
David Herrmann [Wed, 27 Nov 2013 09:36:35 +0000 (10:36 +0100)]
event: allow EPOLLET as event flag

EPOLLET enables edge-triggered mode (see epoll(7) for more). For most
use-cases, level-triggered is just fine, but for master-TTYs we need
edge-triggered to catch EPOLLHUP. master-TTYs signal EPOLLHUP if no client
is connected, but a client may connect some time later (same happens
during vhangup(2)).

However, epoll doesn't allow masking EPOLLHUP so it's signaled constantly.
To avoid this, edge-triggered mode is needed.

8 years agologind: mute/restore VT on behalf of session controllers
David Herrmann [Thu, 28 Nov 2013 14:10:24 +0000 (15:10 +0100)]
logind: mute/restore VT on behalf of session controllers

If a session process calls TakeControl(), we now put the VT into
KD_GRAPHICS+K_OFF mode. This way, the new session controller can solely
rely on the logind-dbus API to manage the session.

Once the controller exits or calls ReleaseControl(), we restore the VT. We
also restore it, if we lost a controller during crash/restart (but only if
there really *was* a controller previously).

Note that we also must put the VT into VT_PROCESS mode. We want VT_AUTO
semantics, but VT_AUTO+KD_GRAPHICS actually disables *all* VT switches
(who came up with that great idea?). Hence, we set VT_PROCESS for logind
but acknowledge *all* requests immediately.

If a compositor wants custom VT setups, they can still get this by *first*
calling TakeControl() and afterwards setting up the VT. logind doesn't
touch the VT during controller runtime, only during setup/teardown. This
is actually what weston already does.

8 years agologind: restore session-controller after crash
David Herrmann [Thu, 28 Nov 2013 13:58:57 +0000 (14:58 +0100)]
logind: restore session-controller after crash

We now save the unique bus-name of a session-controller as CONTROLLER=%s
in the session files. This allows us to restore the controller after a
crash or restart.

Note that we test whether the name is still valid (dbus guarantees that
the name is unique as long as the machine is up and running). If it is,
we know that the controller still exists and can safely restore it. Our
dbus-name-tracking guarantees that we're notified once it exits.

Also note that session-devices are *not* restored. We have no way to know
which devices where used before the crash. We could store all these on
disk, too, or mark them via udev. However, this seems to be rather
cumbersome. Instead, we expect controllers to listen for NewSession
signals for their own session. This is sent on session_load() and they can
then re-request all devices.

The only race I could find is if logind crashes, then the session
controller tries calling ReleaseControl() (which will fail as logind is
down) but keeps the bus-connection valid for other independent requests.
If logind is restarted, it will restore the old controller and thus block
the session.
However, this seems unlikely for several reasons:
 - The ReleaseControl() call must occur exactly in the timespan where
   logind is dead.
 - A process which calls ReleaseControl() usually closes the
   bus-connection afterwards. Especially if ReleaseControl() fails, the
   process should notice that something is wrong and close the bus.
 - A process calling ReleaseControl() usually exits afterwards. There may
   be any cleanup pending, but other than that, usual compositors exit.
 - If a session-controller calls ReleaseControl(), a session is usually
   considered closing. There is no known use-case where we hand-over
   session-control in a single session. So we don't care whether the
   controller is locked afterwards.

So this seems negligible.

8 years agologind: ignore failing close() on session-devices
David Herrmann [Thu, 28 Nov 2013 13:51:40 +0000 (14:51 +0100)]
logind: ignore failing close() on session-devices

Unfortunately, close() on a revoked/removed character-device fails with
ENODEV. I tried tracking this down in the kernel, but couldn't figure out
were exactly it comes from. However, can be easily reproduced with:
  fd = open("/dev/input/event0", O_RDWR);
  ioctl(fd, EVIOCREVOKE, 0);
  r = close(fd);
A second close on @fd would return EBADF so the close is actually valid.

We simply ignore close() errors for all session-devices as their access
may be revoked asynchronously, or the device might get unplugged.
We use close_nointr() in case anyone ever looks at the return value (or
anyone runs "grep 'close(' -r src/" to find broken close() calls).

  systemd-logind[31992]: Assertion 'close_nointr(fd) == 0' failed at src/shared/util.c:185, function close_nointr_nofail(). Aborting.

8 years agobus: add bus_name_has_owner() helper
David Herrmann [Thu, 28 Nov 2013 13:50:19 +0000 (14:50 +0100)]
bus: add bus_name_has_owner() helper

Small helper to run a synchronous "NameHasOwner" request on the

8 years agologin: revert lazy session-activation on non-VT seats
David Herrmann [Thu, 28 Nov 2013 09:52:18 +0000 (10:52 +0100)]
login: revert lazy session-activation on non-VT seats

Existing applications like gdm already depend on new sessions to get
immediately activated on seats without VTs. Fixes a bug reported as:
  [systemd-devel] systemd 208:trouble with inactive user sessions at non-seat0 seats

This patch restores the original behavior. We either need to add a new
flag for session-creation or some other heuristic to avoid activating new
sessions in the future.

8 years agobuild-sys: avoid warnings from assert_cc
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 08:41:33 +0000 (03:41 -0500)]
build-sys: avoid warnings from assert_cc

8 years agopo: install translations
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 08:29:26 +0000 (03:29 -0500)]
po: install translations

8 years agocatalog,po: add Russian translation
Sergey Ptashnick [Thu, 28 Nov 2013 08:11:04 +0000 (03:11 -0500)]
catalog,po: add Russian translation

8 years agocatalog: fix typos in the French translation
Sylvain Plantefeve [Wed, 27 Nov 2013 19:43:09 +0000 (20:43 +0100)]
catalog: fix typos in the French translation

8 years agobus: update kdbus.h and always subscribe to KDBUS_HELLO_ATTACH_NAMES
Kay Sievers [Thu, 28 Nov 2013 01:26:03 +0000 (02:26 +0100)]
bus: update kdbus.h and always subscribe to KDBUS_HELLO_ATTACH_NAMES

8 years agoautomount: log info about triggering process
Kay Sievers [Thu, 28 Nov 2013 00:25:10 +0000 (01:25 +0100)]
automount: log info about triggering process

8 years agocore: initialize variable
Kay Sievers [Thu, 28 Nov 2013 00:24:56 +0000 (01:24 +0100)]
core: initialize variable

8 years agoTODO: add sd-rtnl items
Tom Gundersen [Wed, 27 Nov 2013 22:15:04 +0000 (23:15 +0100)]
TODO: add sd-rtnl items

8 years agoRevert "socket-proxyd: Add --listener option for listener/destination pairs."
Lennart Poettering [Wed, 27 Nov 2013 19:55:15 +0000 (20:55 +0100)]
Revert "socket-proxyd: Add --listener option for listener/destination pairs."

This reverts commit adcf4c81c58511b67644e17fa743d1729d3c9ccf.

We have a better solution for the problem of making two processes run in
the same namespace, and --listener is not needed hence and should be


8 years agonamespace: comment typo fix
Lennart Poettering [Wed, 27 Nov 2013 19:31:51 +0000 (20:31 +0100)]
namespace: comment typo fix

8 years agobus: properly handle if we get disconnected during HELLO phase
Lennart Poettering [Wed, 27 Nov 2013 19:24:10 +0000 (20:24 +0100)]
bus: properly handle if we get disconnected during HELLO phase

8 years agoservice: add the ability for units to join other unit's PrivateNetwork= and PrivateTm...
Lennart Poettering [Wed, 27 Nov 2013 19:23:18 +0000 (20:23 +0100)]
service: add the ability for units to join other unit's PrivateNetwork= and PrivateTmp= namespaces

8 years agoTODO: add dbus runtime depedency
Tom Gundersen [Wed, 27 Nov 2013 15:50:53 +0000 (16:50 +0100)]
TODO: add dbus runtime depedency

8 years agonetworkd: Initialize variable to NULL
Patrik Flykt [Wed, 27 Nov 2013 15:28:54 +0000 (17:28 +0200)]
networkd: Initialize variable to NULL

If any number of arguments are given, _cleanup_manager_free_ is used
with unitialized memory causing a crash.

8 years agoTODO: remove dbus requirement
Kay Sievers [Wed, 27 Nov 2013 12:15:10 +0000 (13:15 +0100)]
TODO: remove dbus requirement