Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-19 Thread Kok, Auke-jan H
On Tue, Jun 19, 2012 at 5:17 AM, Kok, Auke-jan H
auke-jan.h@intel.com wrote:
 On Mon, Jun 18, 2012 at 5:22 PM, Peeters Simon peeters.si...@gmail.com 
 wrote:
 also i have been running the patch succesfully (both in system mode
 and in my systemd-gnome-session (which i will share soon)) for a while
 now (read: since last week) without any problem.

 ah nice! is that on systemd HEAD? Love to see the code :^)

 systemd-185-3.fc18, i dont like building a lot of stuff (poor atom cpu)

 the idea is based on your code, but split up in 3 parts:
 - the main daemon: starts session prepares for X and launches systemd
 as user (the daemon itself stays root)

 Argh!

 So you run a daemon as root. Do you pam_open_session() and all?

 I'm running into this:

 systemd[1]: Failed to create cgroup cpu:/: No such file or directory
 systemd[4393]: Failed at step CGROUP spawning
 /usr/lib/systemd/systemd: Invalid argument

snip

Turns out I had somehow lost CONFIG_CGROUP_SCHED=y

I started digging in git for the documentation about kernel options,
obviously, there is none :(

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-18 Thread Peeters Simon
2012/6/18 Léo Gillot-Lamure leo.gil...@navaati.net:
 Hello.

 I'm trying to get systemd work as the user session supervisor, thus i
 want it to launch the dbus daemon for the session. Systemd seems to
 require that dbus is socket activated (service units of Type=dbus have a
 Require dep on dbus.socket, not on dbus.service), so i created the
 relevant .socket and .service unit files. Taking inspiration from the
 unit files at the system level, i put /usr/bin/dbus-daemon --session
 --address=systemd: --nofork --systemd-activation as the ExecStart
 command line for the daemon. The session boots up, the dbus daemon is
 launched by the socket activation, the gnome panel is properly launched
 (trough a unit file) and registers to the bus, messages on the bus are
 correctly passed, everything seems fine.
 Except the bus-activation of services. For example launching
 gnome-terminal doesn't work because it tries to launch something (can't
 remember what, maybe it was gconf, or some gvfs stuff) using the bus and
 it fails. The result is exactly the same when not using the
 --systemd-activation flag. This message
 http://lists.freedesktop.org/archives/systemd-devel/2012-May/005301.html
 says that it's a dbus bug, because the daemon launches bus-activated
 processes with DBUS_SESSION_BUS_ADDRESS==systemd:,guid=hash which is
 broken.

 Thus arise two questions :
 - Auke, considering this problem how did you manage to get the
 session-wide DBus work in your Meego systemd --user experiment ?
 - Dear DBus folks, could this bug be fixed ? Maybe there are already
 patches around fixing it ? I could not see any mention of it on the
 mailing list.

link to the bug (and patch) is
https://bugs.freedesktop.org/show_bug.cgi?id=50962

the last version of the patch is functionnally correct, but i still
have to clean up some things (or maybe somebody else can) before it
can get in, unfortunatly i am now studying for my exams, so a next
patch will take at least another week.

also i have been running the patch succesfully (both in system mode
and in my systemd-gnome-session (which i will share soon)) for a while
now (read: since last week) without any problem.


Simon
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-18 Thread Kok, Auke-jan H
On Mon, Jun 18, 2012 at 2:35 PM, Peeters Simon peeters.si...@gmail.com wrote:
 2012/6/18 Léo Gillot-Lamure leo.gil...@navaati.net:
 Hello.

 I'm trying to get systemd work as the user session supervisor, thus i
 want it to launch the dbus daemon for the session. Systemd seems to
 require that dbus is socket activated (service units of Type=dbus have a
 Require dep on dbus.socket, not on dbus.service), so i created the
 relevant .socket and .service unit files. Taking inspiration from the
 unit files at the system level, i put /usr/bin/dbus-daemon --session
 --address=systemd: --nofork --systemd-activation as the ExecStart
 command line for the daemon. The session boots up, the dbus daemon is
 launched by the socket activation, the gnome panel is properly launched
 (trough a unit file) and registers to the bus, messages on the bus are
 correctly passed, everything seems fine.
 Except the bus-activation of services. For example launching
 gnome-terminal doesn't work because it tries to launch something (can't
 remember what, maybe it was gconf, or some gvfs stuff) using the bus and
 it fails. The result is exactly the same when not using the
 --systemd-activation flag. This message
 http://lists.freedesktop.org/archives/systemd-devel/2012-May/005301.html
 says that it's a dbus bug, because the daemon launches bus-activated
 processes with DBUS_SESSION_BUS_ADDRESS==systemd:,guid=hash which is
 broken.

 Thus arise two questions :
 - Auke, considering this problem how did you manage to get the
 session-wide DBus work in your Meego systemd --user experiment ?
 - Dear DBus folks, could this bug be fixed ? Maybe there are already
 patches around fixing it ? I could not see any mention of it on the
 mailing list.

 link to the bug (and patch) is
 https://bugs.freedesktop.org/show_bug.cgi?id=50962

 the last version of the patch is functionnally correct, but i still
 have to clean up some things (or maybe somebody else can) before it
 can get in, unfortunatly i am now studying for my exams, so a next
 patch will take at least another week.

 also i have been running the patch succesfully (both in system mode
 and in my systemd-gnome-session (which i will share soon)) for a while
 now (read: since last week) without any problem.

ah nice! is that on systemd HEAD? Love to see the code :^)

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-18 Thread Peeters Simon
 also i have been running the patch succesfully (both in system mode
 and in my systemd-gnome-session (which i will share soon)) for a while
 now (read: since last week) without any problem.

 ah nice! is that on systemd HEAD? Love to see the code :^)

systemd-185-3.fc18, i dont like building a lot of stuff (poor atom cpu)

the idea is based on your code, but split up in 3 parts:
- the main daemon: starts session prepares for X and launches systemd
as user (the daemon itself stays root)
- an Xorg wrapper, responsible for extracting the X commandline passed
in trough the environment, executing Xorg and reporting back to
systemd when X is ready, this runs as a service within the user
session
- a small dbus catch/forward daemon to make logout/shutdown work
without gnome-session-manager (speaks to the systemd user session for
logout and logind for shutdown)

gnome startup went from 18 to 5sec
but i will share code soon (after i cleaned up a bit)(friday or the weekend)

also when working with systemd both on system and session level i made
a dirty modification to systemd-analyze (called systemd-analyze-dual)
to get data from system and session at the same time
(https://gist.github.com/2917504/).
this shows the big picture of the boot process.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-18 Thread Kok, Auke-jan H
On Mon, Jun 18, 2012 at 10:22 AM, Peeters Simon peeters.si...@gmail.com wrote:
 also i have been running the patch succesfully (both in system mode
 and in my systemd-gnome-session (which i will share soon)) for a while
 now (read: since last week) without any problem.

 ah nice! is that on systemd HEAD? Love to see the code :^)

 systemd-185-3.fc18, i dont like building a lot of stuff (poor atom cpu)

 the idea is based on your code, but split up in 3 parts:
 - the main daemon: starts session prepares for X and launches systemd
 as user (the daemon itself stays root)
 - an Xorg wrapper, responsible for extracting the X commandline passed
 in trough the environment, executing Xorg and reporting back to
 systemd when X is ready, this runs as a service within the user
 session

Have you seen/tried
http://foo-projects.org/~sofar/xorg-launch-helper/xorg-launch-helper-3.tar.gz
?

 - a small dbus catch/forward daemon to make logout/shutdown work
 without gnome-session-manager (speaks to the systemd user session for
 logout and logind for shutdown)

 gnome startup went from 18 to 5sec
 but i will share code soon (after i cleaned up a bit)(friday or the weekend)

 also when working with systemd both on system and session level i made
 a dirty modification to systemd-analyze (called systemd-analyze-dual)
 to get data from system and session at the same time
 (https://gist.github.com/2917504/).
 this shows the big picture of the boot process.

ultimately, we should merge that code into systemctl the way that
'systemctl dot'
works - I really don't like having a separate tool for one plot that
requires python
etc. at runtime. It's not going to be workable for embedded systemd.

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd socket activation of DBus in the user session

2012-06-18 Thread Kok, Auke-jan H
On Mon, Jun 18, 2012 at 5:22 PM, Peeters Simon peeters.si...@gmail.com wrote:
 also i have been running the patch succesfully (both in system mode
 and in my systemd-gnome-session (which i will share soon)) for a while
 now (read: since last week) without any problem.

 ah nice! is that on systemd HEAD? Love to see the code :^)

 systemd-185-3.fc18, i dont like building a lot of stuff (poor atom cpu)

 the idea is based on your code, but split up in 3 parts:
 - the main daemon: starts session prepares for X and launches systemd
 as user (the daemon itself stays root)

Argh!

So you run a daemon as root. Do you pam_open_session() and all?

I'm running into this:

systemd[1]: Failed to create cgroup cpu:/: No such file or directory
systemd[4393]: Failed at step CGROUP spawning
/usr/lib/systemd/systemd: Invalid argument

spawning `systemd --user` from a system unit directly, with HEAD. If I
start it manually, no problems (but no CGROUP either).

Kay, Lennart, ideas? This worked before.

pre-HEAD has this mounted:

cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
but HEAD now has:
cgroup on /sys/fs/cgroup/cpuset type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuset)
??

Also, I'm running your dbus patch (patched 1.6.0 vanilla with it), and
that works like a charm, thanks!


Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel