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:[email protected]] > Sent: Wednesday, September 18, 2013 12:54 AM > To: Chen Hanxiao > Cc: [email protected] > Subject: Re: [systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of > memory+Swap usage >

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, becau

[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 +++- src/login/login

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] 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 a/src

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 t

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 wrote: > On Mon, 12.08.13 14:58, Pedro Francisco ([email protected]) wrote: > >> Hi, >> Systemd complains frequently about corrupted journal. Do note: I don't >> have the default mount options. >> >> $ dmesg |grep corrupte >> [ 51.76634

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

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

2013-09-17 Thread Lennart Poettering
On Wed, 18.09.13 00:15, Lennart Poettering ([email protected]) wrote: > > On Tuesday 2013-09-17 21:03, Lennart Poettering wrote: > > >On Fri, 13.09.13 15:15, Colin Guthrie ([email protected]) wrote: > > >> > > >> 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and > > >>

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

2013-09-17 Thread Lennart Poettering
On Tue, 17.09.13 23:40, David Herrmann ([email protected]) 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:13, Jan Engelhardt ([email protected]) wrote: > > > On Tuesday 2013-09-17 21:03, Lennart Poettering wrote: > >On Fri, 13.09.13 15:15, Colin Guthrie ([email protected]) wrote: > >> > >> 'Twas brillig, and Lennart Poettering at 13/09/13 03:16 did gyre and > >> gimble: > >> >

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 ([email protected]) 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 >> > synonymou

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

[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() sd_jou

Re: [systemd-devel] systemd shutdown vs ostree

2013-09-17 Thread Lennart Poettering
On Sun, 15.09.13 17:26, Koen Kooi ([email protected]) wrote: > > On Sat, Sep 14, 2013 at 10:52 AM, Koen Kooi > > 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. It's a gener

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 ([email protected]) 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

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

2013-09-17 Thread Lennart Poettering
On Fri, 13.09.13 15:15, Colin Guthrie ([email protected]) 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, > >

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

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 ([email protected]) 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

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 wrote: > > Set some_transport = true to prevent scm devices from being ignored. Applied. Thanks, Kay ___ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman

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

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

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 ([email protected]) wrote: > " \n" \ > " \n" \ > " \n"\ > +" \n" \ > +" \n"

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 ([email protected]) 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

[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 Signed-off-by: Sebastian Ott --- src/udev/udev-builtin-path_id.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index da02731..

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 ([email protected]) wrote: > On Tue, 17.09.13 14:21, Chen Hanxiao ([email protected]) wrote: > > > From: Chen Hanxiao > > > > @@ -89,6 +89,7 @@ $1.CPUAccounting,config_parse_bool, > >0, > > $1.CPUShares

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 ([email protected]) 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, an

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

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 ([email protected]) 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 g

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 ([email protected]) 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 se

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

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. > > Whil

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 ([email protected]) 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

[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 a/src/login/log

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 ([email protected]) wrote: > From: Chen Hanxiao > > @@ -89,6 +89,7 @@ $1.CPUAccounting,config_parse_bool, > 0, > $1.CPUShares,config_parse_cpu_shares,0, >

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

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

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

2013-09-17 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 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 see

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

[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

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 ([email protected]) wrote: > +{ "MemorySWLimit", bus_property_append_uint64, > "t", offsetof(CGroupContext, memsw_limit) }, > { "MemorySoftLimit", bus_property_append_uint64, > "t", o

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, 황재영 ([email protected]) 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 thre

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 ([email protected]) wrote: > > On 09/13/2013 08:26 PM, Lennart Poettering wrote: > > On Fri, 13.09.13 17:49, Gao feng ([email protected]) wrote: > > > >> Some programs need to set the memory.use_hierarchy(such as libvirt), > >> Add this feature. > > >

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 Gu

[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 Add support for systemctl to set limit of memory+Swap usage. Signed-off-by: Chen Hanxiao --- src/systemctl/systemctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 57e5bb9..116e0b5 100644 --

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

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

[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 Add support for showing limit of memory+Swap usage via cgroup_context_dump. Signed-off-by: Chen Hanxiao --- src/core/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index d8bc318..c6a1690 100644 --- a/src/core/cgroup.c +++

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

2013-09-17 Thread Chen Hanxiao
From: Chen Hanxiao 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 systemctl to set limit of memo