Re: [systemd-devel] Per session systemd?

2014-03-03 Thread David Herrmann
Hi On Mon, Mar 3, 2014 at 8:30 AM, Yuxuan Shui yshu...@gmail.com wrote: Hi, This mail might be a little bit later for the topic, but I would like to share my thoughts anyway. Before systemd 206 was released, there are a few users (I don't know how many of them are there, but there's a page

Re: [systemd-devel] Per session systemd?

2014-03-03 Thread David Herrmann
applications in different sessions. Correct me if I'm wrong. Regards, Yuxuan Shui. On Mon, Mar 3, 2014 at 4:46 PM, Yuxuan Shui yshu...@gmail.com wrote: Hi, On Mon, Mar 3, 2014 at 4:11 PM, David Herrmann dh.herrm...@gmail.com wrote: Hi On Mon, Mar 3, 2014 at 8:30 AM, Yuxuan Shui yshu

Re: [systemd-devel] [RFC] bus: add sd_bus_emit_object_{added, removed}()

2014-03-03 Thread David Herrmann
ping? On Tue, Feb 18, 2014 at 12:02 AM, David Herrmann dh.herrm...@gmail.com wrote: The ObjectManager dbus interface provides an InterfacesAdded signal to notify others about new interfaces that are added to an object. The same signal is also used to advertise new objects (by adding the first

Re: [systemd-devel] systemd-backlight and backlight level 0

2014-03-05 Thread David Herrmann
Hi On Wed, Mar 5, 2014 at 6:46 PM, Josh Triplett j...@joshtriplett.org wrote: systemd-backlight saves backlight levels on shutdown, and restores them on startup. However, on some systems, backlight level 0 actually turns the backlight *off*; this can potentially make the system unusable.

Re: [systemd-devel] systemd-backlight and backlight level 0

2014-03-05 Thread David Herrmann
Hi On Wed, Mar 5, 2014 at 8:31 PM, Josh Triplett j...@joshtriplett.org wrote: On Wed, Mar 05, 2014 at 07:10:51PM +0100, Lennart Poettering wrote: On Wed, 05.03.14 09:46, Josh Triplett (j...@joshtriplett.org) wrote: systemd-backlight saves backlight levels on shutdown, and restores them on

Re: [systemd-devel] Suspending access to opened/active /dev/nodes during application runtime

2014-03-11 Thread David Herrmann
Hi On Fri, Mar 7, 2014 at 7:45 PM, Lukasz Pawelczyk hav...@gmail.com wrote: Problem: Has anyone thought about a mechanism to limit/remove an access to a device during an application runtime? Meaning we have an application that has an open file descriptor to some /dev/node and depending on

Re: [systemd-devel] [RFC] bus: add sd_bus_emit_object_{added, removed}()

2014-03-11 Thread David Herrmann
Hi On Tue, Mar 11, 2014 at 7:27 PM, Lennart Poettering lenn...@poettering.net wrote: On Tue, 18.02.14 00:02, David Herrmann (dh.herrm...@gmail.com) wrote: Sorry for the late review! However, on object_removed() I cannot do that as node_vtable_get_userdata() is very likely to return 0

Re: [systemd-devel] [RFC][PATCH] sd-bus: split ref-counting of queues from ref-counting of the rest of the sd-bus object

2014-03-23 Thread David Herrmann
Hi On Sun, Mar 23, 2014 at 4:49 PM, Tom Gundersen t...@jklm.no wrote: Introduce a new ref-count, n_ref_queues, which only protects the {r,w}queue of a bus, and introduce bus_{un,}ref(), which are only available internally, and which do not protect these queues. Make sure that sd_bus_message

Re: [systemd-devel] [PATCH] use systemd.debug on the kernel command line, not debug

2014-04-03 Thread David Herrmann
Hi On Thu, Apr 3, 2014 at 11:08 AM, Tom Gundersen t...@jklm.no wrote: Or is there actually a bug going on here? My impression from reading related discussions was that systemd.log_level=debug loglevel=debug triggers some bug (so in particular debug now triggers the bug). It was not clear to

Re: [systemd-devel] [PATCH] Add Mir to the list of session types

2014-04-09 Thread David Herrmann
Hi On Thu, Apr 3, 2014 at 10:46 PM, Robert Ancell robert.anc...@canonical.com wrote: Add Mir to the list of session types. This is implemented for LightDM in lp:~robert-ancell/lightdm/xdg-session-desktop [1]. [1]

Re: [systemd-devel] [PATCH] names: take the registry write lock in kdbus_name_release()

2014-04-18 Thread David Herrmann
Hi On Fri, Apr 18, 2014 at 3:16 AM, Djalal Harouni tix...@opendz.org wrote: Take the write lock in kdbus_name_release() instead of kdbus_cmd_name_release() in order to reduce the lock hold time. This change permits to convert the kdbus_bus_find_conn_by_id() call to kdbus_conn_find_peer()

Re: [systemd-devel] [PATCH] Check the right variable for failed open()

2014-05-08 Thread David Herrmann
Hi On Thu, May 8, 2014 at 12:57 PM, Łukasz Stelmach l.stelm...@samsung.com wrote: --- I am not quite sure but checking r in this if does not make much sense. Nice catch. Applied. Thanks David src/core/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [systemd-devel] systemd pam and O_CLOEXEC problem

2014-05-12 Thread David Herrmann
Hi On Mon, May 12, 2014 at 1:27 PM, dedede gfgfgf trtrtrtrtrtr s.kabano...@mail.ru wrote: Hello Colin. I am speaking about descriptors in systemd pam module. Application which use pam can not control it. Because of: session_fd = dup(session_fd); in pam-module.c we have now

Re: [systemd-devel] systemd pam and O_CLOEXEC problem

2014-05-12 Thread David Herrmann
Hi On Mon, May 12, 2014 at 1:49 PM, Sergei Kabanov s.kabano...@mail.ru wrote: Hello But all children will have that descriptor open. So when parent process will die logind will not be notified. And? That's intentional. If you want to close the session if the main process dies, use something

Re: [systemd-devel] GDM session is not activated

2014-05-23 Thread David Herrmann
Hi On Thu, May 22, 2014 at 9:19 PM, Oleg Samarin osamari...@gmail.com wrote: I have two-seat configuration on my PC. The problem is that when I log in to GDM session on seat0, it rests being not active, and I can not activate it with 'loginctl activate' command. gdm is responsible of setting

Re: [systemd-devel] [PATCH 17/17] networkd: add dhcp server support

2014-05-27 Thread David Herrmann
Hi On Tue, May 27, 2014 at 12:41 PM, Michael Biebl mbi...@gmail.com wrote: 2014-05-27 4:38 GMT+02:00 Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl: before looking at the code, a couple of general questions: - does the DHCP server have to be part of networkd? Isn't the job of acquiring

Re: [systemd-devel] joystick doesn't respect seat rule

2014-05-28 Thread David Herrmann
Hi On Wed, May 28, 2014 at 11:07 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Wed, May 28, 2014 at 09:22:23PM +0200, Floris wrote: Op Wed, 28 May 2014 20:38:17 +0200 schreef Mantas Mikulėnas graw...@gmail.com: So the seat assignment works fine – gdm is added to the ACL.

Re: [systemd-devel] Why do we must use the close_all_fds(3) function in some files?

2014-06-16 Thread David Herrmann
Hi On Mon, Jun 16, 2014 at 2:32 PM, Geunsik Lim geunsik@gmail.com wrote: Hi all, Recently, i checked that there are some of the close_all_fds functions as follows Why we Systemd run this functions? Whey this functions need Systemd's management?

Re: [systemd-devel] [PATCH 07/11] Support init=/bin/bash on the kernel command line

2014-06-16 Thread David Herrmann
Hi On Mon, Jun 16, 2014 at 2:42 PM, Dr. Werner Fink wer...@suse.de wrote: On Fri, Jun 13, 2014 at 05:49:24PM +0200, Tom Gundersen wrote: On Fri, Jun 13, 2014 at 4:41 PM, Werner Fink wer...@suse.de wrote: From: Ruediger Oertel r...@suse.de Process 1 (aka init) needs to be started with an

[systemd-devel] [PATCH 1/3] shared: add generic IPC barrier

2014-07-13 Thread David Herrmann
: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 David Herrmann dh.herrm...@gmail.com + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either

[systemd-devel] [PATCH 2/3] nspawn: use Barrier API instead of eventfd-util

2014-07-13 Thread David Herrmann
The Barrier-API simplifies cross-fork() synchronization a lot. Replace the hard-coded eventfd-util implementation and drop it. Compared to the old API, Barriers also handle exit() of the remote side as abortion. This way, segfaults will not cause the parent to deadlock. EINTR handling is

[systemd-devel] [PATCH 0/3] Cross fork() synchronization via Barrier API

2014-07-13 Thread David Herrmann
is also available at fdo in my @ui branch: http://cgit.freedesktop.org/~dvdhrm/systemd/log/?h=ui Comments welcome! David David Herrmann (3): shared: add generic IPC barrier nspawn: use Barrier API instead of eventfd-util shared: add PTY helper .gitignore| 2

[systemd-devel] [PATCH 3/3] shared: add PTY helper

2014-07-13 Thread David Herrmann
-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 David Herrmann dh.herrm...@gmail.com + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published

Re: [systemd-devel] [PATCH 2/3] nspawn: use Barrier API instead of eventfd-util

2014-07-17 Thread David Herrmann
Hi On Mon, Jul 14, 2014 at 3:28 AM, Djalal Harouni tix...@opendz.org wrote: ppoll is atomic and it is handled by the kernel, so perhaps setting/restoring sigmask can be done easily! and for nspawn: IMO we need to receive SIGCHLD which implies EINTR. I say EINTR since not only for blocking

Re: [systemd-devel] Warnings from recent commits

2014-07-19 Thread David Herrmann
Hi On Thu, Jul 17, 2014 at 8:51 PM, Thomas H.P. Andersen pho...@gmail.com wrote: From recent commits I have noticed the following new issues from static analysis with scan-build and with clang. I am not sure how they should be fixed (or even if) but I just though I would let you know. 1)

Re: [systemd-devel] [PATCH 1/3] logind: session: don't set /dev/ttyX owner to root on restore_vt

2014-08-11 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 5:05 PM, Olivier Brunel j...@jjacky.com wrote: On 08/11/14 16:54, Lennart Poettering wrote: On Mon, 11.08.14 16:39, Olivier Brunel (j...@jjacky.com) wrote: On 08/11/14 16:25, Lennart Poettering wrote: On Fri, 08.08.14 20:45, Olivier Brunel (j...@jjacky.com) wrote:

Re: [systemd-devel] [PATCH 2/3] logind: session: set_controller should fail if prepare_vt fails

2014-08-11 Thread David Herrmann
Hi On Fri, Aug 8, 2014 at 8:45 PM, Olivier Brunel j...@jjacky.com wrote: If controllers can expect logind to have prepared the VT (e.g. set it to graphics mode, etc) then TakeControl() should fail if said preparation failed (and session_restore_vt() was called). ---

Re: [systemd-devel] [PATCH 3/3] logind: session: Fix not allowing more than one controller

2014-08-11 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 4:52 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 11.08.14 16:46, Olivier Brunel (j...@jjacky.com) wrote: On 08/11/14 16:34, Lennart Poettering wrote: On Fri, 08.08.14 20:45, Olivier Brunel (j...@jjacky.com) wrote: While a session can only ever

[systemd-devel] [PATCH] login: share VT-signal handler between sessions

2014-08-11 Thread David Herrmann
sd-event does not allow multiple handlers for a single signal. However, logind sets up signal handlers for each session with VT_PROCESS set (that is, it has an active controller). Therefore, registering multiple such controllers will fail. Lets make the VT-handler global, as it's mostly trivial,

Re: [systemd-devel] [PATCH 2/3] logind: session: set_controller should fail if prepare_vt fails

2014-08-11 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 6:13 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 11.08.14 17:17, David Herrmann (dh.herrm...@gmail.com) wrote: Hi On Fri, Aug 8, 2014 at 8:45 PM, Olivier Brunel j...@jjacky.com wrote: If controllers can expect logind to have prepared the VT (e.g

Re: [systemd-devel] [PATCH 1/3] logind: session: don't set /dev/ttyX owner to root on restore_vt

2014-08-11 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 5:37 PM, Olivier Brunel j...@jjacky.com wrote: On 08/11/14 17:12, David Herrmann wrote: Wait, what? Can you please elaborate. Currently, only one process can Sorry, I meant e.g. having one rootless X on tt1 and starting another one on tty2. Currently this fails

Re: [systemd-devel] [PATCH] login: share VT-signal handler between sessions

2014-08-11 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 6:54 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 11.08.14 18:46, Lennart Poettering (lenn...@poettering.net) wrote: With this code you block, but do not ignore SGRTMIN+1. Now, rtsigs actually are implemented in a queue, multiple instances of the

Re: [systemd-devel] [PATCH] login: share VT-signal handler between sessions

2014-08-13 Thread David Herrmann
Hi On Mon, Aug 11, 2014 at 7:57 PM, Olivier Brunel j...@jjacky.com wrote: On 08/11/14 18:21, David Herrmann wrote: sd-event does not allow multiple handlers for a single signal. However, logind sets up signal handlers for each session with VT_PROCESS set (that is, it has an active controller

Re: [systemd-devel] Thoughts about /etc/crypttab keyscript options

2014-08-14 Thread David Herrmann
Hi On Thu, Aug 14, 2014 at 7:44 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 21.07.14 10:46, Marc Haber (mh+systemd-de...@zugschlus.de) wrote: Heya, I have read the thread (from 2012?) where those things were discussed here and I understand that I should replace my keyscript

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Thu, Aug 14, 2014 at 8:07 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 18.07.14 16:02, Thomas H.P. Andersen (pho...@gmail.com) wrote: 1716f6dcf54d4c181c2e2558e3d5414f54c8d9ca (resolved: add LLMNR support for looking up names) broke the build on clang.

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 11:35 AM, Thomas H.P. Andersen pho...@gmail.com wrote: On Fri, Aug 15, 2014 at 10:55 AM, David Herrmann dh.herrm...@gmail.com wrote: Hi On Thu, Aug 14, 2014 at 8:07 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 18.07.14 16:02, Thomas H.P. Andersen

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 11:38 AM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 10:55, David Herrmann (dh.herrm...@gmail.com) wrote: Hm, I don't know whether that works. See the description here: https://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Other-Builtins.html

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 12:29 PM, Thomas H.P. Andersen pho...@gmail.com wrote: On Fri, Aug 15, 2014 at 11:49 AM, David Herrmann dh.herrm...@gmail.com wrote: Thanks for trying! Result is as I expected. Evaluation takes place _after_ validating compile-time constants, and thus

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 1:22 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 13:00, David Herrmann (dh.herrm...@gmail.com) wrote: src/resolve/resolved-dns-stream.c:67:43: error: non-const static data member must be initialized out of line uint8_t

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 1:53 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 13:42, David Herrmann (dh.herrm...@gmail.com) wrote: Hi On Fri, Aug 15, 2014 at 1:22 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 13:00, David Herrmann (dh.herrm

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 1:53 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 13:42, David Herrmann (dh.herrm...@gmail.com) wrote: Hi On Fri, Aug 15, 2014 at 1:22 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 15.08.14 13:00, David Herrmann (dh.herrm

Re: [systemd-devel] compile with clang broken

2014-08-15 Thread David Herrmann
Hi On Fri, Jul 18, 2014 at 4:02 PM, Thomas H.P. Andersen pho...@gmail.com wrote: 1716f6dcf54d4c181c2e2558e3d5414f54c8d9ca (resolved: add LLMNR support for looking up names) broke the build on clang. src/resolve/resolved-manager.c:553:43: error: non-const static data member must be

Re: [systemd-devel] compile with clang broken

2014-08-16 Thread David Herrmann
Hi On Fri, Aug 15, 2014 at 5:22 PM, Daniele Nicolodi dani...@grinta.net wrote: On 15/08/2014 16:30, David Herrmann wrote: Ok, took me a while, but I now figured out how to cause compilation to fail even in expressions that initialize types (_Static_assert is not allowed there): #define

Re: [systemd-devel] [PATCH kdbus] handle: Return POLLOUT | POLLWRNORM mask when no messages are pending

2014-08-18 Thread David Herrmann
Hi On Mon, Aug 18, 2014 at 4:15 PM, Marcel Holtmann mar...@holtmann.org wrote: Hi Lennart, To facility the feature of doing an asynchronous sending of messages when the bus is idle, make sure to return POLLOUT | POLLWRNORM from kdbus_handle_poll. Signed-off-by: Marcel Holtmann

Re: [systemd-devel] kdbus: merge 3.17 branch into master?

2014-08-19 Thread David Herrmann
Hi Greg On Tue, Aug 19, 2014 at 1:29 PM, Greg KH gre...@linuxfoundation.org wrote: Hi all, Now that memfd is merged into 3.17-rc1, should we merge the 3.17 branch in the kdbus tree into master as well? Right now, the test directory on master doesn't build properly on older kernels due to

Re: [systemd-devel] compile with clang broken

2014-08-22 Thread David Herrmann
Hi On Sat, Aug 16, 2014 at 1:29 PM, Daniele Nicolodi dani...@grinta.net wrote: On 16/08/2014 12:35, David Herrmann wrote: On Fri, Aug 15, 2014 at 5:22 PM, Daniele Nicolodi dani...@grinta.net wrote: this may be completely stupid, but if the only use case you have for CONST_MAX

[systemd-devel] [PATCH] shared: make container_of() use unique variable names

2014-08-22 Thread David Herrmann
If you stack container_of() macros, you will get warnings due to shadowing variables of the parent context. To avoid this, use unique names for variables. Two new helpers are added: UNIQ: This evaluates to a truly unique value never returned by any evaluation of this macro. It's a

[systemd-devel] [PATCH 00/10] Device Management for systemd-logind

2013-08-25 Thread David Herrmann
watches the bus for disconnect events and invokes this implicitly if a controller exits. David Herrmann (10): logind: listen actively for session devices logind: add infrastructure to watch busnames logind: add session controllers logind: make Session.Activate() lazy logind

[systemd-devel] [PATCH 01/10] logind: listen actively for session devices

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 02/10] logind: add infrastructure to watch busnames

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 03/10] logind: add session controllers

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 04/10] logind: make Session.Activate() lazy

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 05/10] logind: introduce session-devices

2013-08-25 Thread David Herrmann
-session-device.c new file mode 100644 index 000..7c6b07f --- /dev/null +++ b/src/login/logind-session-device.c @@ -0,0 +1,489 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann + + systemd is free

[systemd-devel] [PATCH 06/10] logind: rename vtconsole to seat0

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 07/10] logind: fix seat_can_tty() to check for VTs

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH 08/10] logind: fix session_activate(vtnr = 0)

2013-08-25 Thread David Herrmann
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. --- src/login/logind-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[systemd-devel] [PATCH 09/10] logind: extract has_vts() from can_multi_session()

2013-08-25 Thread David Herrmann
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:

[systemd-devel] [PATCH 10/10] logind: implement generic multi-session

2013-08-25 Thread David Herrmann
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

[systemd-devel] [PATCH] libudev: enumerate: fix NULL-deref for subsystem-matches

2013-08-30 Thread David Herrmann
udev_device_get_subsystem() may return NULL if no subsystem could be figured out by libudev. This might be due to OOM or if the device disconnected between the udev_device_new() call and udev_device_get_subsystem(). Therefore, we need to handle subsystem==NULL safely. Instead of testing for it in

[systemd-devel] [PATCH] build: check for build/link flags harder

2013-09-13 Thread David Herrmann
Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to test for flags that might succeed during compilation but not during linking. An example is gcc compiled with libssp support but gnu-ld without it. In this case -fstack-protector works fine during compilation but fails during linking as several

[systemd-devel] [PATCH v2 04/10] logind: make Session.Activate() lazy

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH v2 03/10] logind: add session controllers

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH v2 06/10] logind: rename vtconsole to seat0

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH v2 05/10] logind: introduce session-devices

2013-09-17 Thread David Herrmann
-session-device.c new file mode 100644 index 000..659f161 --- /dev/null +++ b/src/login/logind-session-device.c @@ -0,0 +1,489 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann + + systemd is free

[systemd-devel] [PATCH v2 10/10] logind: implement generic multi-session

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH v2 08/10] logind: fix session_activate(vtnr = 0)

2013-09-17 Thread David Herrmann
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. --- src/login/logind-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[systemd-devel] [PATCH v2 09/10] logind: extract has_vts() from can_multi_session()

2013-09-17 Thread David Herrmann
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:

[systemd-devel] [PATCH v2 07/10] logind: fix seat_can_tty() to check for VTs

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH v2 01/10] logind: listen actively for session devices

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH] logind: implement generic multi-session

2013-09-17 Thread David Herrmann
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

[systemd-devel] [PATCH] logind: introduce session-devices

2013-09-17 Thread David Herrmann
--- /dev/null +++ b/src/login/logind-session-device.c @@ -0,0 +1,451 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann + + systemd is free software; you can redistribute it and/or modify it + under

[systemd-devel] [PATCH] logind: fix build for ARM with sizeof(dev_t) sizeof(void*)

2013-09-17 Thread David Herrmann
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. --- src/login/logind-session-dbus.c | 12 +++- src/login/logind-session-device.c | 8 +++-

Re: [systemd-devel] Xorg+logind+DM issue: inactive graphical session for seat0

2013-11-01 Thread David Herrmann
Hi On Tue, Oct 29, 2013 at 4:44 PM, Laércio de Sousa lbsous...@gmail.com wrote: I would append another approach to the list: * For non-seat0 seats, X server should open no VT at all. Currently, even with -sharevts option, it seems Xorg does open a VT, although it can't control this. Yes,

[systemd-devel] [PATCH] log: add log_errno() helper

2013-11-15 Thread David Herrmann
Syscalls may fail for a lot of reasons, but most times these errors are unexpected (we cannot recover). Especially when dealing with device nodes that can be revoked asynchronously, a series of syscalls may start failing at any point. Normally, we can silently ignore errors and just bail out, but

Re: [systemd-devel] [PATCH] log: add log_errno() helper

2013-11-15 Thread David Herrmann
Hi On Fri, Nov 15, 2013 at 2:33 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Fri, Nov 15, 2013 at 11:22:59AM +0100, David Herrmann wrote: Syscalls may fail for a lot of reasons, but most times these errors are unexpected (we cannot recover). Especially when dealing with device

[systemd-devel] [PATCH] event: clear pending-state when re-arming timers

2013-11-19 Thread David Herrmann
If a timer fires and is marked pending, but an application re-arms it before it is dispatched, we now clear the pending state. This fixes a bug where an application arms a timer, which fires and is marked pending. But before it is dispatched, the application loses interest in it and disables it.

Re: [systemd-devel] systemd 208:trouble with inactive user sessions at non-seat0 seats

2013-11-20 Thread David Herrmann
Hi On Tue, Nov 19, 2013 at 7:13 PM, Laércio de Sousa lbsous...@gmail.com wrote: Hi there! I'm testing both Fedora 20 Beta and openSUSE 13.1 in my multiseat system (with GNOME 3.10, GDM 3.10.0.1 and systemd 208). I'm currently observing a strange behaviour which didn't occur in previous

Re: [systemd-devel] [PATCH] include: fix problem with __LINE__ macro expansion

2013-11-22 Thread David Herrmann
for review. Thanks! Seems David Herrmann has now fixed this thing slightly differently. I just noticed the compile-failure and fixed it up myself. But this patch definitely looks nicer. I now changed the helper-name to XCONCATENATE similar to XSTRINGIFY and added a UNIQUE macro to generate

[systemd-devel] [RFC 00/12] Bugfixes for CONFIG_VT=n

2013-11-27 Thread David Herrmann
! ..add useful features like full-BMP-range Unicode-fonts, properly internationalized keymaps, readable fonts on high-DPI displays, access-separation, accessibility helpers and more to the system console? Wait.. that's obvious, isn't it? Besides, coding is fun! David David Herrmann (12

[systemd-devel] [RFC 03/12] bus: add two new bus_*_map_*_properties() helpers

2013-11-27 Thread David Herrmann
This splits the core of bus_map_all_properties() out into a new helper called bus_message_map_all_properties(). Instead of sending a blocking dbus call, this helper takes the response message as argument and parses it. So the normal use-case is to send an async GetAll() request and once you get

[systemd-devel] [RFC 05/12] gfx: add sd-gfx library with unifont section

2013-11-27 Thread David Herrmann
: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# +# This file is part of systemd. +# +# Copyright 2013 David Herrmann dh.herrm...@gmail.com +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published

[systemd-devel] [RFC 01/12] event: allow EPOLLET as event flag

2013-11-27 Thread David Herrmann
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

[systemd-devel] [RFC 04/12] build: add target to link binary sources

2013-11-27 Thread David Herrmann
In several situations we want to link a binary file into our executable and access it from our C code. The easiest way is to transform it into a C-array and compile it as usual. However, for large files (1MB) such compilations can take a considerable amount of time or even fail on low-memory

[systemd-devel] [RFC 02/12] ring: add basic ring-buffer helper

2013-11-27 Thread David Herrmann
--- /dev/null +++ b/src/shared/ring.c @@ -0,0 +1,213 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com + + systemd is free software; you can redistribute it and/or modify it + under

[systemd-devel] [RFC 09/12] gfx: add kbd test

2013-11-27 Thread David Herrmann
/test-kbd.c new file mode 100644 index 000..b902171 --- /dev/null +++ b/src/libsystemd-gfx/test-kbd.c @@ -0,0 +1,314 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com + + systemd

[systemd-devel] [RFC 11/12] gfx: add unbuilt GL test

2013-11-27 Thread David Herrmann
/libsystemd-gfx/test-gl.c new file mode 100644 index 000..733b451 --- /dev/null +++ b/src/libsystemd-gfx/test-gl.c @@ -0,0 +1,342 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com

[systemd-devel] [RFC 10/12] gfx: add graphics test

2013-11-27 Thread David Herrmann
; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation

[systemd-devel] [RFC 06/12] gfx: add keyboard layer

2013-11-27 Thread David Herrmann
-kbd.c new file mode 100644 index 000..4de21dd --- /dev/null +++ b/src/libsystemd-gfx/gfx-kbd.c @@ -0,0 +1,629 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com + + systemd is free

[systemd-devel] [RFC 12/12] console: add systemd-consoled

2013-11-27 Thread David Herrmann
+++ b/src/console/consoled-pty.c @@ -0,0 +1,391 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2013 David Herrmann dh.herrm...@gmail.com + + systemd is free software; you can redistribute it and/or modify it + under

Re: [systemd-devel] [RFC 04/12] build: add target to link binary sources

2013-11-27 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 10:31 PM, Greg KH gre...@linuxfoundation.org wrote: On Wed, Nov 27, 2013 at 07:48:39PM +0100, David Herrmann wrote: In several situations we want to link a binary file into our executable and access it from our C code. The easiest way is to transform it into a C

Re: [systemd-devel] [RFC 00/12] Bugfixes for CONFIG_VT=n

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:44 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: Looks pretty good. Commented on the invidiaul patches, but mostly looks good. I am not sure about the whole approach of making

Re: [systemd-devel] [RFC 02/12] ring: add basic ring-buffer helper

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 10:53 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: +void ring_flush(Ring *r) { +r-start = 0; +r-end = 0; +} + +void ring_clear(Ring *r) { +free(r-buf

Re: [systemd-devel] [RFC 02/12] ring: add basic ring-buffer helper

2013-11-28 Thread David Herrmann
Hi On Thu, Nov 28, 2013 at 1:27 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: On Wed, Nov 27, 2013 at 4:48 PM, David Herrmann dh.herrm...@gmail.com wrote: This adds a very straightforward ring-buffer implementation to libsystemd-shared. Ring-buffers allow pushing data to, and pulling

Re: [systemd-devel] [RFC 03/12] bus: add two new bus_*_map_*_properties() helpers

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 10:58 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: +/* skip interface, but allow callers to do that themselves */ +sd_bus_message_skip(m, s); This feels a bit like taping

Re: [systemd-devel] [RFC 05/12] gfx: add sd-gfx library with unifont section

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:11 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: This patch introduces sd-gfx, a systemd-internal library dealing with all these things. Note that it is designed to be exported some day

Re: [systemd-devel] [RFC 06/12] gfx: add keyboard layer

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:17 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: + +enum { +SD_GFX__LED_NUML, +SD_GFX__LED_CAPSL, +SD_GFX__LED_SCROLLL, +SD_GFX__LED_COUNT

Re: [systemd-devel] [RFC 07/12] gfx: add graphics layer

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:24 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: +typedef struct gfx_config_pipe gfx_config_pipe; +typedef struct gfx_connector gfx_connector; +typedef struct gfx_encoder gfx_encoder

Re: [systemd-devel] [RFC 08/12] gfx: add monitor

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:34 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: While all previous sd-gfx interfaces are self-contained and can be used directly on selected devices, this adds an interface to connect

Re: [systemd-devel] [RFC 12/12] console: add systemd-consoled

2013-11-28 Thread David Herrmann
Hi On Wed, Nov 27, 2013 at 11:39 PM, Lennart Poettering lenn...@poettering.net wrote: On Wed, 27.11.13 19:48, David Herrmann (dh.herrm...@gmail.com) wrote: + +pid_t pty_new(unsigned short term_width, unsigned short term_height, Terminal *t, Pty **out) { +Pty *pty; +pid_t

Re: [systemd-devel] systemd 208:trouble with inactive user sessions at non-seat0 seats

2013-11-28 Thread David Herrmann
Hi On Tue, Nov 26, 2013 at 2:33 PM, Laércio de Sousa lbsous...@gmail.com wrote: David, Looking at GDM debug and gdm-simple-slave.c source file, as well as loginctl show-seat output. I guess that GDM only requests user session activation for seats with CanMultiSession=yes, but currently

  1   2   3   4   5   >