[systemd-devel] [PATCH 0/3] Add support for setting limit of memory + swap usage

2013-09-17 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com Add support for setting limit of memory + swap usage. So programes like libvirt could set it via systemd. Users could also set this via systemctl command. Chen Hanxiao (3): Enable systemd to set/show limit of memory+Swap usage Add support for

[systemd-devel] [PATCH 3/3] Add support for showing limit of memory+Swap usage via cgroup_context_dump

2013-09-17 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com Add support for showing limit of memory+Swap usage via cgroup_context_dump. Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com --- src/core/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/cgroup.c b/src/core/cgroup.c

[systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

2013-09-17 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com Enable systemd to set/show limit of memory+Swap usage. Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com --- src/core/cgroup.c | 11 +++ src/core/cgroup.h | 1 + src/core/dbus-cgroup.c

[systemd-devel] [PATCH 2/3] Add support for systemctl to set limit of memory+Swap usage

2013-09-17 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com Add support for systemctl to set limit of memory+Swap usage. Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com --- src/systemctl/systemctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c

Re: [systemd-devel] [PATCH] Just list all the variables

2013-09-17 Thread Colin Guthrie
'Twas brillig, and Zbigniew Jędrzejewski-Szmek at 16/09/13 14:26 did gyre and gimble: On Thu, Sep 12, 2013 at 03:37:14PM +0200, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Sep 12, 2013 at 03:32:12PM +0200, Zbigniew Jędrzejewski-Szmek wrote: On Fri, Jul 26, 2013 at 11:24:44AM +0100, Colin Guthrie

Re: [systemd-devel] [PATCH 1/5] cgroup: add the setting memory.use_hierarchy support for systemd

2013-09-17 Thread Lennart Poettering
On Mon, 16.09.13 09:57, Gao feng (gaof...@cn.fujitsu.com) wrote: On 09/13/2013 08:26 PM, Lennart Poettering wrote: On Fri, 13.09.13 17:49, Gao feng (gaof...@cn.fujitsu.com) wrote: Some programs need to set the memory.use_hierarchy(such as libvirt), Add this feature. Hmm, should

Re: [systemd-devel] An option to activate other unit (or units) when an unit enter deactivated state

2013-09-17 Thread Lennart Poettering
On Fri, 13.09.13 02:34, 황재영 (j-zero.hw...@samsung.com) wrote: Hello guys. I'm searching an option that activate unit (or units) when an unit enter deactivated state. I know OnFailure option, but that is activated when entering failed state only. Is threr any option

Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 14:21, Chen Hanxiao (chenhanx...@cn.fujitsu.com) wrote: +{ MemorySWLimit, bus_property_append_uint64, t, offsetof(CGroupContext, memsw_limit) }, { MemorySoftLimit, bus_property_append_uint64, t,

[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
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

[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

Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 14:21, Chen Hanxiao (chenhanx...@cn.fujitsu.com) wrote: From: Chen Hanxiao chenhanx...@cn.fujitsu.com @@ -89,6 +89,7 @@ $1.CPUAccounting,config_parse_bool, 0, $1.CPUShares,config_parse_cpu_shares,0,

[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

Re: [systemd-devel] Question: who should set up the cpuset cgroup

2013-09-17 Thread Lennart Poettering
On Mon, 16.09.13 11:17, Gao feng (gaof...@cn.fujitsu.com) wrote: Hi I'm working on adding set cpuset cgroup support for systemd. this work almost finished. but I faced a problem. As we know, if we create a machine,the cgroup for this machine will be created as well. and the cgroup of

Re: [systemd-devel] [PATCH] Just list all the variables

2013-09-17 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 17, 2013 at 09:56:53AM +0100, Colin Guthrie wrote: It's possibly worth mentioning that variables are not set from the underlying environment. e.g. if a user set export PATH=/opt/mystuff/bin:$PATH in /etc/profile.d/my-stuff.sh, systemd will not see that PATH change. While it

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:39, David Herrmann (dh.herrm...@gmail.com) wrote: Applied! Thanks! 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

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:39, David Herrmann (dh.herrm...@gmail.com) wrote: Please rename the bus calls to TakeControl()/ReleaseControl() (as discussed at the hackfest). Otherwise patch #2 and #3 look good to merge! A session usually has only a single compositor or other application that controls

[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

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 18:29, Lennart Poettering (lenn...@poettering.net) wrote: Please rename the bus calls to TakeControl()/ReleaseControl() (as discussed at the hackfest). Otherwise patch #2 and #3 look good to merge! Oh well, did the change myself now and commited! Thanks! Also commited #2, and

Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:36, Lennart Poettering (lenn...@poettering.net) wrote: On Tue, 17.09.13 14:21, Chen Hanxiao (chenhanx...@cn.fujitsu.com) wrote: From: Chen Hanxiao chenhanx...@cn.fujitsu.com @@ -89,6 +89,7 @@ $1.CPUAccounting,config_parse_bool, 0,

[systemd-devel] [PATCH] udev: path_id - fix by-path link generation for scm devices

2013-09-17 Thread Sebastian Ott
Set some_transport = true to prevent scm devices from being ignored. Suggested-by: Harald Hoyer har...@redhat.com Signed-off-by: Sebastian Ott seb...@linux.vnet.ibm.com --- src/udev/udev-builtin-path_id.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/udev/udev-builtin-path_id.c

Re: [systemd-devel] Question: who should set up the cpuset cgroup

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:45, Lennart Poettering (lenn...@poettering.net) wrote: 1, set up when systemd creates cpuset cgroup for machine.slice? 2, the programs which create the machines? 3, other ideas? kernel? I have the suspicion that we need to propagate this down from the root of the

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:39, David Herrmann (dh.herrm...@gmail.com) wrote: arg name=\force\ type=\b\/\n \ /method\n \ method name=\DropControl\/\n\ +

Re: [systemd-devel] [PATCH] systemd-nspawn@: drop ControlGroup=

2013-09-17 Thread Lennart Poettering
On Mon, 16.09.13 07:38, Brandon Philips (bran...@ifup.co) wrote: ControlGroup= is deprecated now drop this from systemd-nspawn@.service. Without this 206 has a broken systemd-nspawn@ unit. Commited a patch like this while you were sitting next to me! Thanks! Lennart -- Lennart Poettering

Re: [systemd-devel] [PATCH] udev: path_id - fix by-path link generation for scm devices

2013-09-17 Thread Kay Sievers
On Tue, Sep 17, 2013 at 12:16 PM, Sebastian Ott seb...@linux.vnet.ibm.com wrote: Set some_transport = true to prevent scm devices from being ignored. Applied. Thanks, Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org

[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

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 17:40, David Herrmann (dh.herrm...@gmail.com) wrote: Applied #6 to #9, please update/rebase #5 and #10. Thanks a lot! 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

Re: [systemd-devel] [ANNOUNCE] systemd 207

2013-09-17 Thread Lennart Poettering
On Fri, 13.09.13 15:15, Colin Guthrie (gm...@colin.guthr.ie) wrote: 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and gimble: * The option discard (as known from Debian) is now synonymous to allow-discards in /etc/crypttab. In fact, the

Re: [systemd-devel] Should systemd-logind provide a DM-independent specification for per seat autologin settings and others?

2013-09-17 Thread Lennart Poettering
On Fri, 13.09.13 09:14, Laércio Benedito Sivali de Sousa (lbsous...@gmail.com) wrote: Hi guys! With systemd-logind, we finally have a canonical way to implement multiseat in Linux. As current display managers implement completely logind's protocol for automatic multiseat support, per seat

Re: [systemd-devel] systemd shutdown vs ostree

2013-09-17 Thread Lennart Poettering
On Sun, 15.09.13 17:26, Koen Kooi (k...@dominion.thruhere.net) wrote: On Sat, Sep 14, 2013 at 10:52 AM, Koen Kooi k...@dominion.thruhere.net wrote: Please keep in mind that pstore is x86 only. EFI isn't x86 only, but exceedingly rare outside of that arch. What? Pstore itself isn't.

[systemd-devel] bug #64614 and journal seeking woes

2013-09-17 Thread Zbigniew Jędrzejewski-Szmek
Hi, I was looking at https://bugs.freedesktop.org/show_bug.cgi?id=64614 tl;dr: doing sd_journal_seek_tail() sd_journal_next() sd_journal_next() sd_journal_next() sd_journal_next() returns 1 (success) each time, and random entries. Likewise, doing sd_journal_seek_head()

[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

Re: [systemd-devel] [ANNOUNCE] systemd 207

2013-09-17 Thread Jan Engelhardt
On Tuesday 2013-09-17 21:03, Lennart Poettering wrote: On Fri, 13.09.13 15:15, Colin Guthrie (gm...@colin.guthr.ie) wrote: 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and gimble: * The option discard (as known from Debian) is now synonymous to

Re: [systemd-devel] [ANNOUNCE] systemd 207

2013-09-17 Thread Lennart Poettering
On Wed, 18.09.13 00:13, Jan Engelhardt (jeng...@inai.de) wrote: On Tuesday 2013-09-17 21:03, Lennart Poettering wrote: On Fri, 13.09.13 15:15, Colin Guthrie (gm...@colin.guthr.ie) wrote: 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and gimble: * The

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 23:40, David Herrmann (dh.herrm...@gmail.com) wrote: Applied both! Thanks a lot! 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.

Re: [systemd-devel] [ANNOUNCE] systemd 207

2013-09-17 Thread Lennart Poettering
On Wed, 18.09.13 00:15, Lennart Poettering (lenn...@poettering.net) wrote: On Tuesday 2013-09-17 21:03, Lennart Poettering wrote: On Fri, 13.09.13 15:15, Colin Guthrie (gm...@colin.guthr.ie) wrote: 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and gimble:

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

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

Re: [systemd-devel] User journal corrupted or uncleanly shut down, renaming and replacing

2013-09-17 Thread Pedro Francisco
On Wed, Sep 11, 2013 at 6:33 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 12.08.13 14:58, Pedro Francisco (pedrogfranci...@gmail.com) wrote: Hi, Systemd complains frequently about corrupted journal. Do note: I don't have the default mount options. $ dmesg |grep corrupte [

Re: [systemd-devel] [ANNOUNCE] systemd 207

2013-09-17 Thread Jan Engelhardt
On Wednesday 2013-09-18 00:15, Lennart Poettering wrote: In pam_mount where discard too had been feature-requested (and then implemented according to the way it sounds): allow-discards _allows_ discarding, but only discard would make it such that the filesystem issues discards to the block

[systemd-devel] [PATCH] util: preserve get_process_capeff behavior

2013-09-17 Thread Shawn Landden
69ab80881552d5f79ca95f6b3be48ad122ab1ec2 tried to unify parsing of status files, but removed the logic of skipping extra '0's when getting the effective capabilities. Restore that logic. --- src/shared/util.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git

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

2013-09-17 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Sep 18, 2013 at 01:00:02AM +0200, David Herrmann wrote: 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. Applied. Zbyszek

[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] [PATCH] util: preserve get_process_capeff behavior

2013-09-17 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 17, 2013 at 03:48:46PM -0700, Shawn Landden wrote: 69ab80881552d5f79ca95f6b3be48ad122ab1ec2 tried to unify parsing of status files, but removed the logic of skipping extra '0's when getting the effective capabilities. Restore that logic. Oh, I removed the logic on purpose, because

Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

2013-09-17 Thread Chen Hanxiao
-Original Message- From: Lennart Poettering [mailto:lenn...@poettering.net] Sent: Wednesday, September 18, 2013 12:54 AM To: Chen Hanxiao Cc: systemd-devel@lists.freedesktop.org Subject: Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage On